This commit is contained in:
chrisk325 2026-02-27 18:50:52 +05:30 committed by GitHub
parent 4203ad18be
commit 9b65bc95a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1599,10 +1599,17 @@ public class ReactExoplayerView extends FrameLayout implements
Track audioTrack = exoplayerTrackToGenericTrack(format, groupIndex, selection, group);
audioTrack.setBitrate(format.bitrate == Format.NO_VALUE ? 0 : format.bitrate);
audioTrack.setSelected(isSelected);
// Encode channel count into title so JS can read it e.g. "English|ch:6"
// Encode channel count and bitrate into title so JS can read them reliably
// e.g. "English|ch:6|br:640000"
String existing = audioTrack.getTitle() != null ? audioTrack.getTitle() : "";
if (format.channelCount != Format.NO_VALUE && format.channelCount > 0) {
String existing = audioTrack.getTitle() != null ? audioTrack.getTitle() : "";
audioTrack.setTitle(existing + "|ch:" + format.channelCount);
existing = existing + "|ch:" + format.channelCount;
}
if (format.bitrate != Format.NO_VALUE && format.bitrate > 0) {
existing = existing + "|br:" + format.bitrate;
}
if (!existing.isEmpty()) {
audioTrack.setTitle(existing);
}
audioTracks.add(audioTrack);
}
@ -1803,6 +1810,9 @@ public class ReactExoplayerView extends FrameLayout implements
if (format.channelCount != Format.NO_VALUE && format.channelCount > 0) {
baseTitle = baseTitle + "|ch:" + format.channelCount;
}
if (format.bitrate != Format.NO_VALUE && format.bitrate > 0) {
baseTitle = baseTitle + "|br:" + format.bitrate;
}
track.setTitle(baseTitle);
track.setSelected(false); // Don't report selection status - let PlayerView handle it
if (format.sampleMimeType != null)