84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
Another page uses video.js to initialize multiple video tags. Now when a video tag is played, if there is a video tag playing at this time, it will be paused. How to deal with it?
欢迎选择我的课程,让我们一起见证您的进步~~
var cur_video;
var setup = function(videoEl, options) { videoEl.bigPlayButton.controlTextEl_.textContent=videoEl.el().getAttribute('duration'); videoEl.on("play",function(){ if(cur_video && cur_video != videoEl)cur_video.pause(); cur_video = videoEl; }) videoEl.on("pause",function(){ if(cur_video==videoEl)cur_video==null; }) }; videojs.hook('setup', setup); var videos = [ videojs('example_video_1'), videojs('example_video_2'), videojs('example_video_3') ]
Send me a demo so that if anyone encounters it in the future, you can refer to it.
Traverse all videos, pause them all and then open the current one
var cur_video;
Send me a demo so that if anyone encounters it in the future, you can refer to it.
Traverse all videos, pause them all and then open the current one