Refactor Player.useVideoSource logic and improve its comments #10195
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.
What is it?
Description of the changes in your PR
This PR simplifies the logic of the
useVideoSource
method of thePlayer
class and improves its comments. These changes should resolve the issues of video and text tracks renderers not enabling in some cases.Detailed version of the changes:
isAudioOnly == !videoEnabled
, as this prevents enabling againvideo and text tracks renderers in some cases;
and text tracks renderers, as they may need to be enabled again in some cases
like starting a video in main player, opening play queue, switching to
background player on it and switching back to main player;
AUDIO_STREAM
StreamType
, as doing so doesn't raise any issue and simplifies code;Fixes the following issue(s)
APK testing
The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR.
Please test intensively these changes, by switching between multiple player types and streams of different services and testing every combination possible, to ensure that I introduced no regression.
Due diligence