Commit f1759021 by libai

测试

parent 6412fb23
Showing with 12 additions and 2 deletions
......@@ -633,7 +633,7 @@ $(function () {
html += '<video controls webkit-playsinline ="true" playsinline ="true" autoplay ="" playsinline="true" class="live-video" src="" id="videoElement" loop="" ></video>';
$(".live-content-box-left-roombox").html(html)
flvPlay(data.pullFlowUrl)
// Autoplay was prevented.
// Show a "Play" button so that user can start playback.
});
......@@ -1480,7 +1480,17 @@ $(function () {
$("#videoElement").prop('muted', false)
flvPlayer.play()
})
const video = document.getElementById('videoElement');
video.addEventListener('canplay',canplay);
function canplay(){
const a = document.createElement('a');
a.onclick = function(){
video.play();//这样就可以自动播放了
}
const event = new MouseEvent('click');
a.dispatchEvent(event );
video.removeEventListener('canplay',canplay);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment