diff -r 4d198a32ac7d -r d4809db37847 plugins/org.symbian.tools.wrttools.doc.WebDeveloper/html/GUID-E3D26890-581A-427F-8AFF-16081528A8B8.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/org.symbian.tools.wrttools.doc.WebDeveloper/html/GUID-E3D26890-581A-427F-8AFF-16081528A8B8.html Thu Aug 19 17:48:04 2010 -0700 @@ -0,0 +1,71 @@ + + +Accessing +information about media files stored on a device

Accessing +information about media files stored on a device

+

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.

+

Accessing the API and supported methods

+

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:

+
    +
  • GetList()

    + +

    Use the GetList() method to retrieve information +from a given service or data source on the device.

    + +
  • +
  • Cancel()

    + +

    Use the Cancel() method to cancel an ongoing asynchronous +call. This method is valid for any asynchronous call made through the Media +Management Service API.

    + +
  • +
+
+

Using the service in a widget

+

To access media file information using the Media Management Service +API:

+
    +
  1. Create a service +object for the API using device.getServiceObject().

    +
  2. +
  3. Define the +type of media about which you want to retrieve information.

  4. +
  5. Optionally, +define how you want the results sorted.

  6. +
  7. Define a handler +method to process the results.

  8. +
  9. Retrieve the +media file information using GetList() together +with callback().

    +
  10. +
  11. Process the +results in the handler method defined in step 4.

  12. +
+

For the complete source of a sample widget that demonstrates how to +use this service, see the full example.

+
+
\ No newline at end of file