TheWidlarzGroup / react-native-video

A <Video /> component for react-native
https://docs.thewidlarzgroup.com/react-native-video/
MIT License
7.2k stars 2.9k forks source link

dismissFullscreenPlayer not working #2178

Closed stachu2k closed 2 years ago

stachu2k commented 4 years ago

Bug

Method dismissFullscreenPlayer is not working when app is presented in fullscreen mode through default native button on iOS. However dismissFullscreenPlayer is working when app is in fullscreen mode following the call of the presentFullscreenPlayer method. This is pretty annoying bug since fullscreen player does not close automatically when video ends, so you have to do it manually and the only way is calling dismissFullscreenPlayer method.

Platform

Which player are you experiencing the problem on:

Environment info

react-native version: 0.61.5 react-native-video version: 4.4.5 but also not working in latest release.

Steps To Reproduce

Create video component in render method of class component and fill onEnd event as follows:

<Video
  ref={ref => this.video = ref}
  ...{props}
  onEnd={() => this.video.dismissFullscreenPlayer()}
/>

Play video, touch on Fullscreen icon and wait till the end of the video.

Video pauses when it is ended and fullscreen player is still visible.

Expected behaviour

Fullscreen closes when ended after calling dismissFullscreenPlayer in onEnd event.

victor012888 commented 3 years ago

I faced the same problem on ios. When I call presentFullscreenPlayer, it throws error Application tried to present modally a view controller that has a parent view controller that have a parent controller I want to make video auto full screen but I can only manually click native button now

stachu2k commented 3 years ago

@victor012888 Hi. In our project we decided to build our own custom player based on <Video> component and re-create controls with React components. We force our player to go fullscreen by using lockToLandscape() from react-native-orientation-locker. We couldn't rely on react-native-video's built-in functionality anymore.

victor012888 commented 3 years ago

@stachu2k Is there anyway to get your version packge? I need it very much.

mi-mazouz commented 3 years ago

same issue for me

b-hexsoul commented 3 years ago

Yes very annoying. We are building a quiz to popup on a timestamp and I want dismissFullscrenPlayer() to work before the quiz shows up.

chapl commented 2 years ago

Any updates?

jakobloekke commented 1 year ago

This is still an issue

KMDev81 commented 1 year ago

This is still an issue same behavior in expo-managed, not possible to close player at end of video. https://forums.expo.dev/t/dismissfullscreen-makes-app-crash/68672

anniewey commented 1 year ago

Had the same issue, dismissFullscreenPlayer doesnt work if controls=true. Cant find a way to dismiss the full screen in onEnd after entering full screen from control button

Anyone manage to find a workaround? I need to use with controls.

"react-native-video": "^5.2.1",

ihafkenschiel commented 6 months ago

This is still an issue.