flutter_ijkplayer
flutter_ijkplayer copied to clipboard
player should not play, if app in pause mode and also should not player play if app in background.
player should not play, if app in pause mode and also should not player play if app in background.
This should be determined by your business logic rather than the library.
You should use the plugin or api with the app lifecycle to stop/start playing resources.
Because I have seen many applications need play resource in background.
I have same issue. I use the app life cycle and it works fine if the video is already initialize. However if the video is still preparing I can't pause it.
@override void didChangeAppLifecycleState(AppLifecycleState state) async { if (state == AppLifecycleState.paused) { // controller.reset(); // await controller.stop(); await controller.pause(); } super.didChangeAppLifecycleState(state); }
If the video is not ready and user pause the app (app in background) the video get prepared and the play. Is there any suggestion for this problem?