Added in API level 19
Deprecated in API level 29

MetadataEditor


class MetadataEditor : MediaMetadataEditor

A class to read the metadata published by a RemoteControlClient, or send a RemoteControlClient new values for keys that can be edited.

Summary

Inherited constants
Int BITMAP_KEY_ARTWORK

The metadata key for the content artwork / album art.

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

Applies all of the metadata changes that have been set since the MediaMetadataEditor instance was created with RemoteController.editMetadata() or since clear() was called.

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.

Unit clear()

Clears all the pending metadata changes set since the MediaMetadataEditor instance was created or since this method was last called. Note that clearing the metadata doesn't reset the editable keys (use removeEditableKeys() instead).

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.

MediaMetadataEditor! putBitmap(key: Int, bitmap: Bitmap!)

Adds image.

MediaMetadataEditor! putLong(key: Int, value: Long)

Adds numerical information. Note that none of the information added after apply() has been called will be available to consumers of metadata stored by the MediaMetadataEditor.

MediaMetadataEditor! putObject(key: Int, value: Any!)

Adds information stored as an instance. Note that none of the information added after apply() has been called will be available to consumers of metadata stored by the MediaMetadataEditor.

MediaMetadataEditor! putString(key: Int, value: String!)

Adds textual information. Note that none of the information added after apply() has been called, will be available to consumers of metadata stored by the MediaMetadataEditor.

Unit removeEditableKeys()

Causes all metadata fields to be read-only.

Public methods

apply

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

Deprecated: Deprecated in Java.

Applies all of the metadata changes that have been set since the MediaMetadataEditor instance was created with RemoteController.editMetadata() or since clear() was called.