fluttercommunity / fluttercommunity/chewie

How to constraint the video with similar options to `BoxFit` enum instead of just `aspectRatio`

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

Description

[Flutter BoxFit Class](https://api.flutter.dev/flutter/painting/BoxFit-class.html)

In the link above it shows images for how a child can fit to the container it's in.
For the current implementation of Chewie, If the video files aspect ratio is not exactly same as the container we put it in, then we see black bars on the sides or on the top/bottom.

Instead I think we should be able to have the option to use one of the fitting mechanics like the ones in BoxFit. Right now I set Chewie controllers aspect ratio to the containers ratio. And this distorts the video. I would rather lose some of the video pixels than distort or have black bars for my case. BoxFit.cover is what I am looking for personally.

How is the fullscreen mechanism of Chewie implemented? Maybe fullscreen implementation is using something similar. I looked but could not find it:/

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing Chewie's controller aspect-ratio handling and the existing fullscreen implementation, then compare that behavior with Flutter's BoxFit documentation linked in the issue. Determine how a fitting option such as BoxFit.cover could be exposed without distorting the video or leaving black bars, and validate it with video and container aspect ratios that differ.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
mobile-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.