Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

paused prop bug #256

Open
alpgokcek opened this issue Jan 17, 2023 · 0 comments
Open

paused prop bug #256

alpgokcek opened this issue Jan 17, 2023 · 0 comments

Comments

@alpgokcek
Copy link

Paused Prop Bug

Hi,
There is a problem with the paused prop. It would we great to fix this issue in the next release 😁


Use case

We have a screen with a video on top and input boxes where users can enter title and description of their video at the bottom.


Bug:

When we pass 'paused' as true, the video does not automatically play as expected. However, if the user presses play and then presses on an input box, or enters/exits fullscreen the video pauses. Whereas if we pass 'paused' as false, this does not occur.


How I fixed it currently:

I've passed the handleTogglePlayPause function to onLoad and created a ref. On handleTogglePlayPause function, I've called the togglePlayPause method to pause the video.


ref and handleTogglePlayPause method:

const playerRef = useRef();
const handleTogglePlayPause = () => {
    playerRef?.current?.methods?.togglePlayPause();
};

VideoControlsVideoPlayer props:

<VideoControlsVideoPlayer
          ref={playerRef}
          poster={getThumbnail()}
          source={{
            uri: getVideoURI(),
          }}
          style={styles.video}
          toggleResizeModeOnFullscreen={false}
          disableVolume
          disableBack
          ignoreSilentSwitch="ignore"
          showOnStart={true}
          onLoad={handleTogglePlayPause}
        />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant