chewie icon indicating copy to clipboard operation
chewie copied to clipboard

Zoom not working in fullscreen

Open EpiSayLaCata opened this issue 1 year ago • 2 comments

Hello there,

I'm using chewie for my video player and I run into a problem and it's to not be able to zoom in fullscreen.

Here is the code :

Future<void> _initController() async {
    // We get the file from the cache.
    final file = await _cacheManager.getSingleFile(mediaUrl);

    // We create the video player controller.
    _controller = VideoPlayerController.file(
      file,
      videoPlayerOptions: VideoPlayerOptions(
        mixWithOthers: true,
      ),
    )..addListener(_controllerListener);
    final controller = _controller;

    if (controller != null) {
      await controller.initialize();
      _chewieController = ChewieController(
        allowedScreenSleep: false,
        allowMuting: false,
        allowPlaybackSpeedChanging: false,
        aspectRatio: 4 / 3,
        autoInitialize: true,
        autoPlay: true,
        deviceOrientationsAfterFullScreen: [
          DeviceOrientation.portraitUp,
        ],
        deviceOrientationsOnEnterFullScreen: [
          DeviceOrientation.portraitUp,
          DeviceOrientation.landscapeLeft,
          DeviceOrientation.landscapeRight,
        ],
        hideControlsTimer: const Duration(seconds: 2),
        looping: true,
        maxScale: 4.0,
        showControlsOnInitialize: false,
        showOptions: false,
        showControls: widget.mediaControls,
        videoPlayerController: controller,
        // zoomAndPan: true, NOT WORKING 
      );
    }
}

And here is how I do the zoom :

return _AspectRatio(
    child: chewieController != null &&
            chewieController.videoPlayerController.value.isInitialized
        ? InteractiveViewer(
            minScale: 0.5,
            maxScale: 4.0,
            child: Chewie(
              controller: chewieController,
            ),
          )
        : const Center(
            child: InfiniteSpinner(),
          ),
  );

i'm not sure if it's meant to be done like that but the zoomAndPan is not working at all inside the ChewieController.

Is there something I've done wrong or do you know something about it ?

Thank you,

EpiSayLaCata avatar Feb 06 '24 09:02 EpiSayLaCata

Which Platform. iOS, Android or both?

maherjaafar avatar Feb 19 '24 19:02 maherjaafar

Both

EpiSayLaCata avatar Feb 19 '24 19:02 EpiSayLaCata