fix: 媒体通知进度条未按预期停止

This commit is contained in:
guozhigq
2024-03-07 23:35:39 +08:00
committed by orz12
parent 408ff0e4e1
commit 464ffac074
3 changed files with 9 additions and 6 deletions

View File

@@ -20,7 +20,7 @@ class AudioSessionHandler {
session.interruptionEventStream.listen((event) {
final player = PlPlayerController.getInstance();
if (event.begin) {
if (player.playerStatus != PlayerStatus.playing) return;
if (!player.playerStatus.playing) return;
switch (event.type) {
case AudioInterruptionType.duck:
player.setVolume(player.volume.value * 0.5);
@@ -52,7 +52,7 @@ class AudioSessionHandler {
// 耳机拔出暂停
session.becomingNoisyEventStream.listen((_) {
final player = PlPlayerController.getInstance();
if (player.playerStatus == PlayerStatus.playing) {
if (player.playerStatus.playing) {
player.pause();
}
});