MediaItem
class MediaItem : Parcelable
| kotlin.Any | |
| ↳ | android.media.browse.MediaBrowser.MediaItem | 
A class with information on a single media item for use in browsing/searching media. MediaItems are application dependent so we cannot guarantee that they contain the right values.
Summary
| Constants | |
|---|---|
| static Int | 
            
             Flag: Indicates that the item has children of its own.  | 
        
| static Int | 
            
             Flag: Indicates that the item is playable.  | 
        
| Inherited constants | |
|---|---|
| Public constructors | |
|---|---|
            MediaItem(description: MediaDescription, flags: Int)Create a new MediaItem for use in browsing media.  | 
        |
| Public methods | |
|---|---|
| open Int | |
| open MediaDescription | 
            
             Returns the description of the media.  | 
        
| open Int | 
            getFlags()Gets the flags of the item.  | 
        
| open String? | 
            
             Returns the media id in the   | 
        
| open Boolean | 
            
             Returns whether this item is browsable.  | 
        
| open Boolean | 
            
             Returns whether this item is playable.  | 
        
| open String | 
            toString() | 
        
| open Unit | 
            writeToParcel(out: Parcel, flags: Int) | 
        
| Properties | |
|---|---|
| static Parcelable.Creator<MediaBrowser.MediaItem!> | |
Constants
FLAG_BROWSABLE
static val FLAG_BROWSABLE: Int
Flag: Indicates that the item has children of its own.
Value: 1FLAG_PLAYABLE
static val FLAG_PLAYABLE: Int
Flag: Indicates that the item is playable.
 The id of this item may be passed to  #playFromMediaId(String, Bundle) to start playing it. 
Value: 2Public constructors
MediaItem
MediaItem(
description: MediaDescription,
flags: Int)
Create a new MediaItem for use in browsing media.
| Parameters | |
|---|---|
description | 
            MediaDescription: The description of the media, which must include a media id. This value cannot be null. | 
          
flags | 
            Int: The flags for this item. Value is either 0 or a combination of android.media.browse.MediaBrowser.MediaItem#FLAG_BROWSABLE, and android.media.browse.MediaBrowser.MediaItem#FLAG_PLAYABLE | 
          
Public methods
describeContents
open fun describeContents(): Int
| Return | |
|---|---|
Int | 
            a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR | 
          
getDescription
open fun getDescription(): MediaDescription
Returns the description of the media.
| Return | |
|---|---|
MediaDescription | 
            This value cannot be null. | 
          
getFlags
open fun getFlags(): Int
Gets the flags of the item.
| Return | |
|---|---|
Int | 
            Value is either 0 or a combination of android.media.browse.MediaBrowser.MediaItem#FLAG_BROWSABLE, and android.media.browse.MediaBrowser.MediaItem#FLAG_PLAYABLE | 
          
getMediaId
open fun getMediaId(): String?
Returns the media id in the MediaDescription for this item.
| Return | |
|---|---|
String? | 
            This value may be null. | 
          
isBrowsable
open fun isBrowsable(): Boolean
Returns whether this item is browsable.
See Also
isPlayable
open fun isPlayable(): Boolean
Returns whether this item is playable.
See Also
toString
open fun toString(): String
| Return | |
|---|---|
String | 
            a string representation of the object. | 
writeToParcel
open fun writeToParcel(
out: Parcel,
flags: Int
): Unit
| Parameters | |
|---|---|
dest | 
            The Parcel in which the object should be written. This value cannot be null. | 
          
flags | 
            Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |