停止/静音音频

Stopping/muting audio

本文关键字:音频 停止      更新时间:2023-09-26

单击带有类"iFrame"的链接时,如何暂停以下音频对象?

<object type="application/x-shockwave-flash" data="../flash/player_mp3_maxi.swf" width="140" height="20">
<param name="wmode" value="transparent">
<param name="movie" value="../flash/player_mp3_maxi.swf">
<param name="FlashVars" value="configxml=../flash/config.xml&amp;mp3=../audio/intro/intro_08_background_07.mp3">
<p>Flash Audio Player</p>
</object>

我需要用javascript或jquery编写代码。

如果它是你自己的.swf并且可以重新编译它,我会说你需要使用外部接口公开播放器暂停方法。如果您以前没有做过,请查看 http://livedocs.adobe.com/flex/3/html/help.html?content=19_External_Interface_04.html

完成此操作后,您只需将事件侦听器添加到 HTML 链接并分配一个要在用户单击时触发的函数。此函数调用曝光的闪光灯函数以暂停。

theLink.addEventListener("click", function(e){
    //call the exposed flash pause function
    swfObject.theExposedFunction();
});

意义?