From 50b5f221e861ba0d4557a0229c26876294ed934b Mon Sep 17 00:00:00 2001 From: guozhigq Date: Sun, 22 Oct 2023 16:19:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=A1=B5=E9=9D=A2=E5=BF=AB=E9=80=9F?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E6=97=B6=E5=BC=82=E5=B8=B8=20issues=20#175?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/video/detail/introduction/controller.dart | 5 ++++- lib/plugin/pl_player/controller.dart | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/pages/video/detail/introduction/controller.dart b/lib/pages/video/detail/introduction/controller.dart index 6c32dc33..225fea53 100644 --- a/lib/pages/video/detail/introduction/controller.dart +++ b/lib/pages/video/detail/introduction/controller.dart @@ -61,12 +61,15 @@ class VideoIntroController extends GetxController { RxString total = '1'.obs; Timer? timer; bool isPaused = false; - String heroTag = Get.arguments['heroTag']; + String heroTag = ''; @override void onInit() { super.onInit(); userInfo = userInfoCache.get('userInfoCache'); + try { + heroTag = Get.arguments['heroTag']; + } catch (_) {} if (Get.arguments.isNotEmpty) { if (Get.arguments.containsKey('videoItem')) { preRender = true; diff --git a/lib/plugin/pl_player/controller.dart b/lib/plugin/pl_player/controller.dart index c5d515a2..ee4f3545 100644 --- a/lib/plugin/pl_player/controller.dart +++ b/lib/plugin/pl_player/controller.dart @@ -328,6 +328,9 @@ class PlPlayerController { await pause(notify: false); } + if (_playerCount.value == 0) { + return; + } // 配置Player 音轨、字幕等等 _videoPlayerController = await _createVideoController( dataSource, _looping, enableHA, width, height); @@ -992,6 +995,8 @@ class PlPlayerController { localCache.put(LocalCacheKey.danmakuFontScale, fontSizeVal); localCache.put(LocalCacheKey.danmakuSpeed, danmakuSpeedVal); + var pp = _videoPlayerController!.platform as NativePlayer; + await pp.setProperty('audio-files', ''); removeListeners(); await _videoPlayerController?.dispose(); _videoPlayerController = null;