开发者

Why browsers load video from all sources?

开发者 https://www.devze.com 2023-03-27 22:37 出处:网络
I have multiple video elements on my page. They look like this: <video class=\"video-js\" width=\"800\" height=\"500\" controls=\"controls\" preload=\"auto\">

I have multiple video elements on my page. They look like this:

<video class="video-js" width="800" height="500" controls="controls" preload="auto">
<source src="http://myurl.com/videos/video01.mp4" type="video/mp4" />
<source src="http://myurl.comvideos/video01.webmvp8.webm" type="video/webm" />
<source src="http://myurl.com/videos/video01.ogg" type="video/ogg" />
</video>

I suppose different browsers should load only vid开发者_如何学Goeos from sources they need, not all videos from all three sources at once. Though when I look into Firebug logs I see that they load all files and it takes too long. What can I do to make browsers load only files they really need to play the video?


<video width="320" height="240" controls preload>
  <source src="pr6.mp4"  type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
  <source src="pr6.webm" type='video/webm; codecs="vp8, vorbis"'>
  <source src="pr6.ogv"  type='video/ogg; codecs="theora, vorbis"'>
</video>

You must also specify a codec.

  1. Type Paramters: http://wiki.whatwg.org/wiki/Video_type_parameters
  2. Complete Guide: http://diveintohtml5.ep.io/video.html
0

精彩评论

暂无评论...
验证码 换一张
取 消