fix(android): ensure maxBitrate & selectedVideoTrack interact correctly #4155
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.
Summary
Fix interaction between selectedVideoTrack and maxBitrate.
Before this change, maxBitrate was not taken into account if user provide selectedVideoTrack to <Video player
Motivation
fix: #3121
and clarify behavior when both selectedVideoTrack and maxBitrate are used
Changes
Apply in trackSelector maxBitrate or selectedVideoTrack, but not both
Test plan
can be tested with sample.
Add a maxBitrate value
play with Video selection on sample
see the result in the logcat, here is an exemple of maxBitrate selected:
09-09 23:25:16.292 27526 27526 D RNVExoplayer: tracks [eventTime=21.19, mediaPos=28.65, window=0, period=0
09-09 23:25:16.292 27526 27526 D RNVExoplayer: group [
09-09 23:25:16.292 27526 27526 D RNVExoplayer: [X] Track:0, id=0, mimeType=video/avc, container=application/x-mpegURL, bitrate=258157, codecs=avc1.4d400d, res=422x180, supported=YES
09-09 23:25:16.292 27526 27526 D RNVExoplayer: [X] Track:1, id=1, mimeType=video/avc, container=application/x-mpegURL, bitrate=520929, codecs=avc1.4d4015, res=638x272, supported=YES
09-09 23:25:16.292 27526 27526 D RNVExoplayer: [X] Track:2, id=2, mimeType=video/avc, container=application/x-mpegURL, bitrate=831270, codecs=avc1.4d4015, res=638x272, supported=YES
09-09 23:25:16.292 27526 27526 D RNVExoplayer: [X] Track:3, id=3, mimeType=video/avc, container=application/x-mpegURL, bitrate=1144430, codecs=avc1.4d401f, res=958x408, supported=YES
09-09 23:25:16.292 27526 27526 D RNVExoplayer: [ ] Track:4, id=4, mimeType=video/avc, container=application/x-mpegURL, bitrate=1558322, codecs=avc1.4d401f, res=1277x554, supported=YES
09-09 23:25:16.292 27526 27526 D RNVExoplayer: [ ] Track:5, id=5, mimeType=video/avc, container=application/x-mpegURL, bitrate=4149264, codecs=avc1.4d4028, res=1921x818, supported=YES
09-09 23:25:16.292 27526 27526 D RNVExoplayer: [ ] Track:6, id=6, mimeType=video/avc, container=application/x-mpegURL, bitrate=6214307, codecs=avc1.4d4028, res=1921x818, supported=YES
09-09 23:25:16.292 27526 27526 D RNVExoplayer: [ ] Track:7, id=7, mimeType=video/avc, container=application/x-mpegURL, bitrate=10285391, codecs=avc1.4d4033, res=4096x1744, supported=NO_EXCEEDS_CAPABILITIES
09-09 23:25:16.292 27526 27526 D RNVExoplayer: ]