muxinc / media-chrome

Custom elements (web components) for making audio and video player controls that look great in your website or app.
https://media-chrome.org
MIT License
1.83k stars 76 forks source link

Preload shaka player or other media ahead of time #976

Closed austinh closed 2 months ago

austinh commented 2 months ago

Hello, i have an app with a grid of videos and I would like to preload them as the user scrolls, and stop loading them as the user scrolls past them (user unlikely to play those they scroll past).

shaka player provides a preload api to prefrtch the manifest and the first segment, as well as destroy/stop preloads midflight. Does this library expose any way for the media elements to preload things, or at least have access to the underlying instance?

hls.js also has a loadSource function, can I utilize that with hls-video?

if not, how do you recommend someone preload something (ideally from a cache)

luwes commented 2 months ago

related https://github.com/muxinc/media-elements/issues/37