This commit is contained in:
chrisk325 2026-02-27 19:02:30 +05:30 committed by GitHub
parent b3d4953da2
commit a75de21584
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1599,8 +1599,8 @@ 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 and bitrate into title so JS can read them reliably
// e.g. "English|ch:6|br:640000"
// Encode channel count, bitrate and mimeType into title so JS can read them reliably
// e.g. "English|ch:6|br:640000|mt:audio/ac3"
String existing = audioTrack.getTitle() != null ? audioTrack.getTitle() : "";
if (format.channelCount != Format.NO_VALUE && format.channelCount > 0) {
existing = existing + "|ch:" + format.channelCount;
@ -1616,6 +1616,9 @@ public class ReactExoplayerView extends FrameLayout implements
if (effectiveBitrate != Format.NO_VALUE && effectiveBitrate > 0) {
existing = existing + "|br:" + effectiveBitrate;
}
if (format.sampleMimeType != null && !format.sampleMimeType.isEmpty()) {
existing = existing + "|mt:" + format.sampleMimeType;
}
if (!existing.isEmpty()) {
audioTrack.setTitle(existing);
}
@ -1829,6 +1832,9 @@ public class ReactExoplayerView extends FrameLayout implements
if (effectiveBitrate != Format.NO_VALUE && effectiveBitrate > 0) {
baseTitle = baseTitle + "|br:" + effectiveBitrate;
}
if (format.sampleMimeType != null && !format.sampleMimeType.isEmpty()) {
baseTitle = baseTitle + "|mt:" + format.sampleMimeType;
}
track.setTitle(baseTitle);
track.setSelected(false); // Don't report selection status - let PlayerView handle it
if (format.sampleMimeType != null)