Skip to content

paused prop bug #256

@alpgokcek

Description

@alpgokcek

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}
        />

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions