Allow video to play sound full screen

This commit is contained in:
Thomas Ricouard 2024-01-06 22:08:41 +01:00
parent ca9dd5b469
commit a80d36227e
2 changed files with 6 additions and 1 deletions

View File

@ -37,7 +37,7 @@ struct NotificationsTab: View {
Button {
routerPath.presentedSheet = .accountPushNotficationsSettings
} label: {
Image(systemName: "bell.badge")
Image(systemName: "bell")
}
}
ToolbarTab(routerPath: $routerPath)

View File

@ -2,6 +2,7 @@ import Models
import Nuke
import QuickLook
import SwiftUI
import AVFoundation
public struct MediaUIView: View, @unchecked Sendable {
private let data: [DisplayData]
@ -40,11 +41,15 @@ public struct MediaUIView: View, @unchecked Sendable {
}
}
.onAppear {
try? AVAudioSession.sharedInstance().setCategory(.playback)
DispatchQueue.main.asyncAfter(deadline: .now() + 0.15) {
scrolledItem = initialItem
isFocused = true
}
}
.onDisappear {
try? AVAudioSession.sharedInstance().setCategory(.ambient)
}
}
}