HTML5 video doesn't load the first 1-2 seconds of video -
i have video in <video> tag on site .mp4 source.
on desktop firefox, works well. chrome, if try rewind video beginning, starts ~2 seconds of video.
on mobile devices, doesn't load first ~2 seconds of video, tried firefox , chrome.
anybody has idea what's wrong it?
thanks
the cause:
your problem <video> element width propery versus length of video. since video 10 seconds, scrollbar in <video> element cannot jump exact beginning, since browsers segment scrollbar according ratio between <video> element's width , length of video incorrectly.
possible solution:
add javascript rewind movie 0'th second. can use onseeked event , check if user tried seeking beginning of movie, , set video's current time 0 - exact beginning.
example:
var video = document.getelementbyid("myvideo"); video.onseeked = function() { if (video.currenttime <= 2) video.currenttime = 0; };
Comments
Post a Comment