本文介绍了我在页面上有多个HTML5流播放器。如何让他们互相独占?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的页面上有多个HTML5流媒体播放器实例。当我开始玩一个,然后点击另一个,第一个不停止。有没有办法配置它,以便一次只能播放一个?

I have Multiple HTML5 flow player instances on my page. When I start to play one, then click on another one, the first one doesn't stop. Is there any way to configure it so that only one will play at a time?

以下是测试页的代码:

<html>
<head>
    <script type="text/javascript"
        src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js">
    </script>

    <!-- 2. flowplayer -->
    <script type="text/javascript"
        src="//releases.flowplayer.org/5.4.1/flowplayer.min.js">
    </script>

    <!-- 3. skin -->
    <link rel="stylesheet" type="text/css"
        href="//releases.flowplayer.org/5.4.1/skin/minimalist.css">
    <title>title</title>
</head>
<body>
    <div>
        <div class="flowplayer">
            <video>
                <source type="video/mp4" src="PATH TO VIDEO 1">
            </video>
        </div>
    </div>
    <div>
        <div class="flowplayer">
            <video>
                <source type="video/mp4" src="PATH TO VIDEO 2">
            </video>
        </div>
    </div>
</body>
</html>


推荐答案

好的。终于找到了!这是一个名为Splash的功能

Ok. Finally found it! It's a feature called "Splash"

来自文档:

这篇关于我在页面上有多个HTML5流播放器。如何让他们互相独占?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 21:25