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:
@@ -222,13 +222,14 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
|
||||
if (!selectedVideoTrack) {
|
||||
return;
|
||||
}
|
||||
const value = selectedVideoTrack?.value
|
||||
? `${selectedVideoTrack.value}`
|
||||
: undefined;
|
||||
|
||||
const type = typeof selectedVideoTrack.value;
|
||||
if (type !== 'number' && type !== 'string') {
|
||||
console.log('invalid type provided to selectedVideoTrack');
|
||||
return;
|
||||
}
|
||||
return {
|
||||
type: selectedVideoTrack?.type,
|
||||
value,
|
||||
value: `${selectedVideoTrack.value}`,
|
||||
};
|
||||
}, [selectedVideoTrack]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user