Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kowczarz committed Feb 22, 2024
1 parent b11c83f commit fd72a5f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/VideoPlayerContexts/PlaybackContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ function PlaybackContextProvider({children}) {

const checkVideoPlaying = useCallback(
(statusCallback) => {
// eslint-disable-next-line es/no-optional-chaining
currentVideoPlayerRef.current?.getStatusAsync?.().then((status) => {
if (!(currentVideoPlayerRef && currentVideoPlayerRef.current && currentVideoPlayerRef.current.getStatusAsync)) {
return;
}
currentVideoPlayerRef.current.getStatusAsync().then((status) => {
statusCallback(status.isPlaying);
});
},
Expand Down

0 comments on commit fd72a5f

Please sign in to comment.