Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/components/VideoPlayerContexts/PlaybackContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ function PlaybackContextProvider({children}) {

const checkVideoPlaying = useCallback(
(statusCallback) => {
if (!(currentVideoPlayerRef && currentVideoPlayerRef.current && currentVideoPlayerRef.current.getStatusAsync)) {
Copy link
Contributor Author

@kowczarz kowczarz Feb 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to check if the function isn't null, if it is then we can safely keep status default value (which is false).

return;
}
currentVideoPlayerRef.current.getStatusAsync().then((status) => {
statusCallback(status.isPlaying);
});
Expand Down