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]);
|
||||
|
||||
const seek = useCallback(async (time: number, tolerance?: number) => {
|
||||
if (isNaN(time)) {
|
||||
throw new Error('Specified time is not a number');
|
||||
if (isNaN(time) || time === null) {
|
||||
throw new Error("Specified time is not a number: '" + time + "'");
|
||||
}
|
||||
|
||||
if (!nativeRef.current) {
|
||||
|
Loading…
Reference in New Issue
Block a user