I just did a small example of videojs, which has a log on event play, and i am using APIs like play(),pause()
.
var myplayer;
var playCount = 0;
videojs("example_video_1").ready(function(){
myplayer = this;
myplayer.on("play", function(){
playCount++;
$("#count").text(playCount)
});
});
$("#test").click(function (){
myplayer.pause();
myplayer.play();
});
The issue is that while executing the APIs the play event will go to an infinite loop.
I can found this issue in touch devices if I enable the controls even while seeking the bar, do play pause etc. So if I didnt use the bination also I can found this issues. Internally the library is using these APIs in seek, or other controls ?
Link in jsfiddle LIVE BUG:
I just did a small example of videojs, which has a log on event play, and i am using APIs like play(),pause()
.
var myplayer;
var playCount = 0;
videojs("example_video_1").ready(function(){
myplayer = this;
myplayer.on("play", function(){
playCount++;
$("#count").text(playCount)
});
});
$("#test").click(function (){
myplayer.pause();
myplayer.play();
});
The issue is that while executing the APIs the play event will go to an infinite loop.
I can found this issue in touch devices if I enable the controls even while seeking the bar, do play pause etc. So if I didnt use the bination also I can found this issues. Internally the library is using these APIs in seek, or other controls ?
Link in jsfiddle LIVE BUG:
Share Improve this question edited Jul 15, 2013 at 13:30 Sarath asked Jul 15, 2013 at 10:32 SarathSarath 9,16612 gold badges54 silver badges86 bronze badges 1- Has this problem re-emerged in 4.3, at least in Firefox?? I'm getting looping in Firefox (but no other browsers) in my own projects, and an updated version of the above fiddle is, I believe, not working correctly: jsfiddle/vN28W/3 ?? – Jim Miller Commented Jan 13, 2014 at 20:12
2 Answers
Reset to default 3This is a bug in video js event handling:
https://github./videojs/video.js/issues/573 <-- original bug
https://github./videojs/video.js/issues/620 <-- best info on 'why' here
In the meantime, one workaround is to put any play/pause toggles in timeouts.
$("#test").click(function (){
myplayer.pause();
window.setTimeout(function() {myplayer.play();}, 10);
});
This is the fix forthis issue... https://github./cameront/video.js/mit/ff0b443c285691074f7f01e8d0326ade0f0a6609 for issues/620
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744790825a4593903.html
评论列表(0条)