pod_player icon indicating copy to clipboard operation
pod_player copied to clipboard

Black rectangle on Full screen video on iphone

Open LucMoreau33560 opened this issue 3 years ago • 3 comments

Hello,

I have a strange issue when I go to full screen mode on iphone 11 (ios 15.5).

Simulator Screen Shot - iPhone 11 - 2022-07-27 at 17 29 50

On iphone 8 (ios 15.5), the issue is also there. The difference of the size of the black rectangle is due to the screen h/w ratio I think.

Simulator Screen Shot - iPhone 8 - 2022-07-27 at 17 44 59

I don't have this issue on Android : Screenshot_20220727_175525

Any idea of what's happening ? Thanks, Luc

LucMoreau33560 avatar Jul 27 '22 15:07 LucMoreau33560

Thanks for filling the issue 🤗 on ios which device are you testing simulator/physical..?

Can you please provide reproducible code for this issue

newtaDev avatar Jul 29 '22 04:07 newtaDev

Hello, The issue appears on both simulator and physical device (at least on iphone 8 and 11). On iPhone 6 iOS 12.5.5 , I don't have this issue. I don't know if it is important but the video I play comes from vimeo.

I will try to create a specific project to reproduce, because my current code is not easily usable

Thank you, Luc

LucMoreau33560 avatar Jul 29 '22 07:07 LucMoreau33560

While creating the project to show the problem, I found what causes this issue : I added the package flutter_statusbarcolor_ns to change the status bar color. And when change the status bar color, the issue appears : await FlutterStatusbarcolor.setStatusBarColor(Colors.black);

Please find below the full code of main.dart to reproduce the issue :

`import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_native_splash/flutter_native_splash.dart'; import 'package:flutter_statusbarcolor_ns/flutter_statusbarcolor_ns.dart'; import 'package:intl/intl_standalone.dart'; import 'package:pod_player/pod_player.dart';

void main() { WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized();

FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding); SystemChrome.setPreferredOrientations([ DeviceOrientation.portraitUp, DeviceOrientation.portraitDown, ]);

loadAsync(); }

void loadAsync() async { await findSystemLocale();

runApp(const MyApp()); await FlutterStatusbarcolor.setStatusBarColor(Colors.black);

FlutterNativeSplash.remove(); }

class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key);

@override Widget build(BuildContext context) { return MaterialApp( title: "Video player issue", theme: ThemeData( primarySwatch: Colors.grey, ), debugShowCheckedModeBanner: false, home: const MyHomePage(title: "Video player issue"), ); } }

class MyHomePage extends StatefulWidget { const MyHomePage({Key? key, required this.title}) : super(key: key);

final String title;

@override State<MyHomePage> createState() => _MyHomePageState(); }

class _MyHomePageState extends State<MyHomePage> { late final PodPlayerController videoController;

@override void initState() { loadVideo();

SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: [
  SystemUiOverlay.bottom,
]);
super.initState();

}

loadVideo() async { String videoId = "719080855";

videoController = PodPlayerController(
    playVideoFrom: PlayVideoFrom.vimeo(videoId),
    podPlayerConfig: PodPlayerConfig(
        autoPlay: true, isLooping: true, wakelockEnabled: true))
  ..initialise();

}

@override Widget build(BuildContext context) { double videoHeight = MediaQuery.of(context).size.width * (9 / 16);

return Scaffold(
    appBar: AppBar(
      title: Text(widget.title),
    ),
    body: Stack(fit: StackFit.expand, children: [
      Column(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
        Expanded(child: Container()),
        Container(
          height: videoHeight,
          child: PodVideoPlayer(controller: videoController),
        ),
        Expanded(child: Container()),
      ])
    ]));

} } `

In pubspec.yaml, I've added : flutter_native_splash: pod_player: flutter_statusbarcolor_ns: intl:

Thank you, Luc

LucMoreau33560 avatar Jul 29 '22 09:07 LucMoreau33560