Audio

The audio object provides information about supported audio functionality on the device.

Supported Platform(s)

- BlackBerry OS 5.0+
- Ripple Emulator

View Supported Platform Table

APIOS 5.0OS 6.0OS 7.0PlayBookRipple
supportedContentTypes Y Y Y  Y
supportedProtocols Y Y Y  Y

Configuration Document Settings

To use all of the API described for this object, you must ensure the following settings are in your configuration document:


You must declare the feature element(s) below in your configuration document:

Feature IDOS 5.0OS 6.0OS 7.0PlayBookRipple
<feature id="blackberry.audio" /> Y Y Y  Y
<feature id="blackberry.audio.Player" /> Y Y Y  Y

Permission Elements (PlayBook Only)
This API does not require a <permission> element to be declared in the configuration document of your BlackBerry WebWorks Application.

supportedContentTypes


static String[] supportedContentTypes(protocol : String)

Supported Platform(s)

 - BlackBerry OS 5.0+
 - Ripple Emulator

Description

Request the list of supported content types for a specified protocol.



Returns

The list of supported content types for the protocol provided

Parameter Type Description
protocol String The input protocol for the supported content types.

Code Example(s)

<script type="text/javascript">
  // Display supported content types for specified protocol 
  var protocol = "file";
  var contentTypes = blackberry.audio.supportedContentTypes(protocol);

  if (contentTypes) {
    var printingContentTypesList = "";
    for (i = 0; i < contentTypes.length; i++) {
      printingContentTypesList += contentTypes[i] + "\n";
    }
    
    alert("List of " + contentTypes.length + " supported content-types for '" + protocol + "' :\n" + printingContentTypesList);
  }    
</script>

supportedProtocols


static String[] supportedProtocols(content_type : String)

Supported Platform(s)

 - BlackBerry OS 5.0+
 - Ripple Emulator

Description

Request the list of supported protocols for a specified content type.



Returns

The list of supported protocols for the content type provided

Parameter Type Description
content_type String The content type for the supported protocols.

Code Example(s)

<script type="text/javascript">
  // Display all supported protocols
  var protocols = blackberry.audio.supportedProtocols(null);

  if (protocols) {
    var printingProtocolsList = "";
    for (i = 0; i < protocols.length; i++) {
      printingProtocolsList += protocols[i] + "\n";
    }
    
    alert("List of " + protocols.length + " supported protocols:\n" + printingProtocolsList);  
  }    
</script>

Documentation generated by JsDoc Toolkit 2.4.0 on Sun Dec 30 2012 13:31:15 GMT-0500 (EST)