页面加载完成后,带有videojs的rtmp视频暂停

时间:2018-08-23 02:19:17

标签: html5-video video.js rtmp

页面加载完成后,带有videojs的rtmp视频有时会暂停。

  1. Bug Video Demo,耗时18-25秒。

  2. HTML代码。

<head>
    <link href="css/video-js.css" rel="stylesheet">
    <script src="js/jquery.min.js"></script>
    <script src="js/video.js"></script>
    <script src="js/videojs-flash.min.js"></script>
    ...
</head>

<body>
    ...
    <div class="d-flex mb-4">
        <div>
            <video id="leftCameraVideo" class="video-js vjs-playing vjs-has-started vjs-user-inactive" preload="auto" width="640" height="360" data-setup="{}" autoplay controls>
                <source src="rtmp://localhost/live/left" type="rtmp/flv">
            </video>
        </div>
        <div>
            <video id="middleCameraVideo" class="video-js vjs-playing vjs-has-started vjs-user-inactive" preload="auto" width="640" height="360" data-setup="{}" autoplay controls>
                <source src="rtmp://localhost/live/middle" type="rtmp/flv">
            </video>
        </div>
    </div>
</body>
  1. 这是我的视频状态检查,即使发生错误,结果也始终为“ false” 。
var left = videojs("leftCameraVideo");
var middle = videojs("middleCameraVideo");

$(document).ready(function() {
    setInterval(function() {
        console.log(left.paused());
        console.log(middle.paused());
    }, 5000);
});

0 个答案:

没有答案