Reputation: 585
I'm using the <link rel="preload">
attribute to preload my video for faster playback.
But my video is an .m3u8
file, which is a playlist file that links to several chunked .ts
files.
In order to successfully preload my video, should I link to the playlist file
<link rel="preload" as="video" href="https://cdn.com/file.m3u8">
or
link to the source files like so:
<link rel="preload" as="video" href="https://cdn.com/file1.ts">
<link rel="preload" as="video" href="https://cdn.com/file2.ts">
<link rel="preload" as="video" href="https://cdn.com/file3.ts">
Upvotes: 0
Views: 1587
Reputation: 8228
You should link to the m3u8 from a <video>
tag, because you want the browser to determine at runtime what bandwidth the user can support to stream.
If your m3u8 is correctly formed and indicates that it's a VOD file (as opposed to a live stream) then some browsers will attempt to preload segments from a - better to use their logic in most cases.
Upvotes: 1