forked from shadowfacts/Tusker
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!
|
var attachment: Attachment!
|
||||||
|
|
||||||
|
private var isFirstAppearance = true
|
||||||
|
|
||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
|
|
||||||
|
@ -44,6 +46,13 @@ class GalleryPlayerViewController: UIViewController {
|
||||||
DispatchQueue.global(qos: .userInitiated).async {
|
DispatchQueue.global(qos: .userInitiated).async {
|
||||||
AudioSessionHelper.enable()
|
AudioSessionHelper.enable()
|
||||||
AudioSessionHelper.setVideoPlayback()
|
AudioSessionHelper.setVideoPlayback()
|
||||||
|
|
||||||
|
DispatchQueue.main.async {
|
||||||
|
if self.isFirstAppearance {
|
||||||
|
self.isFirstAppearance = false
|
||||||
|
self.playerVC.player?.play()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue