Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zoom not working in fullscreen #811

Open
EpiSayLaCata opened this issue Feb 6, 2024 · 2 comments
Open

Zoom not working in fullscreen #811

EpiSayLaCata opened this issue Feb 6, 2024 · 2 comments

Comments

@EpiSayLaCata
Copy link

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,

@maherjaafar
Copy link
Collaborator

Which Platform. iOS, Android or both?

@EpiSayLaCata
Copy link
Author

Both

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants