hls.js icon indicating copy to clipboard operation
hls.js copied to clipboard

Network error event

Open MaximumRGB opened this issue 3 years ago • 1 comments

What do you want to do with Hls.js?

What event should i handle to resume playing stream video when internet connection has been recovered after loss? On internet connection loss i get an error:

  1. type: 'networkError', details: 'levelLoadError'. - for live streaming
  2. type: 'networkError', details: 'fragLoadError'. - for records Currently i use startLoad() method on fatal error for hls to continue send requests till internet connection recovers.

What have you tried so far?

No response

MaximumRGB avatar Jun 22 '22 12:06 MaximumRGB

Hi @MaximumRGB,

If the error event is not fatal then you don't need to do anything: HLS.js will keep trying.

Fatal network error events (event.fatal === true) occur when the multi-variant playlist fails to load, and after all playlist or segment request retries have been exhausted. Calling startLoad() should resume loading in these cases.

You might want to check the browser's navigator.onLine and associated online/offline events. Usually these only signal that the network has been disabled. Also consider modifying the HLS.js configuration in these cases (specifically these delay settings and the ones above them).

robwalch avatar Aug 10 '22 16:08 robwalch