flutter_vlc_player icon indicating copy to clipboard operation
flutter_vlc_player copied to clipboard

The software crashes after closing the video

Open 1056824847 opened this issue 3 years ago • 9 comments

Sometimes the page can be closed normally, and sometimes the software will crash when returning

image image

1056824847 avatar Jul 26 '22 04:07 1056824847

+1

Luk4s2 avatar Aug 31 '22 12:08 Luk4s2

You can try stopping the stream before disposing as someone mentioned here: https://github.com/solid-software/flutter_vlc_player/issues/346#issuecomment-1207288946

SilentPirateWork avatar Feb 06 '23 16:02 SilentPirateWork

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();

vjeson avatar Apr 22 '23 15:04 vjeson

Yeah exactly 😉 Screenshot_20230525-122113

SilentPirateWork avatar May 25 '23 10:05 SilentPirateWork

Yeah exactly 😉 Screenshot_20230525-122113

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;
  }

z1047549075 avatar Aug 24 '23 03:08 z1047549075

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();

jj-gh avatar Sep 08 '23 12:09 jj-gh

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~~

z1047549075 avatar Sep 13 '23 02:09 z1047549075

If the above method still doesn't work, you can try setting hwAcc = HwAcc.disabled

Virczz avatar Nov 07 '23 03:11 Virczz