bcc-code / bccm-player

[BCC Media] Flutter package for video-heavy apps
https://bcc-code.github.io/bccm-player/
Other
17 stars 11 forks source link

Feature: Pinch to zoom #27

Closed sudhanshugairola closed 1 year ago

sudhanshugairola commented 1 year ago

Is pinch to zoom is available for video

andreasgangso commented 1 year ago

Not available at the moment but I agree that can be added to the default controls. Should be fairly simple to implement with InteractiveViewer, similar to chewie.

I'd be happy to review a PR for this.

sudhanshugairola commented 1 year ago

InteractiveViewer is not a good approach for maintaining height and width

sudhanshugairola commented 1 year ago

may be that need int width; int height; int rotationDegrees; if (exoPlayer.getVideoFormat() != null) { Format videoFormat = exoPlayer.getVideoFormat(); width = videoFormat.width; height = videoFormat.height; rotationDegrees = videoFormat.rotationDegrees; // Switch the width/height if video was taken in portrait mode if (rotationDegrees == 90 || rotationDegrees == 270) { width = exoPlayer.getVideoFormat().height; height = exoPlayer.getVideoFormat().width; } }

sudhanshugairola commented 1 year ago

also aspect ratio require of perfect zooming

andreasgangso commented 1 year ago

You mean to pinch-zoom so that it fills the screen, right? Good point. When this task is picked up, we should look into what apps like Netflix/youtube does and copy that. If it's just pinch and it zooms to fill the screen, interactiviewer is overkill and so this just depends on #9 and scaling the VideoPlatformView.

sudhanshugairola commented 1 year ago

Hmm right, YouTube, Netflix, prime video or other platforms use width and height and aspect ratio of video, through this video details they adjust fill to screen by pinch to zoom