Mavericks MediaLibrary framework

350 views
Skip to first unread message

Pierre Bernard

unread,
Nov 7, 2013, 9:03:18 AM11/7/13
to imedi...@googlegroups.com
Hi all,

I have been playing a bit with the new MediaLibrary as well as the NSMediaLibraryBrowserController.

My test project opens a NSMediaLibraryBrowserController panel as well as a window with a file well.
https://dl.dropboxusercontent.com/u/2381634/iMedia/MediaLibrary%20Tester.zip

When one drags a photo from the panel to the well, it looks up info in the media library and prints it to the console.
The MLMediaObject object seems to carry about the same information than the current PLIST does.
For iPhoto photos, it actually includes a security scoped URL to the master/original image file.
For Aperture photos this is missing.

BTW, when did Apple start adding latitude and longitude values to the PLIST? Is this new to Mavericks?

NSMediaLibraryBrowserController works well, but is a bit slow to load.

MLMediaLibrary is a bit of a pain to get working.
When it does not understand or like the options passed to its constructor, it reports XPC errors or crashes background processes.
The actual taste of the constructor does not seem to align with what the documentation describes.

The MLMediaLibrary and MLMediaSource instances have properties that are loaded lazily.
A first call will return nil. One should then add and observer to the accessor and wait for the values to become available.

When one receives a drag from the NSMediaLibraryBrowserController, one can use an identifier to look up the matching MLMediaObject in one’s own library.
This will fail unless one has first triggered the asynchronous loading of the library and its sources.
I did not find a way to access the actual MLMediaLibrary that NSMediaLibraryBrowserController draws its data from.

NSMediaLibraryBrowserController is of course not relevant to iMedia. It’s basically the “competition”.
MLMediaLibrary could be useful as data source for the iPhoto and Aperture parsers.



Pierre
Reply all
Reply to author
Forward
0 new messages