Fix(ts): crash seeking to null (#3802)
* fix: avoid crash when seeking to null
This commit is contained in:
parent
e16730de11
commit
c80164ccdf
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user