Reputation: 390
I want that my video should start playing after it is buffered 10% of the duration. Any Leads how I can do it using getBuffer() and onBufferChange() method .. Source code will be highly helpful .
Thanks,
Upvotes: 1
Views: 348
Reputation: 3359
The player starts playing the video long before it gets to 10% buffering - it usually starts within just a few seconds, if not immediately. If you're finding that you have to wait for the entire video to download, it's because it's encoded improperly, with the moov atom at the end of the file, rather than at the beginning.
The quickest fix is to grab a little free application called MP4 FastStart from here: http://www.datagoround.com/lab/. You can feed it single video files, or an entire folder. It does only one thing - it puts the moov atom where it belongs. It's very quick.
Another option is to re-encode using Handbrake - http://handbrake.fr/. Take the default settings, but also check Web Optimized.
If you're using ffmpeg, include the -movflags faststart option.
Upvotes: 1