-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added hls error recovery #355
added hls error recovery #355
Conversation
@cookpete it seems travic-ci is unable to complete the test sequence. Would you take a look at my PR? |
It seems like a I think we are better off passing |
As of You could implement the same recovery logic like so: function onError (e, data, hlsInstance, hlsGlobal) {
if (!hlsGlobal) {
// Probably not a HLS error
return
}
switch (data.type) {
case hlsGlobal.ErrorTypes.NETWORK_ERROR:
// try to recover network error
// hls: fatal network error encountered, trying to recover
hlsInstance.startLoad()
break
case hlsGlobal.ErrorTypes.MEDIA_ERROR:
// hls: fatal media error encountered, trying to recover
hlsInstance.recoverMediaError()
break
default:
// cannot recover
hlsInstance.destroy()
break
}
}
<ReactPlayer url={HLS_URL} onError={onError} /> Although beware of causing loops when seeking. |
@cookpete I copied your recommendation here. its a great starting point :), thanks |
Dealing with errors within ReactPlayer just caused more bugs Closes cookpete/react-player#354 Closes cookpete/react-player#355
Dealing with errors within ReactPlayer just caused more bugs Closes cookpete/react-player#354 Closes cookpete/react-player#355
Dealing with errors within ReactPlayer just caused more bugs Closes cookpete/react-player#354 Closes cookpete/react-player#355
Dealing with errors within ReactPlayer just caused more bugs Closes cookpete/react-player#354 Closes cookpete/react-player#355
Dealing with errors within ReactPlayer just caused more bugs Closes cookpete/react-player#354 Closes cookpete/react-player#355
Dealing with errors within ReactPlayer just caused more bugs Closes cookpete/react-player#354 Closes cookpete/react-player#355
add attempt to recover from hls errors