fluttercommunity / fluttercommunity/chewie

fullScreenByDefault does not work with autoPlay

Open
#710 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
2.1k
Forks
1.1k
Avg merge
6d 8h
Merged PRs (30d)
6

Description

Hello,

when using `fullScreenByDefault` the playback does not start in full screen if `autoPlay` is enabled
Worse, the controller still thinks it is in full screen so it displays the wrong control icons and toggle.
This can be reproduced easily with the sample code by enabling the `fullScreenByDefault` option :
![chewie-autoplay-fullscreen](https://user-images.githubusercontent.com/1722050/220344028-bc1467cd-3ff2-4d6c-b68d-266f51bfe6cb.jpg)

I investigated and the way `fullScreenByDefault` and here is what I could find :
During controller init, if `autoPlay` is enabled we try to go manually to full screen.
But the widget is not created yet, since it need the controller...which is still initializing.
The boolean `_isFullScreen` stays on true despite the failed attempt and prevents the future actions to go through.

At the end of the controller init, a listener is registered with the `videoPlayerController` so it can wait for the right time before going full screen. And this listener will stay on forever because of the boolean preventing him from doing his job and self destroying.

I've prepared a fix and will push it as a PR but I wanted to document my findings to simplify the review and launch the discussion.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.