QLPreviewController freezes when playing Videos

In my iOS App I present a QLPreviewController where I want to display a locally stored Video from the iPhone's document directory.

    let previewController = QLPreviewController() 
    previewController.dataSource = self
    self.present(previewController, animated: true, completion: nil)
func previewController(_ controller: QLPreviewController, previewItemAt index: Int) -> QLPreviewItem {
    let url = urlForPreview
    return url! as QLPreviewItem
    }

This seems to work fine for all but one of my testflight users. He is using an iPhone 12 with iOS18.0.1. The screen becomes unresponsive. He cannot pause the video, share it or close the QLPreviewController.

In his logfile I see the following error...

[AVAssetTrack loadValuesAsynchronouslyForKeys:completionHandler:] invoked with unrecognized keys ( "currentVideoTrack.preferredTransform")

Any ideas?.

Further to this in case it helps anybody.

When I build my Code with Xcode 16.0 then this problem does not happen.

It had been using Xcode 15.2

The only devices that we had seen with the problem had been running iOS18.0 or iOS18..0.1 . Even iOS18.1 had been OK.

QLPreviewController freezes when playing Videos
 
 
Q