Use is subject to License Terms. Your use of this web site or any of its contents or software indicates your agreement to be bound by these License Terms.

Copyright © 2002-2006 Sun Microsystems, Inc.; Nokia Corporation. All rights reserved. See the Copyright Notice and Specification License for more details.

MMAPI 1.2

javax.microedition.media.control
Interface MetaDataControl

All Superinterfaces:
Control

public interface MetaDataControl
extends Control

MetaDataControl is used to retrieve metadata information included within the media streams. A MetaDataControl object recognizes and stores metadata and provides XML-like accessor methods to retrieve this information.
Predefined keys are provided to refer to commonly used metadata fields (title, copyright, data, author).


Field Summary
static java.lang.String AUTHOR_KEY
          Default key for AUTHOR information.
static java.lang.String COPYRIGHT_KEY
          Default key for COPYRIGHT information.
static java.lang.String DATE_KEY
          Default key for DATE information.
static java.lang.String TITLE_KEY
          Default key for TITLE information.
 
Method Summary
 java.lang.String[] getKeys()
          Return the list of keys for the available metadata values.
 java.lang.String getKeyValue(java.lang.String key)
          Retrieve the value found in the metadata associated with the given key.
 

Field Detail

AUTHOR_KEY

static final java.lang.String AUTHOR_KEY
Default key for AUTHOR information.

Value "author" is assigned to AUTHOR_KEY.

See Also:
Constant Field Values

COPYRIGHT_KEY

static final java.lang.String COPYRIGHT_KEY
Default key for COPYRIGHT information.

Value "copyright" is assigned to COPYRIGHT_KEY.

See Also:
Constant Field Values

DATE_KEY

static final java.lang.String DATE_KEY
Default key for DATE information.

Value "date" is assigned to DATE_KEY.

See Also:
Constant Field Values

TITLE_KEY

static final java.lang.String TITLE_KEY
Default key for TITLE information.

Value "title" is assigned to TITLE_KEY.

See Also:
Constant Field Values
Method Detail

getKeys

java.lang.String[] getKeys()
Return the list of keys for the available metadata values. The returned array must be an array with at least one key.

Returns:
The list of keys for the available metadata values.

getKeyValue

java.lang.String getKeyValue(java.lang.String key)
Retrieve the value found in the metadata associated with the given key. Only keys obtained from getKeys are valid and can be used to retrieve metadata values. If null or an invalid key is used, an IllegalArgumentException will be thrown.

Some keys are valid but the associated metadata may not be available before a certain portion of the media is played. For example, some streaming media types may contain metadata that's stored at the end of the file. As a result, the metadata may not be available until the playback reaches the end of media. When that happens, calling getKeyValues with those keys will return null before the data is available. However, when the playback reaches the end of media, all metadata values must be made available.

Parameters:
key - a key to retrieve the value.
Returns:
the value of the key or null if the given key is valid but the value is not yet available.
Throws:
java.lang.IllegalArgumentException - Thrown if the given key is null or invalid.