chewie icon indicating copy to clipboard operation
chewie copied to clipboard

Full screen button does not work on iOS

Open enricobenedos opened this issue 3 years ago • 6 comments

Good morning,

I'm retrying this package after a year because I really need it. At the moment I'm using the plain video_player with a lot of handmade custom widget that are already included in chewie. After a year I see that there are yet a lot of issue with full screen button/mode.

In my case full screen button is still not working on iOS (iPhone XS). Are there any plans to fix the problem? On Android full screen seems to work perfectly.

[✓] Flutter (Channel stable, 2.0.5, on macOS 11.2.3 20D91 darwin-x64, locale en-IT)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.55.2)
[✓] Connected device (5 available)

• No issues found!
@override
  void initState() {
    super.initState();

    initalizeControllers();
  }

  void initalizeControllers() async {
    _videoPlayerController = VideoPlayerController.network(widget.url);

    await _videoPlayerController.initialize();

    _chewieController = ChewieController(
        videoPlayerController: _videoPlayerController,
        autoPlay: false,
        looping: false,
        allowFullScreen: true,
        allowPlaybackSpeedChanging: false);

    if (widget.fullScreen) _chewieController.enterFullScreen();

    if (!widget.fullScreen) await _chewieController.setVolume(0);

    if (!widget.fullScreen) await _chewieController.setLooping(true);

    if (widget.position != null)
      await _chewieController.seekTo(widget.position);

    if (widget.automaticStart) await _chewieController.play();

    setState(() {});
  }
@override
  Widget build(BuildContext context) {
    return _videoPlayerController.value.isInitialized
        ? ClipRRect(
            borderRadius: BorderRadius.all(Radius.circular(
                widget.fullScreen ? 0.0 : widget.previewCornerRadius)),
            child: AspectRatio(
              aspectRatio: _videoPlayerController.value.aspectRatio,
              child: Scaffold(
                backgroundColor: Colors.black,
                body: Chewie(
                  controller: _chewieController,
                ),
              ),
            ),
          )
        : MyLoader();
  }

enricobenedos avatar Apr 19 '21 18:04 enricobenedos

@enricobenedos I'm currently using video_player 1.0.1 version and chewie 0.12.2 version and it works fine on emulators and on real iphone 5s. Also change confugiration in your xcode if it's set only portrait mode

assanbayev avatar Apr 28 '21 09:04 assanbayev

I don't understand which is the correct configuration on Xcode, this my app actual configuration:

image

enricobenedos avatar May 03 '21 20:05 enricobenedos

@enricobenedos your configuration seems fine. Then i dont know whats wrong. thats how i implemented chewie

 _chewieController = ChewieController(
                                                              videoPlayerController: widget.controller,
                                                              autoInitialize: true,
                                                              autoPlay: widget.autoplay,
                                                              allowMuting: false,
                                                              deviceOrientationsAfterFullScreen: [DeviceOrientation.portraitUp],
                                                              deviceOrientationsOnEnterFullScreen: [DeviceOrientation.landscapeLeft],
                                                              materialProgressColors: ChewieProgressColors(
                                                                playedColor: Colors.purple,
                                                                handleColor: Colors.purple,
                                                                backgroundColor: Colors.grey,
                                                                bufferedColor: Colors.purple[100],
                                                              ),
                                                              aspectRatio: SizeConfig.aspectRatio,
                                                              //placeholder:videoPlaceholder(),
                                                              errorBuilder: ((context,a) => videoErrorPlaceholder( context, a)),
                                                            );

assanbayev avatar May 11 '21 10:05 assanbayev

@enricobenedos Thank you so much for your issue 🙏

Actually this reminds me to properly document all of the stuff in chewie.

I'll target it asap 👌

Ahmadre avatar May 24 '21 14:05 Ahmadre

Hello, i have almost same problem, button fullscreen work to expand video full, but when I click button fullscreen when video expanded (full screen mode), it doesn't work, it doesn't return the normal mode.

Chewie version 1.2.2, iPhone 13 Pro Max (simulator), iOS 15

Izudinalqasam avatar Nov 21 '21 13:11 Izudinalqasam

Hello, setting device orientations works on Android and the screen rotates to one of requested orientations but iOs stays in portrait.

    _chewieController = ChewieController(
      videoPlayerController: _videoPlayerController,
      allowPlaybackSpeedChanging: false,
      allowMuting: false,
      autoPlay: true,
      allowFullScreen: true,
      allowedScreenSleep: false,
      aspectRatio: 16 / 9,
      placeholder: Center(child: CircularProgressIndicator()),
      deviceOrientationsOnEnterFullScreen: [
        DeviceOrientation.landscapeLeft,
        DeviceOrientation.landscapeRight,
      ],
      deviceOrientationsAfterFullScreen: [DeviceOrientation.portraitUp],
    );

Details:

  • iPhone 8
  • iOs 14.8
  • chewie 1.1.0

markfili avatar Dec 21 '21 14:12 markfili