@@ -19,6 +19,7 @@ import {useVideoPopoverMenuActions} from '@components/VideoPlayerContexts/VideoP
1919import { useVolumeActions , useVolumeState } from '@components/VideoPlayerContexts/VolumeContext' ;
2020import VideoPopoverMenu from '@components/VideoPopoverMenu' ;
2121import useNetwork from '@hooks/useNetwork' ;
22+ import useReportOrReportDraft from '@hooks/useReportOrReportDraft' ;
2223import useThemeStyles from '@hooks/useThemeStyles' ;
2324import addEncryptedAuthTokenToURL from '@libs/addEncryptedAuthTokenToURL' ;
2425import { isSafari } from '@libs/Browser' ;
@@ -57,6 +58,7 @@ function BaseVideoPlayer({
5758 const { pauseVideo, playVideo, replayVideo, shareVideoPlayerElements, updateCurrentURLAndReportID, setCurrentlyPlayingURL, updatePlayerStatus, requestDonorReRegistration} =
5859 usePlaybackActionsContext ( ) ;
5960 const { isFullScreenRef} = useFullScreenState ( ) ;
61+ const report = useReportOrReportDraft ( reportID ) ;
6062
6163 const isOffline = useNetwork ( ) . isOffline ;
6264 const [ isVideoOffline , setIsVideoOffline ] = useState ( false ) ;
@@ -172,7 +174,7 @@ function BaseVideoPlayer({
172174
173175 const togglePlayCurrentVideo = useCallback ( ( ) => {
174176 if ( ! isCurrentlyURLSet ) {
175- updateCurrentURLAndReportID ( url , reportID ) ;
177+ updateCurrentURLAndReportID ( url , report , reportID ) ;
176178 return ;
177179 }
178180
@@ -194,7 +196,7 @@ function BaseVideoPlayer({
194196
195197 allowSharedAutoPlayRef . current = true ;
196198 playVideo ( ) ;
197- } , [ isCurrentlyURLSet , isLoading , isEnded , currentTime , duration , playVideo , updateCurrentURLAndReportID , url , reportID , pauseVideo , replayVideo ] ) ;
199+ } , [ isCurrentlyURLSet , isLoading , isEnded , currentTime , duration , playVideo , updateCurrentURLAndReportID , url , report , reportID , pauseVideo , replayVideo ] ) ;
198200
199201 const hideControl = useCallback ( ( ) => {
200202 if ( isEnded || isSeeking ) {
@@ -498,8 +500,8 @@ function BaseVideoPlayer({
498500 if ( ! shouldPlay ) {
499501 return ;
500502 }
501- updateCurrentURLAndReportID ( url , reportID ) ;
502- } , [ reportID , shouldPlay , updateCurrentURLAndReportID , url ] ) ;
503+ updateCurrentURLAndReportID ( url , report , reportID ) ;
504+ } , [ report , reportID , shouldPlay , updateCurrentURLAndReportID , url ] ) ;
503505
504506 // ensure that video loads after page refresh on iOS Safari
505507 useEffect ( ( ) => {
0 commit comments