我在我正在制作的网站中添加了一个音频问候语,并希望音频仅在用户点击播放时启动。我将其设置为autoplay="false
和autostart="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>
有什么我想念的吗?任何帮助都将不胜感激
答案 0 :(得分:0)
<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
的使用情况