RtspMediaSource
@UnstableApi
class RtspMediaSource : BaseMediaSource
| kotlin.Any | ||
| ↳ | androidx.media3.exoplayer.source.BaseMediaSource | |
| ↳ | androidx.media3.exoplayer.rtsp.RtspMediaSource |
An Rtsp MediaSource
Summary
Nested types |
|---|
|
Factory for |
|
Thrown when an exception or error is encountered during loading an RTSP stream. |
|
Thrown when an RTSP Unsupported Transport error (461) is encountered during RTSP Setup. |
Constants |
|
|---|---|
const Long |
DEFAULT_TIMEOUT_MS = 8000The default value for |
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. |
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 |
||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||||||||||||||||||||
Constants
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.
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. |
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.