Closed Joyker closed 4 years ago
Closed Solution: restrict screen mode to landscape only, dont`t set aspect ratio, set fullScreenByDefault: false, and place chewie inside Expanded ---- Container(height: size.height, width:size.width)
@Joyker after v.0.10.0 you got more control here :) I'll update the readme.
Helo everybody, i need your help. I have a problem. I want to achieve only fullscreen player in landscape mode.
And leave video player page on back button or leaving fullscreen. Without fullScreenByDefault: true everything seems to be fine. I can just press back button and return to previous screen.
But if it is set to true something goes wrong. Pressing back button or minimize button leads to portrait mode for 1 second and back to landscape, next one to portrait mode. Next finally closes this page. I expect to close the page after first back button or leave fullscreen. And I have no idea what is going wrong. Thanks in advance for any help.
`VideoPlayer({this.title, this.url, this.isLive = false});
final String title; final String url; final bool isLive; @override State createState() {
return _VideoPlayerState();
}
}
class _VideoPlayerState extends State {
VideoPlayerController _videoPlayerController1;
ChewieController _chewieController;
@override void initState() { super.initState();
}
@override Widget build(BuildContext context) { SystemChrome.setPreferredOrientations([ DeviceOrientation.landscapeRight, DeviceOrientation.landscapeLeft, ]);
}
@override void dispose() { _chewieController.dispose(); _videoPlayerController1.dispose();
} }`