flutter_vlc_player icon indicating copy to clipboard operation
flutter_vlc_player copied to clipboard

Resume stream after deep sleep (Flutter/iOS)

Open juwei80 opened this issue 3 years ago • 2 comments

Hi all, does anyone have a solution to resume the live network stream when resuming the app (iOS) after a certain time? It seems after around 40 seconds the app gets moved in a deep sleep mode when not in use.

Actually I implement the controller, which just start when opening the app like:

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

    _videoPlayerController = VlcPlayerController.network(
      "rtsp://192.168.x.x/12",
      autoPlay: true,
      options: VlcPlayerOptions(),
    );
  }

and adding the player in my scaffold:

VlcPlayer(
                  controller: _videoPlayerController,
                  aspectRatio: 16 / 9,
                  placeholder: const Center(child: CircularProgressIndicator()),
                )

When homing the device and get back to the app after a view seconds, the stream proceeds to play.

If I wait much longer, a minute or so, the stream will stall and not continue.

Does anyone got an idea on how to fix that?

Best regards, Juergen

juwei80 avatar Jul 24 '22 19:07 juwei80

I think the one of the problem is that a default life cycle observer is initialized.

I would suggest to leave that handling by the devs are using this lib @illia-romanenko In my case i show a rtsp and i won't pause the stream, i wan't stop it. If the stream is paused for a long time playing the stream again is not working.

pinpong avatar Mar 12 '23 15:03 pinpong

https://github.com/solid-software/flutter_vlc_player/pull/397

pinpong avatar Mar 13 '23 11:03 pinpong