Skip to content

Aspect ratio improvement #87

Open
Open
@VadymPinchuk

Description

@VadymPinchuk

@brianegan It would be cool to add one more improvement to Chewie. As we have autoinit - we can also add aspectRatio from controller value.
I see this as:

  double _calculateAspectRatio(BuildContext context) {
    final size = MediaQuery.of(context).size;
    final width = size.width;
    final height = size.height;

    return _controller.value.initialized
        ? _controller.value.aspectRatio
        : width > height ? width / height : height / width;
  }

It can simplify video displaying in proper shape.
Waiting for your feedback
Thanks in advance

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions