Can't find an example where PHAssetVideoProgressHandler works with requestPlayerItem. I've gone back to the SamplePhotosApp example and it doesn't appear to be working there either. Specifically the code highlighted in bold below never fires. Any suggestions would be greatly appreciated.
@IBAction func play(_ sender: AnyObject) {
if playerLayer != nil {
/
playerLayer.player!.play()
} else {
let options = PHVideoRequestOptions()
options.isNetworkAccessAllowed = true
options.deliveryMode = .automatic
options.progressHandler = { progress, _, _, _ in
// Handler might not be called on the main queue, so re-dispatch for UI work.
DispatchQueue.main.sync {
self.progressView.progress = Float(progress)
}
}
PHImageManager.default().requestPlayerItem(forVideo: asset, options: options, resultHandler: { playerItem, _ in
DispatchQueue.main.sync {