DashMediaSource
@UnstableApi
class DashMediaSource : BaseMediaSource
| kotlin.Any | ||
| ↳ | androidx.media3.exoplayer.source.BaseMediaSource | |
| ↳ | androidx.media3.exoplayer.dash.DashMediaSource |
A DASH MediaSource.
Summary
Nested types |
|---|
|
Factory for |
Constants |
|
|---|---|
const Long |
The default target |
const String! |
DEFAULT_MEDIA_ID = "DashMediaSource"The media id used by media items of dash media sources without a manifest URI. |
const Long |
MIN_LIVE_DEFAULT_START_POSITION_US = 5000000The minimum default start position for live streams, in microseconds relative to the start of the live window. |
Public functions |
|
|---|---|
Boolean |
canUpdateMediaItem(mediaItem: MediaItem!)Returns whether the |
MediaPeriod! |
createPeriod(Returns a new |
Unit |
Throws any pending error encountered while loading or refreshing source information. |
Unit |
releasePeriod(mediaPeriod: MediaPeriod!)Releases the period. |
Unit |
replaceManifestUri(manifestUri: Uri!)Manually replaces the manifest |
synchronized Unit |
updateMediaItem(mediaItem: MediaItem!)Updates the |
Protected functions |
|
|---|---|
Unit |
prepareSourceInternal(mediaTransferListener: TransferListener?)Starts source preparation and enables the source, see |
Unit |
Releases the source, see |
Inherited functions |
||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||||||||||||||||||
|
Inherited properties |
|---|
Constants
DEFAULT_FALLBACK_TARGET_LIVE_OFFSET_MS
const val DEFAULT_FALLBACK_TARGET_LIVE_OFFSET_MS = 30000: Long
The default target offset for live streams that is used if no value is defined in the MediaItem or the manifest.
DEFAULT_MEDIA_ID
const val DEFAULT_MEDIA_ID = "DashMediaSource": String!
The media id used by media items of dash media sources without a manifest URI.
MIN_LIVE_DEFAULT_START_POSITION_US
const val MIN_LIVE_DEFAULT_START_POSITION_US = 5000000: Long
The minimum default start position for live streams, in microseconds relative to the start of the live window.
Public functions
canUpdateMediaItem
fun canUpdateMediaItem(mediaItem: MediaItem!): Boolean
Returns whether the MediaItem for this source can be updated with the provided item.
Should not be called directly from application code.
This method must be called on the application thread.
| Returns | |
|---|---|
Boolean |
Whether the source can be updated using this item. |
createPeriod
fun createPeriod(
id: MediaSource.MediaPeriodId!,
allocator: Allocator!,
startPositionUs: Long
): MediaPeriod!
Returns a new MediaPeriod identified by periodId.
Should not be called directly from application code.
This method must be called on the playback thread and only if the source is enabled.
| Parameters | |
|---|---|
id: MediaSource.MediaPeriodId! |
The identifier of the period. |
allocator: Allocator! |
An |
startPositionUs: Long |
The expected start position, in microseconds. |
| Returns | |
|---|---|
MediaPeriod! |
A new |
maybeThrowSourceInfoRefreshError
fun maybeThrowSourceInfoRefreshError(): Unit
Throws any pending error encountered while loading or refreshing source information.
Should not be called directly from application code.
This method must be called on the playback thread and only after prepareSource.
| Throws | |
|---|---|
java.io.IOException |
releasePeriod
fun releasePeriod(mediaPeriod: MediaPeriod!): Unit
Releases the period.
Should not be called directly from application code.
This method must be called on the playback thread.
| Parameters | |
|---|---|
mediaPeriod: MediaPeriod! |
The period to release. |
replaceManifestUri
fun replaceManifestUri(manifestUri: Uri!): Unit
Manually replaces the manifest Uri.
updateMediaItem
synchronized fun updateMediaItem(mediaItem: MediaItem!): Unit
Updates the MediaItem for this source.
Should not be called directly from application code.
This method must be called on the playback thread and only if canUpdateMediaItem returns true for the new MediaItem.
Protected functions
prepareSourceInternal
protected fun prepareSourceInternal(mediaTransferListener: TransferListener?): Unit
Starts source preparation and enables the source, see prepareSource. This method is called at most once until the next call to releaseSourceInternal.
This method is called on the playback thread.
| Parameters | |
|---|---|
mediaTransferListener: TransferListener? |
The transfer listener which should be informed of any media data transfers. May be null if no listener is available. Note that this listener should usually be only informed of transfers related to the media loads and not of auxiliary loads for manifests and other data. |
releaseSourceInternal
protected fun releaseSourceInternal(): Unit
Releases the source, see releaseSource. This method is called exactly once after each call to prepareSourceInternal.
This method is called on the playback thread.