Commit a1ab7a8c by libai

测试

parent 18671a03
Showing with 19 additions and 3 deletions
...@@ -695,20 +695,36 @@ $(function(){ ...@@ -695,20 +695,36 @@ $(function(){
$(".sound-btn").attr("src","images/sound-yes.png") $(".sound-btn").attr("src","images/sound-yes.png")
$(".gift-btn").attr("src","images/gift-btn.png") $(".gift-btn").attr("src","images/gift-btn.png")
$(".video-box video").prop("muted",false) $(".video-box video").prop("muted",false)
html+='<video id="myVideo" autoplay webkit-playsinline="true" x-webkit-airplay="true" playsinline="true" x5-video-player-type="h5" x5-video-player-fullscreen="true" style="height:100%;object-fit:fill;position:absolute;z-index: 10" poster="" src="'+data.pullFlowUrlHLS+'"></video>'
html+='<video id="myVideo" class="video-js" autoplay preload="auto" poster="">';
html+='<source src="'+data.pullFlowUrlHLS+'" type="rtmp/flv">';
html+='</video>';
// html+='<video id="myVideo" autoplay webkit-playsinline="true" x-webkit-airplay="true" playsinline="true" x5-video-player-type="h5" x5-video-player-fullscreen="true" style="height:100%;object-fit:fill;position:absolute;z-index: 10" poster="" src="'+data.pullFlowUrlHLS+'"></video>'
}else{ }else{
html+='<video id="myVideo" class="video-js" controls preload="auto" poster="" data-setup="{}">'; html+='<video id="myVideo" class="video-js" autoplay preload="auto" poster="" >';
html+='<source src="'+data.pullFlowUrlHLS+'" type="rtmp/flv">'; html+='<source src="'+data.pullFlowUrlHLS+'" type="rtmp/flv">';
html+='</video>'; html+='</video>';
// html+='<video muted id="myVideo" autoplay webkit-playsinline="true" x-webkit-airplay="true" playsinline="true" x5-video-player-type="h5" x5-video-player-fullscreen="true" style="height:100%;object-fit:fill;position:absolute;z-index: 10" poster="" src="'+data.pullFlowUrlHLS+'"></video>' // html+='<video muted id="myVideo" autoplay webkit-playsinline="true" x-webkit-airplay="true" playsinline="true" x5-video-player-type="h5" x5-video-player-fullscreen="true" style="height:100%;object-fit:fill;position:absolute;z-index: 10" poster="" src="'+data.pullFlowUrlHLS+'"></video>'
} }
}else{ }else{
html+='<video muted id="myVideo" autoplay webkit-playsinline="true" x-webkit-airplay="true" playsinline="true" x5-video-player-type="h5" x5-video-player-fullscreen="true" style="height:100%;object-fit:fill;position:absolute;z-index: 10" poster="" src="'+data.pullFlowUrlHLS+'"></video>' html+='<video id="myVideo" class="video-js" autoplay preload="auto" poster="" >';
html+='<source src="'+data.pullFlowUrlHLS+'" type="rtmp/flv">';
html+='</video>';
// html+='<video muted id="myVideo" autoplay webkit-playsinline="true" x-webkit-airplay="true" playsinline="true" x5-video-player-type="h5" x5-video-player-fullscreen="true" style="height:100%;object-fit:fill;position:absolute;z-index: 10" poster="" src="'+data.pullFlowUrlHLS+'"></video>'
} }
$(".video-box").html(html) $(".video-box").html(html)
let options = {};
let player = videojs('myVideo', options, function onPlayerReady() {
videojs.log('播放器准备好了!');
// In this context, `this` is the player that was created by Video.js.
this.play();
this.on('ended', function() {
videojs.log('播放结束!');
});
});
$("#myVideo").on("canplay",function(){ $("#myVideo").on("canplay",function(){
setTimeout(function() { setTimeout(function() {
clearInterval(loadT) clearInterval(loadT)
......
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