Start playing video attachments immediately on appear

This commit is contained in:
Shadowfacts 2023-01-06 21:43:27 -04:00
parent abe2bbdfd4
commit 8fb0fb66e3
1 changed files with 9 additions and 0 deletions

View File

@ -16,6 +16,8 @@ class GalleryPlayerViewController: UIViewController {
var attachment: Attachment!
private var isFirstAppearance = true
override func viewDidLoad() {
super.viewDidLoad()
@ -44,6 +46,13 @@ class GalleryPlayerViewController: UIViewController {
DispatchQueue.global(qos: .userInitiated).async {
AudioSessionHelper.enable()
AudioSessionHelper.setVideoPlayback()
DispatchQueue.main.async {
if self.isFirstAppearance {
self.isFirstAppearance = false
self.playerVC.player?.play()
}
}
}
}