Resume stream after deep sleep (Flutter/iOS)
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
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.
https://github.com/solid-software/flutter_vlc_player/pull/397