Added in API level 14
Deprecated in API level 21

MetadataEditor


open class MetadataEditor : MediaMetadataEditor

Class used to modify metadata in a RemoteControlClient object. Use RemoteControlClient.editMetadata(boolean) to create an instance of an editor, on which you set the metadata for the RemoteControlClient instance. Once all the information has been set, use apply() to make it the new metadata that should be displayed for the associated client. Once the metadata has been "applied", you cannot reuse this instance of the MetadataEditor.

Summary

Constants
static Int

The metadata key for the content artwork / album art.

Inherited constants
Int RATING_KEY_BY_OTHERS

The metadata key for the content's average rating, not the user's rating. The value associated with this key is a Rating instance.

Int RATING_KEY_BY_USER

The metadata key for the content's user rating. The value associated with this key is a Rating instance. This key can be flagged as "editable" (with addEditableKey(int)) to enable receiving user rating values through the android.media.RemoteControlClient.OnMetadataUpdateListener interface.

Public methods
open Unit

Associates all the metadata that has been set since the MetadataEditor instance was created with RemoteControlClient.editMetadata(boolean), or since clear() was called, with the RemoteControlClient.

open Unit

Clears all the metadata that has been set since the MetadataEditor instance was created (with RemoteControlClient.editMetadata(boolean)).

open RemoteControlClient.MetadataEditor!
putBitmap(key: Int, bitmap: Bitmap!)

Sets the album / artwork picture to be displayed on the remote control.

open RemoteControlClient.MetadataEditor!
putLong(key: Int, value: Long)

Adds numerical information to be displayed.

open RemoteControlClient.MetadataEditor!
putObject(key: Int, object: Any!)

open RemoteControlClient.MetadataEditor!
putString(key: Int, value: String!)

Adds textual information to be displayed.

Inherited functions
Unit addEditableKey(key: Int)

Flags the given key as being editable. This should only be used by metadata publishers, such as RemoteControlClient, which will declare the metadata field as eligible to be updated, with new values received through the RemoteControlClient.OnMetadataUpdateListener interface.

Bitmap! getBitmap(key: Int, defaultValue: Bitmap!)

Returns the Bitmap value for the key.

IntArray! getEditableKeys()

Retrieves the keys flagged as editable.

Long getLong(key: Int, defaultValue: Long)

Returns the long value for the key.

Any! getObject(key: Int, defaultValue: Any!)

Returns an object representation of the value for the key

String! getString(key: Int, defaultValue: String!)

Returns the String value for the key.

Unit removeEditableKeys()

Causes all metadata fields to be read-only.

Constants

BITMAP_KEY_ARTWORK

Added in API level 14
static val BITMAP_KEY_ARTWORK: Int

Deprecated: Deprecated in Java.

The metadata key for the content artwork / album art.

Value: 100

Public methods

apply

Added in API level 14
open fun apply(): Unit

Deprecated: Deprecated in Java.

Associates all the metadata that has been set since the MetadataEditor instance was created with RemoteControlClient.editMetadata(boolean), or since clear() was called, with the RemoteControlClient. Once "applied", this MetadataEditor cannot be reused to edit the RemoteControlClient's metadata.

clear

Added in API level 14
open fun clear(): Unit

Deprecated: Deprecated in Java.

Clears all the metadata that has been set since the MetadataEditor instance was created (with RemoteControlClient.editMetadata(boolean)). Note that clearing the metadata doesn't reset the editable keys (use MediaMetadataEditor.removeEditableKeys() instead).

putBitmap

Added in API level 14
open fun putBitmap(
    key: Int,
    bitmap: Bitmap!
): RemoteControlClient.MetadataEditor!

Deprecated: Deprecated in Java.

Sets the album / artwork picture to be displayed on the remote control.

Parameters
key Int: the identifier of the bitmap to set. The only valid value is BITMAP_KEY_ARTWORK
bitmap Bitmap!: The bitmap for the artwork, or null if there isn't any.
Return
RemoteControlClient.MetadataEditor! Returns a reference to the same MetadataEditor object, so you can chain put calls together.
Exceptions
java.lang.IllegalArgumentException

putLong

Added in API level 14
open fun putLong(
    key: Int,
    value: Long
): RemoteControlClient.MetadataEditor!

Deprecated: Deprecated in Java.

Adds numerical information to be displayed. Note that none of the information added after apply() has been called, will be displayed.

Parameters
key Int: the identifier of a the metadata field to set. Valid values are android.media.MediaMetadataRetriever#METADATA_KEY_CD_TRACK_NUMBER, android.media.MediaMetadataRetriever#METADATA_KEY_DISC_NUMBER, android.media.MediaMetadataRetriever#METADATA_KEY_DURATION (with a value expressed in milliseconds), android.media.MediaMetadataRetriever#METADATA_KEY_YEAR.
value Long: The long value for the given key
Return
RemoteControlClient.MetadataEditor! Returns a reference to the same MetadataEditor object, so you can chain put calls together.
Exceptions
java.lang.IllegalArgumentException

putObject

Added in API level 19
Deprecated in API level 21
open fun putObject(
    key: Int,
    object: Any!
): RemoteControlClient.MetadataEditor!

Deprecated: Deprecated in Java.

Parameters
key Int: the identifier of a the metadata field to set. Valid keys for a:
value the metadata to add.
Return
RemoteControlClient.MetadataEditor! Returns a reference to the same MediaMetadataEditor object, so you can chain put calls together.
Exceptions
java.lang.IllegalArgumentException

putString

Added in API level 14
open fun putString(
    key: Int,
    value: String!
): RemoteControlClient.MetadataEditor!

Deprecated: Deprecated in Java.

Adds textual information to be displayed. Note that none of the information added after apply() has been called, will be displayed.

Return
RemoteControlClient.MetadataEditor! Returns a reference to the same MetadataEditor object, so you can chain put calls together.