chewie icon indicating copy to clipboard operation
chewie copied to clipboard

full screen not working but when it works and i exit fullscreen it throws error

Open Bidhanrai opened this issue 5 years ago • 8 comments

Bidhanrai avatar Aug 26 '19 09:08 Bidhanrai

Same issue here

Akora-IngDKB avatar Aug 27 '19 15:08 Akora-IngDKB

@Bidhanrai Add this property to the ChewieController deviceOrientationAfterFullScreen: [DeviceOrientation.portraitUp]

Akora-IngDKB avatar Aug 27 '19 15:08 Akora-IngDKB

@Bidhanrai does this fix your issue?

cbenhagen avatar Sep 02 '19 20:09 cbenhagen

It did for some days and it stopped working again.

Akora-IngDKB avatar Sep 02 '19 21:09 Akora-IngDKB

Can you please provide a non-working example?

cbenhagen avatar Sep 02 '19 22:09 cbenhagen

Full app source is available here

import 'package:flutter/services.dart';
import 'package:video_player/video_player.dart';
import 'package:chewie/chewie.dart';

class SermonDetails extends StatefulWidget {
  final Map<String, String> sermonDetails;

  // This map contains info about the sermon:
  SermonDetails(this.sermonDetails);

  @override
  _SermonDetailsState createState() => _SermonDetailsState();
}

class _SermonDetailsState extends State<SermonDetails> {
  VideoPlayerController _videoPlayerController;
  ChewieController _chewieController;

  @override
  void initState() {
    super.initState();
    // Replace the URL by the one in the Map up there: widget.sermonDetails['mediaUrl']
    _videoPlayerController = VideoPlayerController.network(
        'http://www.sample-videos.com/video123/mp4/720/big_buck_bunny_720p_20mb.mp4');

    _chewieController = ChewieController(
      videoPlayerController: _videoPlayerController,
      aspectRatio: _videoPlayerController.value?.aspectRatio,
      autoInitialize: true,
      autoPlay: true,
      allowFullScreen: true,
      deviceOrientationsAfterFullScreen: [DeviceOrientation.portraitUp],
      placeholder: Container(
        color: Colors.grey,
      ),
      // The Full Screen has an issue. Will implement it once it's resolved
      // fullScreenByDefault: true,
      looping: false,
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
          leading: IconButton(
            icon: Icon(Icons.arrow_back),
            onPressed: () => Navigator.pop(context),
          ),
          title: Text(widget.sermonDetails['title'])),
      body: Column(
        mainAxisSize: MainAxisSize.max,
        children: <Widget>[
          Expanded(
            child: Center(child: Chewie(controller: _chewieController)),
          ),
        ],
      ),
    );
  }

  @override
  void dispose() {
    super.dispose();
    _videoPlayerController.dispose();
    _chewieController.dispose();
  }
}```

Akora-IngDKB avatar Sep 02 '19 23:09 Akora-IngDKB

Fullscreen is totally not working in my case, I am useing this in my app:

SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]).then((_) { runApp(new MyApp()); });

Any way to fix the fullscreen button on the player or just hide it? Or handle the fullscreen button with a custom click listener?

klaszlo8207 avatar Sep 19 '19 06:09 klaszlo8207

same issue here.

cinder92 avatar Sep 15 '21 15:09 cinder92