chewie icon indicating copy to clipboard operation
chewie copied to clipboard

Local hls streaming

Open Sharleedah opened this issue 2 years ago • 2 comments

Hello,

i encountered the problem, that when exchanging the the hls streaming from a api (works perfectly) to a local hls file that i get the following error:

[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(VideoError, Failed to load video: Der Vorgang konnte nicht abgeschlossen werden. (CoreMediaErrorDomain-Fehler -12865.), null, null)

in the lines 555ff of chewie_player.dart (version

if ((autoInitialize || autoPlay) &&
        !videoPlayerController.value.isInitialized) {
      await videoPlayerController.initialize();
    }

Example Widget:

class DummyScreen extends StatefulWidget {
  @override
  _DummyScreenState createState() => _DummyScreenState();
}

class _DummyScreenState extends State<DummyScreen> {
  late VideoPlayerController _controller;
  late ChewieController chewieController;

  @override
  void initState() {
    _controller = VideoPlayerController.file(File('path/to/file/1080.m3u8'));

    super.initState();
    chewieController = ChewieController(
      videoPlayerController: _controller,
      aspectRatio: 3 / 2,
      autoPlay: true,
      looping: true,
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text("Sample App"),
        ),
        body: Container(
          child: Chewie(controller: chewieController),
        ));
  }
}



Sharleedah avatar Aug 21 '23 12:08 Sharleedah

Could you get it to play? @Sharleedah

amani27 avatar Oct 31 '23 07:10 amani27