ClippingMediaSource
@UnstableApi
class ClippingMediaSource : WrappingMediaSource
MediaSource that wraps a source and clips its timeline based on specified start/end positions. The wrapped source must consist of a single period.
Summary
Nested types |
|---|
|
A builder for |
|
Thrown when a |
@DocumentedThe reason clipping failed. |
Public constructors |
|---|
This function is deprecated. Use |
This function is deprecated. Use |
This function is deprecated. Use |
Public functions |
|
|---|---|
Boolean |
canUpdateMediaItem(mediaItem: MediaItem!)Returns whether the for this source can be updated with the provided item. |
MediaPeriod! |
createPeriod(Creates the requested |
Unit |
Throws any pending error encountered while loading or refreshing source information. |
Unit |
releasePeriod(mediaPeriod: MediaPeriod!)Releases a |
Protected functions |
|
|---|---|
Unit |
onChildSourceInfoRefreshed(newTimeline: Timeline!)Called when the child source info has been refreshed. |
Unit |
Releases the source, see |
Inherited functions |
||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
|
Inherited properties |
||
|---|---|---|
|
Public constructors
ClippingMediaSource
ClippingMediaSource(
mediaSource: MediaSource!,
startPositionUs: Long,
endPositionUs: Long
)
ClippingMediaSource
ClippingMediaSource(
mediaSource: MediaSource!,
startPositionUs: Long,
endPositionUs: Long,
enableInitialDiscontinuity: Boolean,
allowDynamicClippingUpdates: Boolean,
relativeToDefaultPosition: Boolean
)
Public functions
canUpdateMediaItem
fun canUpdateMediaItem(mediaItem: MediaItem!): Boolean
Returns whether the 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.
This method can be overridden to change whether the MediaItem of the child source can be updated.
createPeriod
fun createPeriod(
id: MediaSource.MediaPeriodId!,
allocator: Allocator!,
startPositionUs: Long
): MediaPeriod!
Creates the requested MediaPeriod.
This method typically forwards to the wrapped media source and optionally wraps the returned MediaPeriod.
| See also | |
|---|---|
createPeriod |
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 a MediaPeriod.
This method typically forwards to the wrapped media source and optionally unwraps the provided MediaPeriod.
| See also | |
|---|---|
releasePeriod |
Protected functions
onChildSourceInfoRefreshed
protected fun onChildSourceInfoRefreshed(newTimeline: Timeline!): Unit
Called when the child source info has been refreshed.
This Timeline can be amended if needed, for example using ForwardingTimeline. The Timeline for the wrapping source needs to be published with refreshSourceInfo.
| Parameters | |
|---|---|
newTimeline: Timeline! |
The timeline of the child source. |
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.