Flutter vlc播放器在返回后崩溃应用程序

elcex8rz  于 2023-05-08  发布在  Flutter
关注(0)|答案(1)|浏览(295)

我已经添加了FlutterVLC播放器到我的应用程序。当我从vlc播放器页面返回时,应用程序突然崩溃。
我已经尝试了直接的例子从pub.dev尝试它,但它也导致相同的结果。这是我的错误

D/apitrace(22547): apitrace: warning: caught signal 6
D/apitrace(22547): call flush from exceptionCallback
F/libc    (22547): Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 23200 
(AWindowHandler), pid 22547 (.webyte.vidflix)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'OPPO/CPH2015/OP4C7D:9/PPR1.180610.011/1640680627:user/release-keys'
Revision: '0'
ABI: 'arm64'
pid: 22547, tid: 23200, name: AWindowHandler  >>> com.webyte.vidflix <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: 'java_vm_ext.cc:542] JNI DETECTED ERROR IN APPLICATION: JNI GetJavaVM called with pending exception java.lang.RuntimeException: Error during detachFromGLContext (see logcat for details)'

这是我的代码

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

    _videoPlayerController = VlcPlayerController.network(
      'https://media.w3.org/2010/05/sintel/trailer.mp4',
      hwAcc: HwAcc.full,
      autoPlay: true,
      options: VlcPlayerOptions(),
    )..initialize();
  }

  @override
  void dispose() async {
    super.dispose();
    await _videoPlayerController!.stopRendererScanning();
    await _videoPlayerController!.dispose();
  }
pkbketx9

pkbketx91#

丢弃前停止视频。

@override
  void dispose() async {
    super.dispose();
    await _videoPlayerController!.stop();
    await _videoPlayerController!.stopRendererScanning();
    await _videoPlayerController!.dispose();
  }

相关问题