mirror of
https://github.com/zoriya/react-native-video.git
synced 2026-06-06 03:56:53 +00:00
Fix(ts): crash seeking to null (#3802)
* fix: avoid crash when seeking to null
This commit is contained in:
+2
-2
@@ -233,8 +233,8 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
|
|||||||
}, [selectedVideoTrack]);
|
}, [selectedVideoTrack]);
|
||||||
|
|
||||||
const seek = useCallback(async (time: number, tolerance?: number) => {
|
const seek = useCallback(async (time: number, tolerance?: number) => {
|
||||||
if (isNaN(time)) {
|
if (isNaN(time) || time === null) {
|
||||||
throw new Error('Specified time is not a number');
|
throw new Error("Specified time is not a number: '" + time + "'");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!nativeRef.current) {
|
if (!nativeRef.current) {
|
||||||
|
|||||||
Reference in New Issue
Block a user