function Forvo_Ext_Play(id, path_mp3, path_ogg) { var audioTagSupport = !!(document.createElement('audio').canPlayType); if (audioTagSupport) { var userAgent = navigator.userAgent.toLowerCase(); var isMobile = /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(userAgent); var audio = document.createElement('audio'); var source = document.createElement('source'); if (audio.canPlayType('audio/mpeg;') || null == path_ogg) { source.type= 'audio/mpeg'; source.src= path_mp3; } else { source.type= 'audio/ogg'; source.src= path_ogg; } audio.appendChild(source); if (!isMobile) { audio.autoplay = true; } var icon = document.getElementById('play_'+ id); var loadAudioPlay = function () { icon.src = 'http://forvo.com/_presentation/img/play-loading.gif'; }; var startAudioPlay = function () { icon.src = 'http://forvo.com/_presentation/img/play-ani.gif'; }; var errorAudioPlay = function () { icon.src = 'http://forvo.com/_presentation/img/ico_play_no.gif'; }; var endAudioPlay = function () { icon.src = 'http://forvo.com/_presentation/img/ico_play.gif'; }; audio.addEventListener('loadstart', loadAudioPlay, false); audio.addEventListener('play', startAudioPlay, false); audio.addEventListener('error', errorAudioPlay, false); audio.addEventListener('ended', endAudioPlay, false); if (isMobile) { audio.play(); } } else { var html='' +'' +'' +'' ; if (!document.getElementById('forvo_ext_player')) { document.write(''); } var container = document.getElementById('forvo_ext_player'); container.innerHTML = html; } } document.write('Listen to Aurelia pronunciation by Forvo Aurelia');