Playing sound in internet explorer mobile 6

爱⌒轻易说出口 提交于 2019-12-10 22:06:02

问题


we have a web application which is targeted to work on Internet Mobile Explorer 6. We need to play a sound when the user inputs an incorrect ... "input". Any idea what is supported on ie mobile 6 and how I can achieve this ?

Thanks in advance.


回答1:


I know this question is somewhat old, but I think it still deserves an answer. This is how I got it working. If you are only targeting IE6 Mobile, you could so something like the following in your head tag:

<bgsound id="bgSoundId" loop="0" volume="100" />

And then have a JavaScript function like so:

function playSound() {
    document.getElementById("bgSoundId").src = "path/to/file.wav";
}

So, then you just call that function from your validation logic.




回答2:


Try <bgsound> in <embed> in <audio> (to support as much browser, as you could)

<audio src="sound.url" type="mime/type">
  <embed src="sound.url" type="mime/type">
    <bgsound src="sound.url">
    </bgsound>
  </embed>
</audio>

But embed & bgsound has no generic way to start playing from javascript, as far as i can tell.



来源:https://stackoverflow.com/questions/11364496/playing-sound-in-internet-explorer-mobile-6

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!