From 14f8ee565a7221f882412356110c9801193b3d65 Mon Sep 17 00:00:00 2001 From: Ajay Date: Wed, 27 Nov 2024 14:00:51 -0500 Subject: Handle video not existing when playback rate being determined --- src/content.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content.ts b/src/content.ts index fe6c4268..222f9514 100644 --- a/src/content.ts +++ b/src/content.ts @@ -832,7 +832,7 @@ function waitForNextTimeChange(): Promise { function getVirtualTime(): number { const virtualTime = lastTimeFromWaitingEvent ?? (lastKnownVideoTime.videoTime !== null ? - (performance.now() - lastKnownVideoTime.preciseTime) * getVideo().playbackRate / 1000 + lastKnownVideoTime.videoTime : null); + (performance.now() - lastKnownVideoTime.preciseTime) * (getVideo()?.playbackRate || 1) / 1000 + lastKnownVideoTime.videoTime : null); if (Config.config.useVirtualTime && !isSafari() && virtualTime && Math.abs(virtualTime - getCurrentTime()) < 0.2 && getCurrentTime() !== 0) { -- cgit v1.2.3