Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does seeking an HTML5 video require loading the whole file?

I want to randomly seek to different points in a ~30 minute video every 30 seconds. The filesize will be 100mb. When I seek does the player start loading from that point or does it have to load the entire file and then find that time within it?

like image 898
Tom Avatar asked Mar 22 '15 18:03

Tom


People also ask

How do you prevent HTML5 video from changing size when loading a new source?

If all you want is really to avoid the width/height to return to defaults (300 x 150) when the next video is loading, you just have to set your <video> 's width and height properties to the ones of the loaded video ( videoWidth and videoHeight are the real values of the media, not the ones of the element).

How does HTML5 video work?

How does the HTML5 video element work? The HTML5 video element tells the browser to load a video file from another source by specifying the video file's location, similar to the way a browser loads an image file (the image itself is not stored in the HTML file — the browser pulls it from somewhere else).

When implementing the HTML5 video element How do you ensure that?

In order to ensure that a video is accessible by all of the target browsers, you'll need to provide, at minimum, two different source elements for your video element. Example 1-5 shows an HTML5 web page with a video element containing two different video sources: one in H.


2 Answers

It depends on the browser. If we are talking about a modern browser then when you seek, they will typically send a new http request to the server containing a Range: header, indicating what "chunk" of the file they want to load. This would only be for a browser utilizing http 1.1 or higher. I think if the browser supports html5 video then you can be fairly certain that they will be using http 1.1. Keep in mind though that the client will typically always be loading something. So if you seek to 5 seconds into the vid it will essentially start loading the entire thing again until another seek happens.

like image 146
Harvtronix Avatar answered Oct 21 '22 01:10

Harvtronix


No, it starts loading from the given timestamp, as long as the browser knows the duration of the video.

like image 36
Cristian Casais Avatar answered Oct 21 '22 01:10

Cristian Casais