mirror of
https://github.com/yattee/yattee.git
synced 2024-12-13 05:40:32 +05:30
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 = {
|
let startPlaying = {
|
||||||
|
#if !os(macOS)
|
||||||
|
try? AVAudioSession.sharedInstance().setActive(true)
|
||||||
|
#endif
|
||||||
|
|
||||||
self.setRate(self.model.currentRate)
|
self.setRate(self.model.currentRate)
|
||||||
|
|
||||||
guard let item = self.model.playerItem, self.isAutoplaying(item) else { return }
|
guard let item = self.model.playerItem, self.isAutoplaying(item) else { return }
|
||||||
|
@ -182,6 +182,10 @@ final class MPVBackend: PlayerBackend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let startPlaying = {
|
let startPlaying = {
|
||||||
|
#if !os(macOS)
|
||||||
|
try? AVAudioSession.sharedInstance().setActive(true)
|
||||||
|
#endif
|
||||||
|
|
||||||
DispatchQueue.main.async { [weak self] in
|
DispatchQueue.main.async { [weak self] in
|
||||||
guard let self = self else {
|
guard let self = self else {
|
||||||
return
|
return
|
||||||
|
@ -714,6 +714,11 @@ final class PlayerModel: ObservableObject {
|
|||||||
remoteCommandCenterConfigured = true
|
remoteCommandCenterConfigured = true
|
||||||
|
|
||||||
#if !os(macOS)
|
#if !os(macOS)
|
||||||
|
try? AVAudioSession.sharedInstance().setCategory(
|
||||||
|
.playback,
|
||||||
|
mode: .moviePlayback
|
||||||
|
)
|
||||||
|
|
||||||
UIApplication.shared.beginReceivingRemoteControlEvents()
|
UIApplication.shared.beginReceivingRemoteControlEvents()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -238,11 +238,6 @@ struct YatteeApp: App {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !os(macOS)
|
|
||||||
try? AVAudioSession.sharedInstance().setCategory(.playback)
|
|
||||||
try? AVAudioSession.sharedInstance().setActive(true)
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func migrateAccounts() {
|
func migrateAccounts() {
|
||||||
|
Loading…
Reference in New Issue
Block a user