Phonegap:是否可以使用html5视频标签在同一页面上同时播放多个视频?

时间:2015-02-10 15:15:58

标签: android jquery html5 cordova video

我正在使用HTML5视频标签在phonegap app中播放视频。在我的应用中,我有一个包含多个视频的列表页面。我想同时播放它们。

问题 ------- 要在我使用的phonegap android中播放视频

$("#id").get(0).play();
$("#id1").get(0).play();
$("#id2").get(0).play();

只有最后一个视频播放,如果点击其他视频,它会启动但暂停其他视频。 我不知道问题。

HTML

    <!DOCTYPE html>
    <html>
    <head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
    <script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
    </head>
    <body>

    <div data-role="page">
      <div data-role="header">
        <h1>Welcome To My Homepage</h1>
      </div>

      <div data-role="main" class="ui-content">
        <p>I Am Now A Mobile Developer!!</p>
        <video class='androidVid' id='video1' style='width:100%;height:240px' muted>
            <source type='application/x-mpegURL' src='http://xx.xx.xx.xx/HLS/clawview.m3u8?t=Math.random()'>
            Your browser does not support the video tag.
        </video>
        <video class='androidVid' id='video2' style='width:100%;height:240px' muted>
            <source type='application/x-mpegURL' src='http://xx.xx.xx.xx/HLS/clawview.m3u8?t=Math.random()'>
            Your browser does not support the video tag.
        </video>

      </div>

      <div data-role="footer">
        <h1>Footer Text</h1>
      </div>
    </div> 
    <script>
    $(function(){
    $("#video1").get(0).play();
    $("#video2").get(0).play();
    });

    </script>
    </body>
    </html>

感谢

0 个答案:

没有答案