I'm working out details on a web application which involves the sequential loading of a long series of (very short) video clips, one after the other, with occasional input from the user establishing new directions for which video clips to load.
I would like to be able to have the browser preload the video clips five at a time. However, the way that we currently have the site working is by means of a single video element which is having its src
attribute continually updated through JavaScript.
Is there a straightforward way I can get the browser to preload multiple video clips even though I am ultimately loading them all (one at a time) into the same video element?
<video>: The Video Embed element. The <video> HTML element embeds a media player which supports video playback into the document.
The HTML preload Attribute is used to specify the way the author thinks the media should be loaded when the page loads. The preload attribute allows the author to portray to the browser about the way the user experience of a website should be implemented.
You can preload images in browsers by creating an <img>
tag in JavaScript, and setting its src
attribute. Although it’s not required by any spec, all browsers then download the image and cache it (assuming their caches haven’t been disabled).
I’ve no idea if that works with the <video>
element in HTML5, but it might do. Could you give it a go?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With