views:

133

answers:

1

Hello. I need some help. The situation looks like this: I can get list of media files (mp3s, m4as, m4vs an so on) with link to the file (looks like:

http://10.0.1.1/Media/Files%20Folder/File%20Itself.m4v

So I get an array consisting of links to these files.

I need to display these items in UITableView with corresponding tags (Genre, Artist etc.) and most importantly, album art (it's embedded in file).

How can I fetch that information? If possible, without loading whole media file. Thanks for any help.

A: 

You'll want to use AVURLAsset along with the method -loadValuesAsynchronouslyForKeys:completionHandler:.

Also note that the docs say

AVAsset and other classes provide their metadata “lazily” (see AVAsynchronousKeyValueLoading), meaning that you can obtain objects from those arrays without incurring overhead for items you don’t ultimately inspect.

So I'm guessing you won't run into problems of loading the whole file.

jtbandes
Seems like it's iOS4 only. I'm also writing iPad version, guess I'll have to go some other way. Thanks for showing the easy way, tho.
Yuri