Always go to next source in player and add thread safety#2733
Merged
fire-light42 merged 4 commits intorecloudstream:masterfrom May 4, 2026
Merged
Always go to next source in player and add thread safety#2733fire-light42 merged 4 commits intorecloudstream:masterfrom
fire-light42 merged 4 commits intorecloudstream:masterfrom
Conversation
We don't want to ever kick out of the player if the first source fails, we can just show the unknown error toast and still go to the next source for more stable error handling. In the future we can still expand the different types of toasts shown to be clear about what the error is, but in reality we should never just kick out of the player if the first source is an error and there are other sources.
Luna712
commented
Apr 29, 2026
Collaborator
fire-light42
left a comment
There was a problem hiding this comment.
The idea of this is to handle irrevocable and unknown errors by simply exiting the player, and can be seen as a soft app crash. If we do not know what happen, the system may have been left in a bad state causing worse problems than if we did not exit.
This is the general java philosophy, but I can see why it may cause user friction. Especially given that no such problem is realistically expected to happen.
fire-light42
requested changes
May 1, 2026
fire-light42
approved these changes
May 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We don't want to ever kick out of the player if the first source fails, we can just show the unknown error toast and still go to the next source for more stable error handling. In the future we can still expand the different types of toasts shown to be clear about what the error is, but in reality we should never just kick out of the player if the first source is an error and there are other sources.
This also adds thread safety, and fixes issues with context required on the UI thread. Before lint couldn't follow
ioSafeor other custom Coroutines methods, but this adds annotations to tell lint to follow properly ensuring proper build failures withWrongThreadshould it be called on the wrong thread.For example with context:
Is now given if called on the wrong thread. Doing it like this also would have caught other issues in the past as well.
Also,
androidx.annotation:annotationis fully KMP compatible so has no issues with being incommonMainin library either. Just for consistency to ensure we always use the same version, it is also added explicitly to theappmodule.