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

Feature request: pass back player instance in event callbacks #407

Closed
matthew-dean opened this issue May 23, 2018 · 2 comments
Closed

Feature request: pass back player instance in event callbacks #407

matthew-dean opened this issue May 23, 2018 · 2 comments

Comments

@matthew-dean
Copy link

So, in our app, unfortunately, we need to wrap components with https://github.com/faceyspacey/react-universal-component, including react-player. Unfortunately because of the way React works, setting a ref property to a universal-wrapped component does not pass the ref to the underlying component like it does other props.

This means that we can't ever attach a reference to react-player (without forking/rewriting the library). What would be nice is if onReady() / onPlay() callbacks, etc passed back the player instance, so that we can use instance methods. Without any sort of callback mechanism, none of the instance methods are callable.

By the way, this isn't specific to react-universal-component, but will be the case with any higher-order component that wraps react-player.

@cookpete
Copy link
Owner

Fixed in 1.6.2. Sorry for the delay @matthew-dean!

@matthew-dean
Copy link
Author

@cookpete No worries, thanks so much!

david-hub024 pushed a commit to david-hub024/React_VideoPlayer that referenced this issue Dec 23, 2018
david-hub024 pushed a commit to david-hub024/React_VideoPlayer that referenced this issue May 23, 2020
albanqoku added a commit to albanqoku/react-player that referenced this issue Feb 24, 2021
Webmaster1116 added a commit to Webmaster1116/video-player that referenced this issue May 20, 2021
webmiraclepro added a commit to webmiraclepro/video-player that referenced this issue 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

No branches or pull requests

2 participants