diff --git a/Model/Player/Backends/AVPlayerBackend.swift b/Model/Player/Backends/AVPlayerBackend.swift index e6017864..428a4099 100644 --- a/Model/Player/Backends/AVPlayerBackend.swift +++ b/Model/Player/Backends/AVPlayerBackend.swift @@ -285,10 +285,6 @@ final class AVPlayerBackend: PlayerBackend { } let startPlaying = { - #if !os(macOS) - try? AVAudioSession.sharedInstance().setActive(true) - #endif - self.setRate(self.model.currentRate) guard let item = self.model.playerItem, self.isAutoplaying(item) else { return } diff --git a/Model/Player/Backends/MPVBackend.swift b/Model/Player/Backends/MPVBackend.swift index f7938a91..64f51b83 100644 --- a/Model/Player/Backends/MPVBackend.swift +++ b/Model/Player/Backends/MPVBackend.swift @@ -192,10 +192,6 @@ final class MPVBackend: PlayerBackend { } let startPlaying = { - #if !os(macOS) - try? AVAudioSession.sharedInstance().setActive(true) - #endif - DispatchQueue.main.async { [weak self] in guard let self = self else { return diff --git a/Model/Player/PlayerModel.swift b/Model/Player/PlayerModel.swift index 99a1cf26..66576897 100644 --- a/Model/Player/PlayerModel.swift +++ b/Model/Player/PlayerModel.swift @@ -755,11 +755,6 @@ final class PlayerModel: ObservableObject { remoteCommandCenterConfigured = true #if !os(macOS) - try? AVAudioSession.sharedInstance().setCategory( - .playback, - mode: .moviePlayback - ) - UIApplication.shared.beginReceivingRemoteControlEvents() #endif diff --git a/Shared/YatteeApp.swift b/Shared/YatteeApp.swift index ed85c78a..5301e983 100644 --- a/Shared/YatteeApp.swift +++ b/Shared/YatteeApp.swift @@ -247,6 +247,11 @@ struct YatteeApp: App { } } #endif + + #if !os(macOS) + try? AVAudioSession.sharedInstance().setCategory(.playback) + try? AVAudioSession.sharedInstance().setActive(true) + #endif } func migrateAccounts() {