MediaMetadataEditor
abstract classMediaMetadataEditor
kotlin.Any | |
↳ | android.media.MediaMetadataEditor |
An abstract class for editing and storing metadata that can be published by RemoteControlClient
. See the RemoteControlClient.editMetadata(boolean)
method to instantiate a RemoteControlClient.MetadataEditor
object.
Summary
Constants | |
---|---|
static Int |
The metadata key for the content artwork / album art. |
static Int |
The metadata key for the content's average rating, not the user's rating. |
static Int |
The metadata key for the content's user rating. |
Public methods | |
---|---|
open Unit |
addEditableKey(key: Int) Flags the given key as being editable. |
abstract Unit |
apply() Applies all of the metadata changes that have been set since the MediaMetadataEditor instance was created or since |
open Unit |
clear() Clears all the pending metadata changes set since the MediaMetadataEditor instance was created or since this method was last called. |
open Bitmap! |
Returns the |
open IntArray! |
Retrieves the keys flagged as editable. |
open Long |
Returns the long value for the key. |
open Any! |
Returns an object representation of the value for the key |
open String! |
Returns the |
open MediaMetadataEditor! |
Adds image. |
open MediaMetadataEditor! |
Adds numerical information. |
open MediaMetadataEditor! |
Adds information stored as an instance. |
open MediaMetadataEditor! |
Adds textual information. |
open Unit |
Causes all metadata fields to be read-only. |
Constants
BITMAP_KEY_ARTWORK
static valBITMAP_KEY_ARTWORK: Int
Deprecated: Deprecated in Java.
The metadata key for the content artwork / album art.
Value: 100
RATING_KEY_BY_OTHERS
static valRATING_KEY_BY_OTHERS: Int
Deprecated: Deprecated in Java.
The metadata key for the content's average rating, not the user's rating. The value associated with this key is a Rating
instance.
Value: 101
See Also
RATING_KEY_BY_USER
static valRATING_KEY_BY_USER: Int
Deprecated: Deprecated in Java.
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.
Value: 268435457
Public methods
addEditableKey
open funaddEditableKey(key: Int): Unit
Deprecated: Deprecated in Java.
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.
Parameters | |
---|---|
key |
Int: the type of metadata that can be edited. The supported key is RATING_KEY_BY_USER . |
apply
abstract funapply(): Unit
Deprecated: Deprecated in Java.
Applies all of the metadata changes that have been set since the MediaMetadataEditor instance was created or since clear()
was called. Subclasses should synchronize on this
for thread safety.
clear
open funclear(): Unit
Deprecated: Deprecated in Java.
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).
getBitmap
open fungetBitmap(
key: Int,
defaultValue: Bitmap!
): Bitmap!
Deprecated: Deprecated in Java.
Returns the Bitmap
value for the key.
Parameters | |
---|---|
key |
Int: the BITMAP_KEY_ARTWORK key |
defaultValue |
Bitmap!: the value returned if the key is not present |
Return | |
---|---|
Bitmap! |
the Bitmap value for the key, or the supplied default value if the key is not present |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
getEditableKeys
open fungetEditableKeys(): IntArray!
Deprecated: Deprecated in Java.
Retrieves the keys flagged as editable.
Return | |
---|---|
IntArray! |
null if there are no editable keys, or an array containing the keys. |
getLong
open fungetLong(
key: Int,
defaultValue: Long
): Long
Deprecated: Deprecated in Java.
Returns the long value for the key.
Parameters | |
---|---|
key |
Int: one of the keys supported in putLong(int,long) |
defaultValue |
Long: the value returned if the key is not present |
Return | |
---|---|
Long |
the long value for the key, or the supplied default value if the key is not present |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
getObject
open fungetObject(
key: Int,
defaultValue: Any!
): Any!
Deprecated: Deprecated in Java.
Returns an object representation of the value for the key
Parameters | |
---|---|
key |
Int: one of the keys supported in putObject(int,java.lang.Object) |
defaultValue |
Any!: the value returned if the key is not present |
Return | |
---|---|
Any! |
the object for the key, as a Long , Bitmap , String , or Rating depending on the key value, or the supplied default value if the key is not present |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
getString
open fungetString(
key: Int,
defaultValue: String!
): String!
Deprecated: Deprecated in Java.
Returns the String
value for the key.
Parameters | |
---|---|
key |
Int: one of the keys supported in putString(int,java.lang.String) |
defaultValue |
String!: the value returned if the key is not present |
Return | |
---|---|
String! |
the String value for the key, or the supplied default value if the key is not present |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
putBitmap
open funputBitmap(
key: Int,
bitmap: Bitmap!
): MediaMetadataEditor!
Deprecated: Deprecated in Java.
Adds image.
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 | |
---|---|
MediaMetadataEditor! |
Returns a reference to the same MediaMetadataEditor object, so you can chain put calls together. |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
See Also
putLong
open funputLong(
key: Int,
value: Long
): MediaMetadataEditor!
Deprecated: Deprecated in Java.
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.
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 | |
---|---|
MediaMetadataEditor! |
Returns a reference to the same MediaMetadataEditor object, so you can chain put calls together. |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
putObject
open funputObject(
key: Int,
value: Any!
): MediaMetadataEditor!
Deprecated: Deprecated in Java.
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.
Parameters | |
---|---|
key |
Int: the identifier of a the metadata field to set. Valid keys for a:
|
value |
Any!: the metadata to add. |
Return | |
---|---|
MediaMetadataEditor! |
Returns a reference to the same MediaMetadataEditor object, so you can chain put calls together. |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
putString
open funputString(
key: Int,
value: String!
): MediaMetadataEditor!
Deprecated: Deprecated in Java.
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.
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_WRITER . |
value |
String!: The text for the given key, or null to signify there is no valid information for the field. |
Return | |
---|---|
MediaMetadataEditor! |
Returns a reference to the same MediaMetadataEditor object, so you can chain put calls together. |
removeEditableKeys
open funremoveEditableKeys(): Unit
Deprecated: Deprecated in Java.
Causes all metadata fields to be read-only.