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

expose onControlShow and onControlHide #164

Closed
Crizzooo opened this issue Nov 19, 2019 · 2 comments
Closed

expose onControlShow and onControlHide #164

Crizzooo opened this issue Nov 19, 2019 · 2 comments

Comments

@Crizzooo
Copy link

Crizzooo commented Nov 19, 2019

We are currently using react-native-video-controls and would like to add our own custom controls and information that should only be visible when the controls are visible.

Rather than add our own onPress and try to keep it in sync with the controlTimeout, it would be great to hook in to the library and know when the controls are shown and paused.

Proposal:

Inside _toggleControls add conditional calls to this.props.onControlShow and this.props.onControlHide

Thoughts?

If acceptable, I'll make a PR and update the README

@kylemilloy
Copy link
Contributor

kylemilloy commented May 17, 2020

You can now utilize onShowControls and onHideControls events as of v2.5

@Rotemy
Copy link

Rotemy commented Jul 28, 2020

@kylemilloy Hi, thanks for the library.

The problem is that you are only taking the props on the constructor so if I want to use dynamic variables in the function I can't (without re-rendering the component).

The way I worked around it now is by doing this videoRef.current.events.onShowControls = onShowControls; but it is ugly :)

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

3 participants