diff --git a/lib/plugin/pl_player/controller.dart b/lib/plugin/pl_player/controller.dart index e3a9f6fbb..91857a787 100644 --- a/lib/plugin/pl_player/controller.dart +++ b/lib/plugin/pl_player/controller.dart @@ -1254,14 +1254,12 @@ class PlPlayerController { /// 暂停播放 Future pause({bool notify = true, bool isInterrupt = false}) async { - if (videoPlayerController?.state.playing ?? false) { - _videoPlayerController!.playOrPause(); - playerStatus.status.value = PlayerStatus.paused; + await _videoPlayerController?.pause(); + playerStatus.status.value = PlayerStatus.paused; - // 主动暂停时让出音频焦点 - if (!isInterrupt) { - audioSessionHandler?.setActive(false); - } + // 主动暂停时让出音频焦点 + if (!isInterrupt) { + audioSessionHandler?.setActive(false); } } diff --git a/pubspec.lock b/pubspec.lock index 67e5ec092..93090d173 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1097,7 +1097,7 @@ packages: description: path: media_kit ref: "version_1.2.5" - resolved-ref: ebc4b1a4a3ec3170898e2a502e17c0a25289eb53 + resolved-ref: bc999bf181ddf12d60891f76e41359e4177b93a7 url: "https://github.com/bggRGjQaUbCoE/media-kit.git" source: git version: "1.1.11" @@ -1106,7 +1106,7 @@ packages: description: path: "libs/android/media_kit_libs_android_video" ref: "version_1.2.5" - resolved-ref: ebc4b1a4a3ec3170898e2a502e17c0a25289eb53 + resolved-ref: bc999bf181ddf12d60891f76e41359e4177b93a7 url: "https://github.com/bggRGjQaUbCoE/media-kit.git" source: git version: "1.3.7" @@ -1139,7 +1139,7 @@ packages: description: path: "libs/universal/media_kit_libs_video" ref: "version_1.2.5" - resolved-ref: ebc4b1a4a3ec3170898e2a502e17c0a25289eb53 + resolved-ref: bc999bf181ddf12d60891f76e41359e4177b93a7 url: "https://github.com/bggRGjQaUbCoE/media-kit.git" source: git version: "1.0.5" @@ -1148,7 +1148,7 @@ packages: description: path: "libs/windows/media_kit_libs_windows_video" ref: "version_1.2.5" - resolved-ref: ebc4b1a4a3ec3170898e2a502e17c0a25289eb53 + resolved-ref: bc999bf181ddf12d60891f76e41359e4177b93a7 url: "https://github.com/bggRGjQaUbCoE/media-kit.git" source: git version: "1.0.10" @@ -1157,7 +1157,7 @@ packages: description: path: media_kit_native_event_loop ref: "version_1.2.5" - resolved-ref: ebc4b1a4a3ec3170898e2a502e17c0a25289eb53 + resolved-ref: bc999bf181ddf12d60891f76e41359e4177b93a7 url: "https://github.com/bggRGjQaUbCoE/media-kit.git" source: git version: "1.0.9" @@ -1166,7 +1166,7 @@ packages: description: path: media_kit_video ref: "version_1.2.5" - resolved-ref: ebc4b1a4a3ec3170898e2a502e17c0a25289eb53 + resolved-ref: bc999bf181ddf12d60891f76e41359e4177b93a7 url: "https://github.com/bggRGjQaUbCoE/media-kit.git" source: git version: "1.2.5"