mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-03-11 09:35:42 +00:00
add estimated bitrate for known formats
This commit is contained in:
parent
c63af981ab
commit
b3d4953da2
1 changed files with 20 additions and 4 deletions
|
|
@ -1605,8 +1605,16 @@ public class ReactExoplayerView extends FrameLayout implements
|
|||
if (format.channelCount != Format.NO_VALUE && format.channelCount > 0) {
|
||||
existing = existing + "|ch:" + format.channelCount;
|
||||
}
|
||||
if (format.bitrate != Format.NO_VALUE && format.bitrate > 0) {
|
||||
existing = existing + "|br:" + format.bitrate;
|
||||
// Use bitrate, fall back to averageBitrate then peakBitrate
|
||||
int effectiveBitrate = format.bitrate;
|
||||
if (effectiveBitrate == Format.NO_VALUE || effectiveBitrate <= 0) {
|
||||
effectiveBitrate = format.averageBitrate;
|
||||
}
|
||||
if (effectiveBitrate == Format.NO_VALUE || effectiveBitrate <= 0) {
|
||||
effectiveBitrate = format.peakBitrate;
|
||||
}
|
||||
if (effectiveBitrate != Format.NO_VALUE && effectiveBitrate > 0) {
|
||||
existing = existing + "|br:" + effectiveBitrate;
|
||||
}
|
||||
if (!existing.isEmpty()) {
|
||||
audioTrack.setTitle(existing);
|
||||
|
|
@ -1810,8 +1818,16 @@ 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;
|
||||
// Use bitrate, fall back to averageBitrate then peakBitrate
|
||||
int effectiveBitrate = format.bitrate;
|
||||
if (effectiveBitrate == Format.NO_VALUE || effectiveBitrate <= 0) {
|
||||
effectiveBitrate = format.averageBitrate;
|
||||
}
|
||||
if (effectiveBitrate == Format.NO_VALUE || effectiveBitrate <= 0) {
|
||||
effectiveBitrate = format.peakBitrate;
|
||||
}
|
||||
if (effectiveBitrate != Format.NO_VALUE && effectiveBitrate > 0) {
|
||||
baseTitle = baseTitle + "|br:" + effectiveBitrate;
|
||||
}
|
||||
track.setTitle(baseTitle);
|
||||
track.setSelected(false); // Don't report selection status - let PlayerView handle it
|
||||
|
|
|
|||
Loading…
Reference in a new issue