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?
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?
Share Improve this question asked Mar 22, 2015 at 18:21 TomTom 1,5652 gold badges22 silver badges45 bronze badges 1- 1 based on this it seems like you can, if the video metadata has been loaded, so the browser already knows the video size so it can ask the server to start loading from a different position, and the server knows how to honour partial data transfer requests. The fastest way to find out, of course, is to simply give it a try on a test URL and see what happens for your setup. – Mike 'Pomax' Kamermans Commented Mar 22, 2015 at 18:28
2 Answers
Reset to default 10It 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.
No, it starts loading from the given timestamp, as long as the browser knows the duration of the video.