FileMediaItem

Added in 1.0.0
Deprecated in 1.3.0

class FileMediaItem : MediaItem


Structure for media item for a file.

Users should use Builder to create FileMediaItem.

You cannot directly send this object across the process through ParcelUtils. See MediaItem for detail.

See also
MediaItem

Summary

Nested types

This class is deprecated.

androidx.media2 is deprecated.

Constants

const Long
FD_LENGTH_UNKNOWN = 576460752303423487

Used when the length of file descriptor is unknown.

Public functions

Long

Returns the content length associated with the ParcelFileDescriptor of this media item.

Long

Returns the offset associated with the ParcelFileDescriptor of this media item.

ParcelFileDescriptor

Returns the ParcelFileDescriptor of this media item.

Inherited Constants

From androidx.media2.common.MediaItem
const Long
POSITION_UNKNOWN = 576460752303423487

Used when a position is unknown.

Inherited functions

From androidx.media2.common.MediaItem
Long

Return the position in milliseconds at which the playback will end.

MediaMetadata?

Gets the metadata of the media.

Long

Return the position in milliseconds at which the playback will start.

Unit

Sets metadata.

String!

Constants

FD_LENGTH_UNKNOWN

Added in 1.0.0
Deprecated in 1.3.0
const val FD_LENGTH_UNKNOWN = 576460752303423487: Long

Used when the length of file descriptor is unknown.

Public functions

getFileDescriptorLength

Added in 1.0.0
Deprecated in 1.3.0
fun getFileDescriptorLength(): Long

Returns the content length associated with the ParcelFileDescriptor of this media item. FD_LENGTH_UNKNOWN means same as the length of source content.

Returns
Long

the content length associated with the ParcelFileDescriptor of this media item

getFileDescriptorOffset

Added in 1.0.0
Deprecated in 1.3.0
fun getFileDescriptorOffset(): Long

Returns the offset associated with the ParcelFileDescriptor of this media item. It's meaningful only when it has been set by the MediaItem.Builder.

Returns
Long

the offset associated with the ParcelFileDescriptor of this media item

getParcelFileDescriptor

Added in 1.0.0
Deprecated in 1.3.0
fun getParcelFileDescriptor(): ParcelFileDescriptor

Returns the ParcelFileDescriptor of this media item.

Returns
ParcelFileDescriptor

the ParcelFileDescriptor of this media item