diff --git a/src/components/VideoPlayerContexts/PlaybackContext.tsx b/src/components/VideoPlayerContexts/PlaybackContext.tsx index c66fd04e0c04..ff941ab266dc 100644 --- a/src/components/VideoPlayerContexts/PlaybackContext.tsx +++ b/src/components/VideoPlayerContexts/PlaybackContext.tsx @@ -89,7 +89,11 @@ function PlaybackContextProvider({children}: ChildrenProps) { }, [stopVideo, unloadVideo]); useEffect(() => { - // currentReportID is initially empty/-1 and we don't want to reset the video player data when it was previously empty/-1 + // This logic ensures that resetVideoPlayerData is only called when currentReportID + // changes from one valid value (i.e., not an empty string or '-1') to another valid value. + // This prevents the video that plays when the app opens from being interrupted when currentReportID + // is initially empty or '-1', or when it changes from empty/'-1' to another value + // after the report screen in the central pane is mounted on the large screen. if (!currentReportID || !prevCurrentReportID || currentReportID === '-1' || prevCurrentReportID === '-1') { return; }