Added in API level 14
Deprecated in API level 21

MetadataEditor


open class MetadataEditor : MediaMetadataEditor
kotlin.Any
   ↳ android.media.MediaMetadataEditor
   ↳ android.media.RemoteControlClient.MetadataEditor

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
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

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.

Parameters
key Int: The identifier of a the metadata field to set. Valid values are android.media.MediaMetadataRetriever#METADATA_KEY_ALBUM, android.media.MediaMetadataRetriever#METADATA_KEY_ALBUMARTIST, android.media.MediaMetadataRetriever#METADATA_KEY_TITLE, android.media.MediaMetadataRetriever#METADATA_KEY_ARTIST, android.media.MediaMetadataRetriever#METADATA_KEY_AUTHOR, android.media.MediaMetadataRetriever#METADATA_KEY_COMPILATION, android.media.MediaMetadataRetriever#METADATA_KEY_COMPOSER, android.media.MediaMetadataRetriever#METADATA_KEY_DATE, android.media.MediaMetadataRetriever#METADATA_KEY_GENRE, android.media.MediaMetadataRetriever#METADATA_KEY_TITLE, android.media.MediaMetadataRetriever#METADATA_KEY_WRITER.
value String!: The text for the given key, or null to signify there is no valid information for the field.
Return
RemoteControlClient.MetadataEditor! Returns a reference to the same MetadataEditor object, so you can chain put calls together.