gpt4 book ai didi

html - 关闭音频文件的自动播放

转载 作者:行者123 更新时间:2023-11-28 03:26:56 25 4
gpt4 key购买 nike

我在我正在制作的网站中加入了一个音频问候语,并希望音频仅在用户点击播放时开始播放。我将其设置为 autoplay="falseautostart="false"

到目前为止,这是我的代码

<section>           
<h1>Welcome to Morlans Famous Shop!</h1>
<object>
<param name="greetings" value="audio/EN_sta60_black_market_00083397_M.wav" />
<param name="autostart" value="false" />
<param name="autoplay" value="false"/>
<param name="controller" value="true" />
<embed src="audio/EN_sta60_black_market_00083397_M.wav" controller="true" autoplay="false" autostart="false" type="audio/wav" pluginspage="http://www.apple.com/quicktime/download/" />
</object>
<p>Hello there. Welcome to Morlans famous shop. You want many good supplies, yes? </p>
<p>My shop carries all sorts of supplies need to survive the tough environments that the galaxy has to offer. From medigel, to armor, Morlans famous shop carries it all.</p>
<p>Oh, you will be pleased I think. Very good things I have, you will see.</p>
</section>

有什么我遗漏的吗?如有任何帮助,我们将不胜感激

最佳答案

<script language="javascript" type="text/javascript">
function playSound(soundfile) {
document.getElementById("dummy").innerHTML= "<embed src=\""
+soundfile+"\" hidden=\"true\" autostart=\"true\"
loop=\"false\" />";
}
</script>

看看那个。取自该站点。

http://webdesign.about.com/od/sound/a/play_sound_oncl.htm

虽然这需要 javascript。

还有问题吗?看这里了解音频的使用http://www.w3schools.com/html/html_sounds.asp

关于html - 关闭音频文件的自动播放,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20648378/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com