From d7977241c9199b4d1474752d8e0ad8edff716488 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 18 Oct 2024 03:25:50 -0600 Subject: [PATCH] Account for crop in progress --- src/Video.web.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Video.web.tsx b/src/Video.web.tsx index 0e5ace22..42d3fd45 100644 --- a/src/Video.web.tsx +++ b/src/Video.web.tsx @@ -316,7 +316,7 @@ const Video = forwardRef( } // Pause the video before changing the source - await nativeRef.current.pause(); + nativeRef.current.pause(); // Unload the previous Shaka player if it exists if (shakaPlayerRef.current) { @@ -325,7 +325,9 @@ const Video = forwardRef( } // Create a new Shaka player and attach it to the video element - shakaPlayerRef.current = new shaka.Player(nativeRef.current); + shakaPlayerRef.current = new shaka.Player(); + + shakaPlayerRef.current.attach(nativeRef.current); if (source?.cropStart) { shakaPlayerRef.current.configure({ @@ -403,6 +405,8 @@ const Video = forwardRef( useMediaSession(source?.metadata, nativeRef, showNotificationControls); + const cropStartSeconds = (source?.cropStart || 0) / 1000; + return (