PreviewApplication open Spatial Video issue

Hi,

I have a Spatial Video that I am trying to load in a visionOS app with PreviewApplication API

 let url = URL(string: "https://mauiman.azureedge.net/videos/SpatialJourney/watermelon_cat.MOV")                                
 let item = PreviewItem(url: url!)
 _ = PreviewApplication.open(items: [item])

When I run the application, I am getting the following error. Did I miss anything?

QLUbiquitousItemFetcher: <QLUbiquitousItemFetcher: 0x6000022edfe0> could not create sandbox wrapper. Error: Error Domain=NSPOSIXErrorDomain Code=2 "couldn't issue sandbox extension com.apple.quicklook.readonly for '/videos/SpatialJourney/watermelon_cat.MOV': No such file or directory" UserInfo={NSDescription=couldn't issue sandbox extension com.apple.quicklook.readonly for '/videos/SpatialJourney/watermelon_cat.MOV': No such file or directory} #PreviewItem

The screen shows up as:

Putting the spatial video locally, I get the following error:

  let url = URL(fileURLWithPath: "watermelon_cat.MOV")
  let item = PreviewItem(url: url)
  _ = PreviewApplication.open(items: [item])

Error getting the size of file(watermelon_cat.MOV -- file:///) with error (Error Domain=NSCocoaErrorDomain Code=260 "The file “watermelon_cat.MOV” couldn’t be opened because there is no such file." UserInfo={NSURL=watermelon_cat.MOV -- file:///, NSFilePath=/watermelon_cat.MOV, NSUnderlyingError=0x600000ea1650 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}) #Generic

Any help is greatly appreciated. Thank you in advance.

Answered by Vision Pro Engineer in 796204022

@jamesboo

PreviewApplication.open only supports local urls. If you'd like us to consider support for remote urls, please file an enhancement request using Feedback Assistant. Once you file the request, please post the FB number here.

If you're not familiar with how to file enhancement requests, take a look at Bug Reporting: How and Why?.

In the meantime, you can use AVPlayerViewController to play videos using a remote url. This is covered around 11:55 of Build compelling spatial photo and video experiences. However, as the presenter mentions, AVPlayerViewController renders with 3D video presentation and not spatial presentation. Finally, the Destination Video example app contains code examples for AVPlayerViewController.

I could get local video to load with the following:

Bundle.main.url(forResource: "watermeloncat", withExtension: "MOV")!

but could not load a remote URL

https://mauiman.azureedge.net/videos/SpatialJourney/watermelon_cat.MOV

Accepted Answer

@jamesboo

PreviewApplication.open only supports local urls. If you'd like us to consider support for remote urls, please file an enhancement request using Feedback Assistant. Once you file the request, please post the FB number here.

If you're not familiar with how to file enhancement requests, take a look at Bug Reporting: How and Why?.

In the meantime, you can use AVPlayerViewController to play videos using a remote url. This is covered around 11:55 of Build compelling spatial photo and video experiences. However, as the presenter mentions, AVPlayerViewController renders with 3D video presentation and not spatial presentation. Finally, the Destination Video example app contains code examples for AVPlayerViewController.

Thanks for the answer. I filed a feature enhancement request: FB14403013

PreviewApplication open Spatial Video issue
 
 
Q