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.21k stars 62 forks source link

Preload shaka player or other media ahead of time #976

Closed austinh closed 1 week ago

austinh commented 1 week 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 1 week ago

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