jhomlala / betterplayer

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

[BUG] player screen does not scales on large screen when video resolution is low #1200

Open rtechapp opened 1 year ago

rtechapp commented 1 year ago

History check Please confirm that you've checked issues history and you didn't find anything which may solve your issue. i hav ersearched a lot about this problem but no luck.

Describe the bug i am using better player v0.0.82 and i have problem in scaling the video when i try to play low resolution ( eg. 480p or 720p) in large screen say 50 or 55 inches tv and it only shows the video in small screen and rest of the screen remains green screen. but its scaling well on emulator and works perfectly. i have tried all possible fit property say fit fill cover contain but no luck if anyone can help then please assist me. i am attaching tv screen picture and emulator screen as well along with player file codes

video player file contents

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

*Example code Paste here your minimal reproducible code. This code should be ready to copy-paste-run. void initSettings() async{ _animated_controller = AnimationController(vsync: this, duration: Duration(milliseconds: 450)); _animated_controller!.forward();

 prefs = await SharedPreferences.getInstance();
 _subtitle_enabled  =  prefs?.getBool("subtitle_enabled");

 Size screenSize = MediaQuery.of(context).size;
 double aspectRatio = screenSize.width / screenSize.height;
 BetterPlayerConfiguration betterPlayerConfiguration =
 BetterPlayerConfiguration(
   controlsConfiguration: BetterPlayerControlsConfiguration(
     showControls: false,
   ),
   aspectRatio: aspectRatio,
   fit: BoxFit.fill,
   fullScreenByDefault: true,
   autoPlay: true,
   subtitlesConfiguration: BetterPlayerSubtitlesConfiguration(
     backgroundColor: _list_text_bg[_subtitle_background!],
     fontColor: _list_text_color[_subtitle_color!  ],
     outlineColor: Colors.black,
     fontSize: _subtitle_size!.toDouble(),
   ),
 );

 _betterPlayerController = BetterPlayerController(betterPlayerConfiguration);

 _setupDataSource(widget.selected_source!);
 _hideControllers();
 if(_subtitle_enabled! == true){
   _applySubtitle();
 }

}

Expected behavior A clear and concise description of what you expected to happen. (https://user-images.githubusercontent.com/124365311/235419064-a8633092-36f5-44e1-9459-622e2a3b0ed3.jpg) i want it to scale the video as it works on emulator

Screenshots If applicable, add screenshots to help explain your problem. IMG_20230422_120219 Actual TV image

Flutter doctor Please add flutter doctor output here. E:\TVApps from 26 Apr\Application>flutter doctor Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel stable, 3.0.0, on Microsoft Windows [Version 10.0.19045.2846], locale en-US) [√] Android toolchain - develop for Android devices (Android SDK version 33.0.1) [√] Chrome - develop for the web [√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.4.4) [√] Android Studio (version 2021.1) [√] VS Code (version 1.77.3) [√] Connected device (3 available) [√] HTTP Host Availability

• No issues found!

Better Player version

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

Josebergon commented 1 year ago

Hello! This is an old flutter bug and has nothing to do with this package, or that's what I think. Although it is closed, you can check the same problem here #99273. Last time I checked, this problem was already solved on master but they haven't merged it yet to stable channel. Give it a try.

rtechapp commented 1 year ago

because my app requires sdk: ">=2.16.1 <3.0.0" and you want me to switch to master channel but it throws many errors if i try to use flutter master branch

../../AppData/Local/Pub/Cache/hosted/pub.dev/flutter_math_fork-0.5.0/lib/src/widgets/selection/gesture_detector_builder.dart:186:20: Error: The argument type 'void Function(TapDownDetails)' can't be assigned to the parameter type 'void Function(TapDragDownDetails)?'.

FAILURE: Build failed with an exception.

BUILD FAILED in 11s Running Gradle task 'assembleDebug'... 12.4s Gradle task assembleDebug failed with exit code 1

rtechapp commented 1 year ago

how to sole theese errors if i use master branch

Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel master, 3.11.0-2.0.pre.8, on Microsoft Windows [Version 10.0.19045.2846], locale en-US) [√] Windows Version (Installed version of Windows is version 10 or higher) [√] Android toolchain - develop for Android devices (Android SDK version 33.0.1) [√] Chrome - develop for the web [√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.4.4) [√] Android Studio (version 2021.1) [√] VS Code (version 1.77.3) [√] Connected device (3 available) [√] Network resources

• No issues found!