fix: audio session not deactivate after enter background issue

This commit is contained in:
CMK 2021-06-30 18:02:01 +08:00
parent cdbb9cf2d1
commit 4318e3c9d1
2 changed files with 2 additions and 1 deletions

View File

@ -9,6 +9,7 @@ import os.log
import UIKit
import UserNotifications
import AppShared
import AVFoundation
#if ASDK
import AsyncDisplayKit
@ -55,7 +56,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}
}
extension AppDelegate {

View File

@ -83,6 +83,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
// Called as the scene transitions from the foreground to the background.
// Use this method to save data, release shared resources, and store enough scene-specific state information
// to restore the scene back to its current state.
AppContext.shared.audioPlaybackService.pauseIfNeed()
}