Skip to content
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

Level switching logic when error #5219

Closed
try2beth3b3st opened this issue Feb 9, 2023 · 3 comments
Closed

Level switching logic when error #5219

try2beth3b3st opened this issue Feb 9, 2023 · 3 comments
Milestone

Comments

@try2beth3b3st
Copy link

What do you want to do with Hls.js?

I wanna write own logic about level switching when level error..
(+1 of current level, then -1 of current level, if error.. and so on)

What have you tried so far?

I setted levelLoadingMaxRetry to 0 and catched error.. In callback i used nextLevel from my logic, but it works not correctly (
I found switching logic in level-controller, but there is no api methods to modify this logic..

@try2beth3b3st try2beth3b3st added Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. Question labels Feb 9, 2023
@robwalch
Copy link
Collaborator

I found switching logic in level-controller, but there is no api methods to modify this logic..

That is correct. I am in the process of moving this into a new error handling controller as part of #5191. If interested, a config option to replace the default ErrorController class could be added, similar to the other controller class options.

@robwalch robwalch added Enhancement and removed Question Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. labels Feb 10, 2023
@robwalch robwalch added this to the 1.4.0 milestone Feb 10, 2023
@robwalch
Copy link
Collaborator

robwalch commented Feb 10, 2023

I setted levelLoadingMaxRetry to 0 and catched error.. In callback i used nextLevel from my logic, but it works not correctly

Please describe how it did not work (sample error, error event handler, and steps to reproduce.

Depending on the type of error it may not be recoverable. The level switching in level-controller sets hls.nextLoadLevel, so you must set hls.nextLoadLevel before hls.nextLevel in your callback to override the default behavior.

@try2beth3b3st
Copy link
Author

@robwalch, thank you! With hls.nextLoadLevel works like a swiss watch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants