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

Fix player refs not setting correctly. #868

Closed
wants to merge 1 commit into from

Conversation

ralusek
Copy link

@ralusek ralusek commented Apr 28, 2020

I described an issue I encountered here on the demo.
#867

I then experienced this same problem in my own code, where seekTo wasn't working correctly. It turns out that the issue was actually far more widespread, and the ref just wasn't being set at all.

When I logged out the object in ReactPlayer that was called refs, which was meant to hold two functions to set refs in child components, it was an empty object. This appears to be a reserved keyword that is presumably used by react, as it was being overridden with an empty object. Simply changing the property name from refs to setRef resolved the issue, and seeking behavior (among other things) now work correctly.

In order to test: follow the steps in the issue I linked above, and notice the broken behavior. Then test the same behavior in this branch, and note it functioning correctly.

@cookpete
Copy link
Owner

There was already a PR for this at #866. Regardless, this should be fixed in v2.0.1

@ralusek
Copy link
Author

ralusek commented Apr 28, 2020

Oh, nice. Thanks

albanqoku added a commit to albanqoku/react-player that referenced this pull request Feb 24, 2021
Webmaster1116 added a commit to Webmaster1116/video-player that referenced this pull request May 20, 2021
webmiraclepro added a commit to webmiraclepro/video-player that referenced this pull request Sep 9, 2022
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

Successfully merging this pull request may close these issues.

2 participants