Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

DataSourceDesc2

abstract class DataSourceDesc2
kotlin.Any
   ↳ androidx.media2.DataSourceDesc2

Structure for data source descriptor. Used by MediaItem2.

Summary

Nested classes
abstract

Builder class for DataSourceDesc2 objects.

Constants
static Int

static Int

static Int

static Long

Used when a position is unknown.

Public methods
open Long

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

open Long

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

abstract Int

Return the type of data source.

open String?

Return the media Id of data source.

Constants

TYPE_CALLBACK

static val TYPE_CALLBACK: Int
Value: 1

TYPE_FD

static val TYPE_FD: Int
Value: 2

TYPE_URI

static val TYPE_URI: Int
Value: 3

POSITION_UNKNOWN

static val POSITION_UNKNOWN: Long

Used when a position is unknown.

Value: LONG_MAX

Public methods

getStartPosition

open fun getStartPosition(): Long

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

Return
Long: the position in milliseconds at which the playback will start

getEndPosition

open fun getEndPosition(): Long

Return the position in milliseconds at which the playback will end. POSITION_UNKNOWN means ending at the end of source content.

Return
Long: the position in milliseconds at which the playback will end

getType

abstract fun getType(): Int

Return the type of data source.

Return
Int: the type of data source

getMediaId

@Nullable open fun getMediaId(): String?

Return the media Id of data source.

Return
String?: the media Id of data source