TheWidlarzGroup / react-native-video

A <Video /> component for react-native
https://thewidlarzgroup.github.io/react-native-video/
MIT License
7.17k stars 2.89k forks source link

how to hide controls even with controls are enabled in ios ? #2251

Closed krunalbad closed 2 years ago

krunalbad commented 3 years ago

Even if controls are enabled i just want to hide controls view only because if controls are enabled it shows the playback in notification centre the only thing i want to achieve is to hide controls view only while the controls prop is enabled true. Is it possible?

Navipro70 commented 3 years ago

Wrap your player by view or Touchable component, set onPress={() => []} with empty function, or give pointerEvents="none"

krunalbad commented 3 years ago

@Navipro70 I meant the default controls that come from the RNVideo. if controls={true} then it will display the default controls view from the player my goal is to set it to true and also not let the default control of the player be displayed so that the AVPlayer can show the controls in the notification center if controls are true then the notification center can show the controls on the lock screen but I want to set my custom control view also while the controls={true} is enabled

Expected Behavious:

Navipro70 commented 3 years ago

@krunalbad If I'm correctly understand your issue, my previous message is answer for your question.

You said that RNVideo show controllers on tap like this https://developer.apple.com/design/human-interface-guidelines/airplay/images/AirPlay_VideoScreen_2x.png but you want not show them. Just block onPress event (all events by tap) on RNVideo component. pointerEvents="none" will help

Next just wrap RNVideoView with TouchableWithoutFeedback and set onPress event to show your custom controllers.

I realize this logic in my app and it works. But maybe I can mistake, because my RNVideo component was used for audio, and didn't show video. I don't quite remember: Is on mount event trigger default RNVideo controllers to show or not? (But I think not show).

Also, if I'm not mistaken, when the application is closed but is in RAM, controls elements in the notification center (except for audio) are blocked.

vishalhyperspace commented 2 years ago

@krunalbad Do you find any solution for this? please share solutions if do you find any.

krunalbad commented 2 years ago

didn't find any. ended using https://github.com/tanguyantoine/react-native-music-control @vishalhyperspace