dmzkrsk
dmzkrsk

Reputation: 2115

Prepare large ogv/mp4/webm/flv for streaming and seeking

I have a two-hours long video, that I want to stream through HTML5 video tag (and ye old good Flash as fallback) So I have four files: mp4, ogv, webm and flv (500-800Mb each)

My server returns right Content-Type and Accept-Range headers

I know about qt-faststart for .mp4 files and yamdi/flvtool2 for .flv files Do I need any extra tools for .webm and .ogv? Or any other server setup?

Is it possible to ask browser to don't downloaed the whole file, but cache only ~5 minutes ahead?

Upvotes: 1

Views: 597

Answers (1)

Offbeatmammal
Offbeatmammal

Reputation: 8236

depending on the browser the behavior can differ, and the only real control you have is via the preload attribute. Depending on the guidance in the preload attribute the browser will attempt to do what it thinks is right given network conditions etc. You can specify one of three options: none; metadata; auto

  • none: this assumes that the user won't play the video, so does not preload anything
  • metadata: just preloads metadata (video dimensions, captions etc)
  • auto: optimizes for user experience so may only download the next 5 mins, but if bandwidth is available may try and suck down the whole file

Note: if you specify autoplay as well, this assumes the need to gather metadata and at least enough to establish a buffer to play so it becomes a de factor "preload: auto" condition.

http://www.w3.org/TR/html5/embedded-content-0.html#attr-media-preload

Upvotes: 0

Related Questions