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

Video played automatically eventhough paused=true #592

Closed
aluksidadi opened this issue Apr 29, 2017 · 10 comments
Closed

Video played automatically eventhough paused=true #592

aluksidadi opened this issue Apr 29, 2017 · 10 comments

Comments

@aluksidadi
Copy link

Im having weird problem:

I hardcoded the paused value to true, but somehow the video got played automatically

              <Video
                ref={(player) => this.player = player}
                source={{uri: user.user_profile.video}}
                width={width}
                height={height - 160}
                repeat={false}
                paused={true}
                muted={false}
                resizeMode="cover"
              />

Anyone experiencing same issue?

@fogil
Copy link

fogil commented Apr 30, 2017

Yes, I even hardcoded rate to == 0.0 and it still autoplays at rate 1.0.

Only workaround is to not render the Video component at all, until app logic dictates that a video should be played then go ahead and render Video -- after which it will always autoplay no matter what settings are used.

@aluksidadi
Copy link
Author

I think there was an autoplay bug on 1.0.0.
So I managed to solved this by pulling the package from the latest master branch
(i tried putting version "^1.1.0" on my package.json but seems like the owner hasnt pushed 1.1.0 to npm yet eventhough the package.json in this repository tells me that latest version is 1.1.0)

@nickkapoor
Copy link

Yes, i see the issue. Tried with paused as true and rate as 0. Will test out your recommendation to d/l the 1.1.0 version.

@BuildWithLal
Copy link

BuildWithLal commented May 8, 2017

facing same issue on Android.. "react-native-video": "^1.0.0".
@aluksidadi i tried pulling latest version master from repo but still facing same issue. Any other changes i am missing?

@rachoac
Copy link

rachoac commented May 11, 2017

Any updates on the root cause, or fixing of this issue?

@aluksidadi
Copy link
Author

aluksidadi commented May 11, 2017

@lalzada it fixed my autoplay issue by importing the master branch. but theres actually another bug i found where it kept playing in a loop after being played eventhough loop is false

@EdenGottlieb
Copy link

I found a workaround, a bit ugly but it works.

Set the "paused" attribute to a property of state that is initially set to false. Then, Set the OnLoad function to change this property to true.
This works perfectly on Android. and the video is paused upon rendering, no "micro-stuttering for a moment" or something like that. Haven't tried it on iOS.

@GingerBear
Copy link

@EdenGottlieb 's workaround works as well on iOS with no issue.

@Symous
Copy link

Symous commented May 19, 2017

I just fix this but the author hasn't merge this PR #625 .

@cobarx
Copy link
Contributor

cobarx commented Jun 23, 2018

I fixed this in #1082. In my testing everything is working properly now. Will be released in 3.0.

@cobarx cobarx closed this as completed Jun 23, 2018
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

8 participants