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:
Olivier Bouillet
2024-05-22 14:01:55 +02:00
committed by GitHub
parent dbd7d7aa2c
commit cad5c4624c
15 changed files with 530 additions and 288 deletions

View File

@@ -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]);