jhomlala / betterplayer

Better video player for Flutter, with multiple configuration options. Solving typical use cases!
Apache License 2.0
917 stars 972 forks source link

[BUG] Fullscreen landscape error #1174

Open MichalNemec opened 1 year ago

MichalNemec commented 1 year ago

History check it could be related to some, but i didnt find any suggestions that work.

Describe the bug in fully rotational app the player is dismissed.

To Reproduce Steps to reproduce the behavior:

  1. enable portraitUp, both landscapes in main.dart
  2. add

    autoPlay: false,
      looping: false,
      allowedScreenSleep: false,
      fullScreenByDefault: false,
      autoDetectFullscreenDeviceOrientation: false,
      autoDetectFullscreenAspectRatio: false,
    deviceOrientationsOnFullScreen: [
        DeviceOrientation.portraitUp,
        DeviceOrientation.landscapeLeft,
        DeviceOrientation.landscapeRight,
      ],
    
      deviceOrientationsAfterFullScreen: [
        DeviceOrientation.portraitUp,
        DeviceOrientation.landscapeLeft,
        DeviceOrientation.landscapeRight
      ],
  3. play video and enter full screen
  4. See error

*Example code

BetterPlayerConfiguration betterPlayerConfiguration = const BetterPlayerConfiguration(
      aspectRatio: 16 / 9,
      fit: BoxFit.contain,
      autoPlay: false,
      looping: false,
      allowedScreenSleep: false,
      fullScreenByDefault: false,
      autoDetectFullscreenDeviceOrientation: false,
      autoDetectFullscreenAspectRatio: false,
      deviceOrientationsOnFullScreen: [
        DeviceOrientation.landscapeLeft,
        DeviceOrientation.landscapeRight,
      ],
      deviceOrientationsAfterFullScreen: [
        DeviceOrientation.portraitUp,
        DeviceOrientation.landscapeLeft,
        DeviceOrientation.landscapeRight
      ],
      controlsConfiguration: BetterPlayerControlsConfiguration(
        controlBarColor: Colors.transparent,
        enableSkips: false,
        enableMute: true,
        enableSubtitles: false,
        enableQualities: false,
        enableAudioTracks: false,
        enablePlayPause: false,
      ),
      placeholder: VideoShimmer(),
    );

Expected behavior video should rotate based on rotation.

Screenshots

Flutter doctor

[✓] Flutter (Channel stable, 3.7.4, on macOS 13.2.1 22D68 darwin-arm64, locale en-CZ)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc4)
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] VS Code (version 1.75.1)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

Better Player version

Smartphone (please complete the following information):

Additional context

codingsenpi commented 12 months ago

same issue