fluttercommunity / chewie

The video player for Flutter with a heart of gold
MIT License
1.92k stars 984 forks source link

Fullscreen toggle button does not work as expected #261

Open lazarvgd opened 4 years ago

lazarvgd commented 4 years ago

Hi, I am building an application where whole screen should be video player. The problem is that when I press full screen toggle button it exits full screen for a second or two and then it returns to fullscreen again. Also the same thing happens when I launch the app in portrait mode and then press fullscreen button it remains in portrait mode, even though the button is in fullscreen state.

Here is my code, flutter doctor -v output and links to two videos with issues.

$ flutter doctor -v [✓] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.15.2 19C57, locale en-RS) • Flutter version 1.12.13+hotfix.5 at /Users/lazarjovicic/flutter • Framework revision 27321ebbad (6 weeks ago), 2019-12-10 18:15:01 -0800 • Engine revision 2994f7e1e6 • Dart version 2.7.0

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2) • Android SDK at /Users/lazarjovicic/Library/Android/sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-29, build-tools 29.0.2 • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405) • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 11.3.1, Build version 11C504 • CocoaPods version 1.8.4

[✓] Android Studio (version 3.5) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin version 42.1.1 • Dart plugin version 191.8593 • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] VS Code (version 1.41.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.7.1

[✓] Connected device (2 available) • Android SDK built for x86 • emulator-5554 • android-x86 • Android 10 (API 29) (emulator) • Android SDK built for x86 • emulator-5556 • android-x86 • Android 10 (API 29) (emulator)

• No issues found!

`import 'package:chewie/chewie.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:video_player/video_player.dart';

class VideoPlayerScreen extends StatefulWidget { static String id = 'VideoPlayerScreen';

@override _VideoPlayerScreenState createState() => _VideoPlayerScreenState(); }

class _VideoPlayerScreenState extends State { VideoPlayerController _videoPlayerController = VideoPlayerController.network('https://www.radiantmediaplayer.com/media/bbb-360p.mp4'); ChewieController _chewieController; Chewie _playerWidget;

@override void initState() { super.initState(); _chewieController = ChewieController( videoPlayerController: _videoPlayerController, aspectRatio: 3 / 2, autoPlay: true, looping: false, fullScreenByDefault: true, allowFullScreen: true, deviceOrientationsAfterFullScreen: [DeviceOrientation.portraitUp],

);
_playerWidget = Chewie(
  controller: _chewieController,
);

}

@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(), body: _playerWidget, ); }

@override void dispose() { super.dispose(); _videoPlayerController.dispose(); _chewieController.dispose(); } }`

Videos with issue https://vimeo.com/user107763391/review/386429256/a96061a733 and https://vimeo.com/user107763391/review/386429236/43f6785a78

Can you please help me to solve this issue? Thanks

Ahmadre commented 4 years ago

First could you please format your markdown correctly? Second: Your links aren't available anymore. Thx 🙏

PrismaSoftGC commented 4 years ago

Same problem here, please fix this please.

imtoori commented 4 years ago

Same problem here..