chewie icon indicating copy to clipboard operation
chewie copied to clipboard

Video is playing on Android but not on iOS

Open joelbrostrom opened this issue 4 years ago • 3 comments

We are running chewie: ^1.2.2 with a dependency override on provider: ^6.0.1 .

The video player plays just fine on android, but in iOS it wont show up at all. The Chewie widget is not built. Unless you run the app in debug with breakpoints. Then it build the Chewie widget, and you can see the video is loaded by the end time next to the progress bar. But nothing will play.

This is the code we're running:

class VideoPlayer extends StatefulWidget {
  VideoPlayer({required this.url});

  final String url;

  @override
  State<VideoPlayer> createState() => _VideoPlayerState();
}

class _VideoPlayerState extends State<VideoPlayer> {
  VideoPlayerController? _videoPlayerController;
  ChewieController? _chewieController;

  @override
  void initState() {
    super.initState();
    setUpVideoControllers();
  }

  Future<void> setUpVideoControllers() async {
    final controller = VideoPlayerController.network(widget.url);
    await controller.initialize();
    setState(() {
      _videoPlayerController = controller;
      _chewieController = ChewieController(
        videoPlayerController: controller,
        autoPlay: false,
        autoInitialize: true,
        cupertinoProgressColors: PrevetTheme.videoControllerColors,
        materialProgressColors: PrevetTheme.videoControllerColors,
      );
    });
  }

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

  @override
  Widget build(BuildContext context) {
    if (_chewieController != null) {
      return Chewie(controller: _chewieController!);
    } else {
      return Center(child: CircularProgressIndicator.adaptive());
    }
  }
}

Does anything strike you as odd?

joelbrostrom avatar Oct 01 '21 11:10 joelbrostrom

Facing similar issue. Did you find the solution yet?

sazzadshopno avatar Nov 17 '21 18:11 sazzadshopno

You can use following package instead appinio_video_player

bilalhamud avatar Nov 26 '21 12:11 bilalhamud

Hey! I had the same issue, specifically, HLS videos were not playing on iOS 15. I stopped using HLS url for that reason and didn't check it since then. Any body can confirm my observation that's about HLS?

vladmazur avatar Dec 16 '21 17:12 vladmazur