Don’t pause background music when opening a GIF

This commit is contained in:
Jed Fox 2022-12-23 16:55:41 -05:00
parent dc1f65e0b5
commit 3b3f870caa
No known key found for this signature in database
GPG Key ID: 0B61D18EA54B47E1
1 changed files with 3 additions and 1 deletions

View File

@ -67,7 +67,9 @@ final class MediaPreviewVideoViewModel {
case .unknown, .buffering, .readyToPlay:
break
case .playing:
try? AVAudioSession.sharedInstance().setCategory(.playback)
if case .video = item {
try? AVAudioSession.sharedInstance().setCategory(.playback)
}
try? AVAudioSession.sharedInstance().setActive(true)
case .paused, .stopped, .failed:
try? AVAudioSession.sharedInstance().setCategory(.ambient) // set to ambient to allow mixed (needed for GIFV)