chewie
chewie copied to clipboard
Flutter Web / Grayed out when full screen is deactivated.
Environment
- Flutter 3.0.0
- video_player: ^2.4.2
- chewie: ^1.3.3
Run
- VSCode
- Google Chrome
How to reproduction
- Build application
- start video
- click full screen button
- click full screen button
When No.3(mini screen => full screen) is worked. At No. 4, the video appears to be playing but is grayed out and not displayed. After 3 seconds of being out of focus, it becomes invisible.
Default Preview
After No.4
Code Sample
import 'package:chewie/chewie.dart';
import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.dark().copyWith(
scaffoldBackgroundColor: darkBlue,
),
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Center(
child: MyWidget(),
),
),
);
}
}
class MyWidget extends StatefulWidget {
const MyWidget({Key? key}) : super(key: key);
@override
State<MyWidget> createState() => _MyWidgetState();
}
class _MyWidgetState extends State<MyWidget> {
late VideoPlayerController _videoPlayerController;
late ChewieController _chewieController;
@override
void initState() {
super.initState();
setController();
}
Future<void> setController() async {
_videoPlayerController = VideoPlayerController.network(
'https://user-images.githubusercontent.com/67848399/171440182-d152a283-baca-406d-8502-95cb46bd8b41.mov');
_chewieController = ChewieController(
videoPlayerController: _videoPlayerController,
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: Container(
margin: const EdgeInsets.all(5.0),
child: SizedBox(
height: 300,
child: Chewie(
controller: _chewieController,
),
),
),
);
}
}
This phenomenon could not be confirmed with the iOS emulator, but is occurring in the case of Chrome.Thenks.
Same issue, happens with both CanvasKit and HTML render.
Is there a solution to the same problem?