Start playing video attachments immediately on appear
This commit is contained in:
parent
abe2bbdfd4
commit
8fb0fb66e3
|
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue