0

当我访问我正在使用自动播放的网站中的每个页面时,我想添加几秒钟的延迟。是否有任何参数可以与 flashvars 一起使用,以便我可以在音乐开始之前添加几秒钟的延迟,因为enter code here每次访问新页面时默认音乐都会开始 1 或 2 秒。

<<>>`

<object type="application/x-shockwave-flash" wmode="transparent" data="player_mp3_maxi.swf" width="65" height="20">
<param name="movie" value="player_mp3_maxi.swf" />
<param name="bgcolor" value="#ffffff" />
<param name="wmode" value="transparent" />
<param name="FlashVars" value="mp3=dummy.mp3&amp;width=65&amp;loop=0&amp;autoplay=1&  amp;volume=60&amp;showvolume=1&amp;showslider=0&amp;showloading=always&amp;buttonwidth=30&amp;volumeheight=8&amp;" />
</object>

<<>>

<script type="text/javascript">
$(document).ready(function () {
var mp3snd = "/JSRDS/Content/mp3s/PPK_Resurection.mp3";
if ((window.top.location.toString().toLowerCase().lastIndexOf("root/") + 6) ==         window.top.location.toString().toLowerCase().length) {mp3snd = "PPK_Resurection.mp3";
}
else if (window.top.location.toString().toLowerCase().indexOf('page1.aspx') != -1) {
 mp3snd = "PPK_Resurection.mp3";
}
else if (window.top.location.toString().toLowerCase().indexOf('page2.aspx') != -1) {
mp3snd = "GottaWearShades_Intellect.mp3";
}
else if (window.top.location.toString().toLowerCase().indexOf('page3.aspx') != -1) {
mp3snd = "MissionImpossible_Rhodium.mp3";
}
        else if (window.top.location.toString().toLowerCase().indexOf('page4.aspx') != -1) {
            mp3snd = "Opportunities_Projects.mp3";
        }
        else if (window.top.location.toString().toLowerCase().indexOf('page5.aspx') != -1) {
            mp3snd = "";
        }
        else if (window.top.location.toString().toLowerCase().indexOf('page6.aspx') != -1) {
            mp3snd = "HawaiiFiveO_Media.mp3";
        }
        else if (window.top.location.toString().toLowerCase().indexOf('page7.aspx') != -1) {
            mp3snd = "SayYouSayMe_Photos.mp3";
        }
        else if (window.top.location.toString().toLowerCase().indexOf('page8.aspx') != -1) {
            mp3snd = "TheLionSleepsTonight_Shihara.mp3";
        }
        else if (window.top.location.toString().toLowerCase().indexOf('page9.aspx') != -1) {
            mp3snd = "ItsMyLife192vbr_History.mp3";
        }
        else if (window.top.location.toString().toLowerCase().indexOf('page10.aspx') != -1) {
            mp3snd = "";
        }
        else if (window.top.location.toString().toLowerCase().indexOf('page11.aspx') != -1) {
            mp3snd = "";
        }
        else if (window.top.location.toString().toLowerCase().indexOf('page12.aspx') != -1) {
            mp3snd = "";
        }

        $(".volumeControl").html($(".volumeControl").html().replace("dummy.mp3", mp3snd));
    });
</script>

`

4

1 回答 1

0

如果您可以控制 swf(即有 fla),那么只需使用setTimeout

然后可以通过在 flashvars 中传递参数来控制逻辑。

stop();

setTimeout( playMovie, 1000 )

function playMovie() {

     play();
}

在 JS 中,您可以使用swfobjectsetTimeout延迟将文件注入页面。

setTimeout (injectSWF , 1000);

function injectSWF() { 

     swfobject.embedSWF("myMovie.swf", "ofc", "100%", "100%", "9.0.0"); 
}
于 2012-07-27T05:07:36.743 回答