javascript - Loop video with media fragments? -
I stopped trying to loop when a video URL (with pieces of media) But I have set up a listener to call a Loop Video () function:
function loop video () {var video = document.getElementById ('Video1'); Var video file = 'file1.mp4 # t = 10,10'; Video src = videoFile; Video.play (); }; Document.getElementById ('Video1'). AddEventListener ('Paused', Loop Video (), Incorrect); So far the piece of the video plays once, but when it breaks, it does not loop. Is there any error in my code or is there a piece of media problem?
It is 2 years later but I am going to post it because I recently got this issue Was just over Basically what I did, I used to get values in the pieces of media dynamically and then checked in my timeupdate video event listener that the current time was more than the upper bound of the media segment or No. If it exceeds the upper limit, then I set the current time to the lower limit and play the video. Here's the code I used: function check media fragment ball (video, x, y) {if (video.currentTime> y) {video.currentTime = x; Video.play (); }} And then here's a work JSFiddle: where you can also see your logic for the range of media pieces. Hope this helps someone else find this answer because I think it was looking for an answer.
Comments
Post a Comment