Reputation: 4518
I have tried adding the preload
attribute with a value of none
to the video
tag but it doesn’t stop the hls.js Library from preloading from the video.
How can one stop preloading of hls.js videos?
Upvotes: 1
Views: 2206
Reputation: 4518
If you do not want to preload the video, do the following:
autoStartLoad
with a value of false
when creating the HLS config like this: new Hls({ autoStartLoad: false })
play
event listener to the native HTML video element, call hls.startLoad()
, and then remove that event listener to avoid calling startLoad
multiple times since it only needs to be called onceFor browsers that play hls videos natively, you can just add the preload
attribute with a value of false
to the native HTML video element
Upvotes: 2