javascript - Make an html5 video buffer less before playing -


when clicks watch video on site (mp4 in html5 video tag) - browser buffers lot of before showing it. not needed - video less half minute long, , has shown half of time whole video has been downloaded.

is there way tell browsers not buffer much?

there's been lot of discussion in comments regarding whether can done, i'll provide media source-specific answer here.

media source extensions, or mse, new (and not yet widely-supported) set of tools control buffering , streaming html5 videos. w3c abstract:

this specification extends htmlmediaelement allow javascript generate media streams playback. allowing javascript generate streams facilitates variety of use cases adaptive streaming , time shifting live streams.

i'll refer sourcebuffer object, has information on how audio & video track buffering handled.

support mse varies browser , format (source):

  • chrome desktop 34+ (mp4, webm)
  • chrome android 34+ (mp4, webm)
  • ie 11+ on windows 8.1 (mp4)
  • ie windows phone 8.1+ (mp4)
  • safari mac (mp4, ts)

support firefox can turned on user in about:config (source). support has been in works some time.

there more needs implemented in order make use of effectively, including video file clustering. recommend reading 4-part series goes step step how create functional html5 video player utilizing mentioned above.


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

datatable - Matlab struct computations -