mirror of
https://github.com/yattee/yattee.git
synced 2024-11-09 15:58:20 +00:00
Revert "Improve setting audio session"
This reverts commit eedc8f32d1
.
Fix #307
This commit is contained in:
parent
cc60011cc6
commit
a7a3e0827d
@ -276,6 +276,10 @@ 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 }
|
||||
|
@ -182,6 +182,10 @@ 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
|
||||
|
@ -714,6 +714,11 @@ final class PlayerModel: ObservableObject {
|
||||
remoteCommandCenterConfigured = true
|
||||
|
||||
#if !os(macOS)
|
||||
try? AVAudioSession.sharedInstance().setCategory(
|
||||
.playback,
|
||||
mode: .moviePlayback
|
||||
)
|
||||
|
||||
UIApplication.shared.beginReceivingRemoteControlEvents()
|
||||
#endif
|
||||
|
||||
|
@ -238,11 +238,6 @@ 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