mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 21:43:41 +00:00
Improve setting audio session
This commit is contained in:
parent
8d912f2646
commit
eedc8f32d1
@ -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 }
|
||||
|
@ -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
|
||||
|
@ -755,11 +755,6 @@ final class PlayerModel: ObservableObject {
|
||||
remoteCommandCenterConfigured = true
|
||||
|
||||
#if !os(macOS)
|
||||
try? AVAudioSession.sharedInstance().setCategory(
|
||||
.playback,
|
||||
mode: .moviePlayback
|
||||
)
|
||||
|
||||
UIApplication.shared.beginReceivingRemoteControlEvents()
|
||||
#endif
|
||||
|
||||
|
@ -247,6 +247,11 @@ struct YatteeApp: App {
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !os(macOS)
|
||||
try? AVAudioSession.sharedInstance().setCategory(.playback)
|
||||
try? AVAudioSession.sharedInstance().setActive(true)
|
||||
#endif
|
||||
}
|
||||
|
||||
func migrateAccounts() {
|
||||
|
Loading…
Reference in New Issue
Block a user