1

is there a way to load an AVURLAsset in a synchronous manner? My scenario is one which I need to load the assets in the background while showing a different view and change to the view showing the AVPlayer when the assets are ready to play. Not before.

I've tried loading async and calling a delegate method to tell "the assets are ready, you can show the next view", but if I get a mem warning before that, the views containing the assets in the background get released before they finish loading...so i never get the delegate call. That's why I rather do it synchronously.

Any ideas?

nico
  • 9,668
  • 8
  • 26
  • 28

1 Answers1

1

I'm not 100% sure I understand what you're getting at, but I believe you should be able to just use [AVURLAsset commonMetadata] or [AVURLAsset metadataForFormat:[[AVURLAsset availableMetadataFormats] lastObject]] and then show your view once this information has been loaded. Theses methods return an array of AVMetadataItems, which you should rather easily be able to traverse with a for loop. Sorry if this wasn't what you were looking for.

superhawk610
  • 2,457
  • 2
  • 18
  • 27