chewie icon indicating copy to clipboard operation
chewie copied to clipboard

Flutter Web / Grayed out when full screen is deactivated.

Open Kurogoma939 opened this issue 3 years ago • 2 comments

Environment

  • Flutter 3.0.0
  • video_player: ^2.4.2
  • chewie: ^1.3.3

Run

  • VSCode
  • Google Chrome

How to reproduction

  1. Build application
  2. start video
  3. click full screen button
  4. 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

ScreenShot 2022-05-27 21 37 01

After No.4

ScreenShot 2022-05-27 21 28 10

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.

Kurogoma939 avatar May 27 '22 12:05 Kurogoma939

Same issue, happens with both CanvasKit and HTML render.

0x3dev avatar Jun 28 '22 15:06 0x3dev

Is there a solution to the same problem?

xfu008 avatar Aug 10 '22 03:08 xfu008