mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-04-21 00:32:04 +00:00
add audio channel count extractor
This commit is contained in:
parent
74bcc041af
commit
b4dc7cdd88
1 changed files with 10 additions and 1 deletions
|
|
@ -1599,6 +1599,11 @@ public class ReactExoplayerView extends FrameLayout implements
|
||||||
Track audioTrack = exoplayerTrackToGenericTrack(format, groupIndex, selection, group);
|
Track audioTrack = exoplayerTrackToGenericTrack(format, groupIndex, selection, group);
|
||||||
audioTrack.setBitrate(format.bitrate == Format.NO_VALUE ? 0 : format.bitrate);
|
audioTrack.setBitrate(format.bitrate == Format.NO_VALUE ? 0 : format.bitrate);
|
||||||
audioTrack.setSelected(isSelected);
|
audioTrack.setSelected(isSelected);
|
||||||
|
// Encode channel count into title so JS can read it e.g. "English|ch:6"
|
||||||
|
if (format.channelCount != Format.NO_VALUE && format.channelCount > 0) {
|
||||||
|
String existing = audioTrack.getTitle() != null ? audioTrack.getTitle() : "";
|
||||||
|
audioTrack.setTitle(existing + "|ch:" + format.channelCount);
|
||||||
|
}
|
||||||
audioTracks.add(audioTrack);
|
audioTracks.add(audioTrack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1794,7 +1799,11 @@ public class ReactExoplayerView extends FrameLayout implements
|
||||||
Track track = new Track();
|
Track track = new Track();
|
||||||
track.setIndex(groupIndex);
|
track.setIndex(groupIndex);
|
||||||
track.setLanguage(format.language != null ? format.language : "unknown");
|
track.setLanguage(format.language != null ? format.language : "unknown");
|
||||||
track.setTitle(format.label != null ? format.label : "Track " + (groupIndex + 1));
|
String baseTitle = format.label != null ? format.label : "";
|
||||||
|
if (format.channelCount != Format.NO_VALUE && format.channelCount > 0) {
|
||||||
|
baseTitle = baseTitle + "|ch:" + format.channelCount;
|
||||||
|
}
|
||||||
|
track.setTitle(baseTitle);
|
||||||
track.setSelected(false); // Don't report selection status - let PlayerView handle it
|
track.setSelected(false); // Don't report selection status - let PlayerView handle it
|
||||||
if (format.sampleMimeType != null)
|
if (format.sampleMimeType != null)
|
||||||
track.setMimeType(format.sampleMimeType);
|
track.setMimeType(format.sampleMimeType);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue