fix(android)!: rework video tracks management (#3778)
* fix: fix crash when invalid index type is provided and minor clean up * fix: review video track management. Fix index support and rework string vs int in tracks management * fix: ABR track selection check * fix: split track selector in sample and lint code * fix: ensure we don't report null fields * chore: improve tracks displayed * chore: start moving to selection by index only
This commit is contained in:
@@ -9,7 +9,7 @@ class VideoTrack {
|
||||
var height = 0
|
||||
var bitrate = 0
|
||||
var codecs = ""
|
||||
var id = -1
|
||||
var index = -1
|
||||
var trackId = ""
|
||||
var isSelected = false
|
||||
}
|
||||
|
@@ -194,9 +194,15 @@ public class VideoEventEmitter {
|
||||
WritableMap audioTrack = Arguments.createMap();
|
||||
audioTrack.putInt("index", i);
|
||||
audioTrack.putString("title", format.getTitle());
|
||||
audioTrack.putString("type", format.getMimeType());
|
||||
audioTrack.putString("language", format.getLanguage());
|
||||
audioTrack.putInt("bitrate", format.getBitrate());
|
||||
if (format.getMimeType() != null) {
|
||||
audioTrack.putString("type", format.getMimeType());
|
||||
}
|
||||
if (format.getLanguage() != null) {
|
||||
audioTrack.putString("language", format.getLanguage());
|
||||
}
|
||||
if (format.getBitrate() > 0) {
|
||||
audioTrack.putInt("bitrate", format.getBitrate());
|
||||
}
|
||||
audioTrack.putBoolean("selected", format.isSelected());
|
||||
waAudioTracks.pushMap(audioTrack);
|
||||
}
|
||||
@@ -214,7 +220,8 @@ public class VideoEventEmitter {
|
||||
videoTrack.putInt("height",vTrack.getHeight());
|
||||
videoTrack.putInt("bitrate", vTrack.getBitrate());
|
||||
videoTrack.putString("codecs", vTrack.getCodecs());
|
||||
videoTrack.putInt("trackId",vTrack.getId());
|
||||
videoTrack.putString("trackId", vTrack.getTrackId());
|
||||
videoTrack.putInt("index", vTrack.getIndex());
|
||||
videoTrack.putBoolean("selected", vTrack.isSelected());
|
||||
waVideoTracks.pushMap(videoTrack);
|
||||
}
|
||||
|
Reference in New Issue
Block a user