The software crashes after closing the video
Sometimes the page can be closed normally, and sometimes the software will crash when returning

+1
You can try stopping the stream before disposing as someone mentioned here: https://github.com/solid-software/flutter_vlc_player/issues/346#issuecomment-1207288946
You can try stopping the stream before disposing as someone mentioned here: #346 (comment)
Stop the video before disposing how to do that? Do I call this method? await _videoPlayerController.stop();
Yeah exactly 😉
Yeah exactly 😉
hello,but I try your code,it is also crashes....sometimes
Future<void> resetVideo() async {
await videoPlayerController?.stop();
await videoPlayerController?.stopRecording();
await videoPlayerController?.stopRendererScanning();
await videoPlayerController?.dispose();
}
when I click back, the function is
Future<bool> back() async {
if (isFullScreen.value) {
toggleMenuOpen(menuOpen: false);
changeDirectionModeByUser(1);
return false;
}
if (isConnectCastDevice.value) {
changeisConnectCastDevice(false);
return false;
}
await resetVideo();
Get.back();
return true;
}
hello,but I try your code,it is also crashes....sometimes
Future<void> resetVideo() async { await videoPlayerController?.stop(); await videoPlayerController?.stopRecording(); await videoPlayerController?.stopRendererScanning(); await videoPlayerController?.dispose(); }when I click back, the function is
Future<bool> back() async { if (isFullScreen.value) { toggleMenuOpen(menuOpen: false); changeDirectionModeByUser(1); return false; } if (isConnectCastDevice.value) { changeisConnectCastDevice(false); return false; } await resetVideo(); Get.back(); return true; }
Not sure if this will work for you, but it did for me:
await videoPlayerController?.stopRendererScanning(); // <--- this should come first
await videoPlayerController?.stop();
await videoPlayerController?.dispose();
hello,but I try your code,it is also crashes....sometimes
Future<void> resetVideo() async { await videoPlayerController?.stop(); await videoPlayerController?.stopRecording(); await videoPlayerController?.stopRendererScanning(); await videoPlayerController?.dispose(); }when I click back, the function is
Future<bool> back() async { if (isFullScreen.value) { toggleMenuOpen(menuOpen: false); changeDirectionModeByUser(1); return false; } if (isConnectCastDevice.value) { changeisConnectCastDevice(false); return false; } await resetVideo(); Get.back(); return true; }Not sure if this will work for you, but it did for me:
await videoPlayerController?.stopRendererScanning(); // <--- this should come first await videoPlayerController?.stop(); await videoPlayerController?.dispose();
it it usefully!!!thx you very much~~
If the above method still doesn't work, you can try setting hwAcc = HwAcc.disabled
