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

onFullScreenToggle callback #48

Closed
xurc opened this issue Jul 23, 2022 · 3 comments
Closed

onFullScreenToggle callback #48

xurc opened this issue Jul 23, 2022 · 3 comments

Comments

@xurc
Copy link

xurc commented Jul 23, 2022

Is there any way to restore the app's PreferredOrientations after exiting fullScreen mode?

The application sets the preferred orientation at startup, but after switching the video to fullscreen and back (even when autoplay to false, just after switching to fullscreen preview), the application starts responding to a change in device orientation.

I did not find anything suitable in the API.

For example, it could be like this:

    controller.onFullScreenOff(() => SystemChrome.setPreferredOrientations([
      DeviceOrientation.portraitUp,
      DeviceOrientation.portraitDown,
    ]));
@emersonsiega
Copy link
Contributor

I'm having this same problem and other, also related to full screen mode.

I have to allow users to open video in full screen mode but keep the device in portraitUp orientation. Something like this:

image

If user turns the device to landscape mode, then, the player have to rotate automatically.

There's the possibility to provide callbacks to override the setPreferredOrientations options? It would help me a lot!

@newtaDev can you take a look here? Thank you!

@xurc
Copy link
Author

xurc commented Jul 27, 2022

I have to allow users to open video in full screen mode but keep the device in portraitUp orientation.

To do this, you can wrap the video preview in GestureDetector and open the player onTap simply on a separate page through the Navigator.push. In this case, everything will be like in your screenshot, the user will have the opportunity to go to fullscreen using the built-in player button, and the orientation can be restored on pressing "back" before Navigator.pop.

This is how we did it and it works, but now we want to play the video inline, and in this case we need either callbacks or parameters for PreferredOrientations so that it is restored inside the player.

@emersonsiega
Copy link
Contributor

I have created these callbacks in my fork... I'm making other changes right now, but as soon as possible I'll send a PR.

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