【问题标题】:Flowplayer video keeps playing in background hidden spanFlowplayer 视频在后台隐藏跨度中持续播放
【发布时间】:2012-08-26 11:47:35
【问题描述】:

这里是索引文件(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 来显示/隐藏。 但是,上一个跨度的视频在后台继续播放。 如何停止所有其他视频并仅播放当前视频?

P.S.:它在 windows 上运行良好:chrome、firefox。

但是在 mac 上使用 firefox 有问题。

【问题讨论】:

    标签: javascript php flowplayer video-player


    【解决方案1】:

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

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

    【讨论】:

    • 谢谢,它成功了,我也开始了下一页的视频
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-08-27
    • 1970-01-01
    • 2013-07-27
    • 1970-01-01
    • 2015-11-23
    • 2014-03-27
    • 1970-01-01
    相关资源
    最近更新 更多