Flowplayer视频一直在隐藏的背景中播放

Flowplayer video keeps playing in background hidden span

本文关键字:背景 播放 隐藏 视频 一直 Flowplayer      更新时间:2023-09-26

这里是索引文件(javascript)

$(document).ready(function(){
    player("video-1.mov","player1");
    player("video-2.mov","player2");
    player("video-3.mov","player3");
});
function player(video,id) {
    flowplayer(id, "http://releases.flowplayer.org/swf/flowplayer-3.2.14.swf", {
        playlist: [video],
        clip:  {
              autoPlay: true,
              autoBuffering: true
        }
    });
}
function goto_next(current,page)
{
    $('#'+current).hide();
    $('#'+page).show();
    flowplayer.unload();
}

这是索引文件

<span id="1" class="step">
    <div class="player formplayer" id="player1"></div>
</span>
<span id="2" class="step" style="display:none;">
    <div class="player formplayer" id="player2"></div>
</span>
<span id="3" class="step" style="display:none;">
    <div class="player formplayer" id="player3"></div>
</span>

当我点击下一个按钮时,它会调用goto_next,并使用两个不同的id来显示/隐藏。但是,前一段的视频一直在后台播放。如何停止所有其他视频并仅播放当前视频

附言:它在窗户上运行良好:铬,萤火虫。

但是在mac上的firefox有问题。

尝试使用javascript api的stop()函数停止玩家(http://flowplayer.org/documentation/api/index.html)

function goto_next(current,page)
{
    flowplayer(0).stop();
    flowplayer(1).stop();
    flowplayer(2).stop();
    $('#'+current).hide();
    $('#'+page).show();
    flowplayer.unload();
}