The Media Management Service API allows widgets to retrieve information about the media files stored in the Media Gallery of a device. You can use the Media Management Service to access information about the following types of media:
Music
Sounds
Images
Video
Streaming media
Using the Media Management Service, you can create widgets, such as a custom photo viewer or audio player, that display or otherwise incorporate media.
To create a service
object for the Media Management Service API, use Service.MediaManagement to
identify the service provider and IDataSource to identify
the supported interface:
var so = device.getServiceObject("Service.MediaManagement", "IDataSource");
The IDataSource interface provides the following
methods:
To access media file information using the Media Management Service API:
Create a service
object for the API using device.getServiceObject().
Define the type of media about which you want to retrieve information.
Optionally, define how you want the results sorted.
Define a handler method to process the results.
Retrieve the
media file information using GetList() together
with callback().
Process the results in the handler method defined in step 4.
For the complete source of a sample widget that demonstrates how to use this service, see the full example.