preloading音频文件 [英] preloading audio files

查看:109
本文介绍了preloading音频文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要preLOAD音频文件在我的网站。我正在使用的HTML页面下面code。

I want to preload audio files in my website. I am using the following code in html page.

<embed src="cheer.swf" hidden="true" autostart=false style="height:0px; width:0px"> 
<embed src="click.swf" hidden="true" autostart=false style="height:0px; width:0px"> 
<embed src="doowip.swf" hidden="true" autostart=false style="height:0px; width:0px">

但仍然是所有音频文件在页面的开始播放。如何停止的音频文件自动播放。

But still all the audio files are played at the beginning of the page. how can i stop the autoplay of audio files.

另外我怎么能preLOAD为iPad Safari浏览器中的文件?

Also how can i preload the files for ipad safari?

<audio id="genclick" src="click.wav" type="audio/wav" >
<audio src="doowip.wav" type="audio/wav" >
<audio src="cheer.wav" type="audio/wav" >

以上code不加载该文件,直到我从JavaScript玩..

the above code not loading the file until i play it from javascript..

document.getElementById("genclick").play();

我要去哪里错了??

where am I going wrong??

推荐答案

根据 HTTP: //kb2.adobe.com/cps/127/tn_12701.html 您正在寻找的参数名(为SWF'嵌入'标签)是玩,而不是自动启动。因此,将其更改为:

According to http://kb2.adobe.com/cps/127/tn_12701.html the parameter name you're looking for (for the swf 'embed' tags) is 'play', not 'autostart'. Therefore, change them to:

<embed src="cheer.swf" hidden="true" play="false" style="height:0px; width:0px" />

您也可以把它们对象的标签,然后使用:

You could also put them within object tags and then use:

<param name="play" value="false" />

我这个测试自己,和它的作品。至于iPad的Safari浏览器标签,HTML5音频标记有一个名为preLOAD'的属性,当其设置为自动应该preLOAD中的文件,只要你想。尝试:

I've tested this myself, and it works. As for the tags for iPad Safari, the HTML5 audio tag has an attribute called 'preload', which when set to 'auto' should preload the files as you want. Try:

<audio src="doowip.wav" type="audio/wav" preload="auto" />

我希望这有助于。

I hope this helps.

这篇关于preloading音频文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆