Prevent unnecessary work when creating video track info
This commit is contained in:
parent
0330943d52
commit
c7b7390267
@ -1090,13 +1090,13 @@ class ReactExoplayerView extends FrameLayout implements
|
|||||||
|
|
||||||
for (int trackIndex = 0; trackIndex < group.length; trackIndex++) {
|
for (int trackIndex = 0; trackIndex < group.length; trackIndex++) {
|
||||||
Format format = group.getFormat(trackIndex);
|
Format format = group.getFormat(trackIndex);
|
||||||
|
if (isFormatSupported(format)) {
|
||||||
WritableMap videoTrack = Arguments.createMap();
|
WritableMap videoTrack = Arguments.createMap();
|
||||||
videoTrack.putInt("width", format.width == Format.NO_VALUE ? 0 : format.width);
|
videoTrack.putInt("width", format.width == Format.NO_VALUE ? 0 : format.width);
|
||||||
videoTrack.putInt("height",format.height == Format.NO_VALUE ? 0 : format.height);
|
videoTrack.putInt("height",format.height == Format.NO_VALUE ? 0 : format.height);
|
||||||
videoTrack.putInt("bitrate", format.bitrate == Format.NO_VALUE ? 0 : format.bitrate);
|
videoTrack.putInt("bitrate", format.bitrate == Format.NO_VALUE ? 0 : format.bitrate);
|
||||||
videoTrack.putString("codecs", format.codecs != null ? format.codecs : "");
|
videoTrack.putString("codecs", format.codecs != null ? format.codecs : "");
|
||||||
videoTrack.putString("trackId", format.id == null ? String.valueOf(trackIndex) : format.id);
|
videoTrack.putString("trackId", format.id == null ? String.valueOf(trackIndex) : format.id);
|
||||||
if (isFormatSupported(format)) {
|
|
||||||
videoTracks.pushMap(videoTrack);
|
videoTracks.pushMap(videoTrack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user