Fixes for MPV in macOS

This commit is contained in:
Arkadiusz Fal
2022-02-27 21:31:17 +01:00
parent d45175e67b
commit 09ceb54ae7
54 changed files with 695 additions and 249 deletions

View File

@@ -166,9 +166,11 @@ struct ContentView: View {
}
func setupNowPlayingInfoCenter() {
try? AVAudioSession.sharedInstance().setCategory(.playback, mode: .moviePlayback)
#if !os(macOS)
try? AVAudioSession.sharedInstance().setCategory(.playback, mode: .moviePlayback)
UIApplication.shared.beginReceivingRemoteControlEvents()
UIApplication.shared.beginReceivingRemoteControlEvents()
#endif
MPRemoteCommandCenter.shared().playCommand.addTarget { _ in
player.play()