0%

监听微信自动播放视频


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//视频音频同理
<video id='Jvideo' src='{{env('CDN_DOMAIN_NAME') }}/upload_video/"+detail_data[i][2]+"' preload='auto' webkit-playsinline='webkit-playsinline' playsinline='playsinline' autoplay='true' poster type='video/mp4' style='width:100%;height:100%;'></video>

function videoAutoPlay(id){
var video = document.getElementById(id);
video.play();
document.addEventListener("WeixinJSBridgeReady", function () {
video.play();
}, false);
document.addEventListener('YixinJSBridgeReady', function() {
video.play();
}, false);
video.onended = function() { //播放结束
$(".video_play").show();
};
}
videoAutoPlay('Jvideo');

$(document).on("click",".video_play",function(){ //播放完点击播放
$(".video_play").hide();
videoAutoPlay('Jvideo');
});
------ The End ------
您的认可是我不断进步的动力!