-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
When video starts in 'paused' state the onProgress event does not fire on Android #1979
Comments
@dylanjha : Just find out that it was working fine in my project but I have seen one thing in your repo that paused value is hardcoded in code which is set as true (if you don't provide value to attribute on the component then I will consider as true). But I think that based paused video player play and pause. So you need to update the paused value with video current playing status in case if you are using custom controls over a player then you need to manage paused value and provide it to the player. But in your repo, you are using default controls that come with react-native-video which internally handle state so you don't need to pass paused in the first place. But still, you want to manage video state from outside player control then you should provide proper value to the paused attribute. Means false when the video player is playing video and pauses when the video player is not playing a video. I had clone your bug repo and added two button play and pause which update paused attribute. The default value of paused is set to true. But when you click on play custom button it changes to false and video start playing and you will start receiving progress event. here is your updates code.
|
Interesting, thank you @jariwalabhavesh I can see what this code is doing. To make sure I understand:
This makes sense, but what is the recommended way if I want to use the default player controls, but start the player off in the For example, by default this video will autoplay: <Video source={{uri: "background"}} /> If I want to not autoplay the video it seems like I should be able to do this: <Video source={{uri: "background"}} paused /> However, based on this explanation it seems like I can only do that if I implement my own custom controls. Furthermore, since this behavior in inconsistent on iOS vs. Andriod, so should that be considered a bug? Am I missing something here? |
@dylanjha : It looks like a bug if we consider using default player controls and want to keep the paused value as true hardcode. But my opinion is that default controls are very basic. so the majority of users are using a third party control package. In my case, I had created custom control on a player from react-native. But as of now, I think the workaround that I had provided in my last comment in your code should be enough to start working on that. Maybe it will get fixed in future releases. |
@jariwalabhavesh Thanks for confirming that you are seeing this bug, leaving this issue open with the hopes it gets some attention |
Has this been solved yet? |
@sjonchhe not to my knowledge |
I would love to have an option to set paused to true or otherwise have an autoplay prop to disable a video from automatically playing. |
I also noticed that the video may sometimes keep playing when you set |
For me, onEnd event was causing this. It was calling while entering the screen. |
This issue shall be fixed by #2664 on exoplayer progress is not reported while on pause |
Bug
onProgress
callback does not fire on Android when video startspaused
.Platform
Which player are you experiencing the problem on:
Environment info
React native info output:
Library version: 5.0.2
Steps To Reproduce
Loom video recording: https://www.loom.com/share/0a903fc33c644ca9a7cb7c9747587997
Expected behaviour
Reproducible sample code
See simple demo app here:
https://github.com/dylanjha/react-native-video-bugs
@cobarx I was surprised by this bug, any ideas if I'm doing something that is causing it. I thought maybe it was specific to my application but I was able to reproduce it in a sample app (github link above). Any help would be greatly appreciated 🙏
I'm trying to get an SDK out for Video QOS monitoring with his player (https://mux.com/data), but this is a blocker. I'm happy to work on a patch for it it, I started digging through the source code but I wasn't able to find an obvious fix (I'm also new to react-native world so there's a bit of a learning curve there)
The text was updated successfully, but these errors were encountered: