ActionSchedule.Builder
class ActionSchedule.Builder
A builder for ActionSchedule instances.
Summary
Public functions |
|
|---|---|
ActionSchedule.Builder! |
@CanIgnoreReturnValueSchedules a add media items action to be executed. |
ActionSchedule.Builder! |
@CanIgnoreReturnValueSchedules an action. |
ActionSchedule! |
build()Builds the schedule. |
ActionSchedule.Builder! |
Schedules a clear media items action to be created. |
ActionSchedule.Builder! |
Schedules a clear video surface action. |
ActionSchedule.Builder! |
@CanIgnoreReturnValueSchedules a delay between executing any previous actions and any subsequent ones. |
ActionSchedule.Builder! |
@CanIgnoreReturnValueSchedules a renderer disable action. |
ActionSchedule.Builder! |
@CanIgnoreReturnValueSchedules a renderer enable action. |
ActionSchedule.Builder! |
@CanIgnoreReturnValueSchedules a |
ActionSchedule.Builder! |
@CanIgnoreReturnValueSchedules a move media item action to be executed. |
ActionSchedule.Builder! |
Schedules a pause action. |
ActionSchedule.Builder! |
Schedules a play action. |
ActionSchedule.Builder! |
@CanIgnoreReturnValueSchedules a play action, waits until the player reaches the specified position, and pauses the player again. |
ActionSchedule.Builder! |
@CanIgnoreReturnValueSchedules a play action, waits until the player reaches the start of the specified media item, and pauses the player again. |
ActionSchedule.Builder! |
Schedules a prepare action to be executed. |
ActionSchedule.Builder! |
@CanIgnoreReturnValueSchedules a remove media item action to be executed. |
ActionSchedule.Builder! |
@CanIgnoreReturnValueSchedules a remove media items action to be executed. |
ActionSchedule.Builder! |
@CanIgnoreReturnValueSchedules an action repeatedly. |
ActionSchedule.Builder! |
@CanIgnoreReturnValueSchedules a seek action. |
ActionSchedule.Builder! |
@CanIgnoreReturnValueSchedules a seek action. |
ActionSchedule.Builder! |
@CanIgnoreReturnValueSchedules a seek action to be executed. |
ActionSchedule.Builder! |
seekAndWait(positionMs: Long)Schedules a seek action and waits until playback resumes after the seek. |
ActionSchedule.Builder! |
@CanIgnoreReturnValueSchedules sending a |
ActionSchedule.Builder! |
@CanIgnoreReturnValueSchedules sending a |
ActionSchedule.Builder! |
@CanIgnoreReturnValueSchedules to send a |
ActionSchedule.Builder! |
@CanIgnoreReturnValueSchedules application of audio attributes. |
ActionSchedule.Builder! |
@CanIgnoreReturnValueSchedules a set media items action to be executed. |
ActionSchedule.Builder! |
@CanIgnoreReturnValueSchedules a set media sources action to be executed. |
ActionSchedule.Builder! |
@CanIgnoreReturnValueSchedules a set media source actions to be executed. |
ActionSchedule.Builder! |
@CanIgnoreReturnValueSchedules a playback parameters setting action. |
ActionSchedule.Builder! |
@CanIgnoreReturnValueSchedules a repeat mode setting action. |
ActionSchedule.Builder! |
@CanIgnoreReturnValueSchedules a shuffle setting action to be executed. |
ActionSchedule.Builder! |
@CanIgnoreReturnValueSchedules a set shuffle order action to be executed. |
ActionSchedule.Builder! |
Schedules a set video surface action. |
ActionSchedule.Builder! |
Schedules a stop action. |
ActionSchedule.Builder! |
Schedules to throw a playback exception on the playback thread. |
ActionSchedule.Builder! |
@CanIgnoreReturnValueSchedules a delay until |
ActionSchedule.Builder! |
@CanIgnoreReturnValueSchedules a delay until a message arrives at the |
ActionSchedule.Builder! |
Schedules a delay until all pending player commands have been handled. |
ActionSchedule.Builder! |
@CanIgnoreReturnValueSchedules a delay until playWhenReady has the specified value. |
ActionSchedule.Builder! |
@CanIgnoreReturnValueSchedules a delay until the playback state changed to the specified state. |
ActionSchedule.Builder! |
Schedules a delay until the next position discontinuity. |
ActionSchedule.Builder! |
Schedules a delay until any timeline change. |
ActionSchedule.Builder! |
@CanIgnoreReturnValueSchedules a delay until the timeline changed to a specified expected timeline. |
Public functions
addMediaSources
@CanIgnoreReturnValue
fun addMediaSources(mediaSources: Array<MediaSource!>!): ActionSchedule.Builder!
Schedules a add media items action to be executed.
| Parameters | |
|---|---|
mediaSources: Array<MediaSource!>! |
The media sources to add. |
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
apply
@CanIgnoreReturnValue
fun apply(action: Action!): ActionSchedule.Builder!
Schedules an action.
| Parameters | |
|---|---|
action: Action! |
The action to schedule. |
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
clearMediaItems
@CanIgnoreReturnValue
fun clearMediaItems(): ActionSchedule.Builder!
Schedules a clear media items action to be created.
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder. for convenience, |
clearVideoSurface
@CanIgnoreReturnValue
fun clearVideoSurface(): ActionSchedule.Builder!
Schedules a clear video surface action.
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
delay
@CanIgnoreReturnValue
fun delay(delayMs: Long): ActionSchedule.Builder!
Schedules a delay between executing any previous actions and any subsequent ones.
| Parameters | |
|---|---|
delayMs: Long |
The delay in milliseconds. |
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
disableRenderer
@CanIgnoreReturnValue
fun disableRenderer(index: Int): ActionSchedule.Builder!
Schedules a renderer disable action.
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
enableRenderer
@CanIgnoreReturnValue
fun enableRenderer(index: Int): ActionSchedule.Builder!
Schedules a renderer enable action.
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
executeRunnable
@CanIgnoreReturnValue
fun executeRunnable(runnable: Runnable!): ActionSchedule.Builder!
Schedules a Runnable.
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
moveMediaItem
@CanIgnoreReturnValue
fun moveMediaItem(currentIndex: Int, newIndex: Int): ActionSchedule.Builder!
Schedules a move media item action to be executed.
| Parameters | |
|---|---|
currentIndex: Int |
The current index of the item to move. |
newIndex: Int |
The index after the item has been moved. |
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
pause
@CanIgnoreReturnValue
fun pause(): ActionSchedule.Builder!
Schedules a pause action.
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
play
@CanIgnoreReturnValue
fun play(): ActionSchedule.Builder!
Schedules a play action.
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
playUntilPosition
@CanIgnoreReturnValue
fun playUntilPosition(mediaItemIndex: Int, positionMs: Long): ActionSchedule.Builder!
Schedules a play action, waits until the player reaches the specified position, and pauses the player again.
| Parameters | |
|---|---|
mediaItemIndex: Int |
The media item index at which the player should be paused again. |
positionMs: Long |
The position in that media item at which the player should be paused again. |
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
playUntilStartOfMediaItem
@CanIgnoreReturnValue
fun playUntilStartOfMediaItem(mediaItemIndex: Int): ActionSchedule.Builder!
Schedules a play action, waits until the player reaches the start of the specified media item, and pauses the player again.
| Parameters | |
|---|---|
mediaItemIndex: Int |
The media item index at which the player should be paused again. |
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
prepare
@CanIgnoreReturnValue
fun prepare(): ActionSchedule.Builder!
Schedules a prepare action to be executed.
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
removeMediaItem
@CanIgnoreReturnValue
fun removeMediaItem(index: Int): ActionSchedule.Builder!
Schedules a remove media item action to be executed.
| Parameters | |
|---|---|
index: Int |
The index of the media item to be removed. |
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
removeMediaItems
@CanIgnoreReturnValue
fun removeMediaItems(fromIndex: Int, toIndex: Int): ActionSchedule.Builder!
Schedules a remove media items action to be executed.
| Parameters | |
|---|---|
fromIndex: Int |
The start of the range of media items to be removed. |
toIndex: Int |
The end of the range of media items to be removed (exclusive). |
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
repeat
@CanIgnoreReturnValue
fun repeat(action: Action!, intervalMs: Long): ActionSchedule.Builder!
Schedules an action repeatedly.
| Parameters | |
|---|---|
action: Action! |
The action to schedule. |
intervalMs: Long |
The interval between each repetition in milliseconds. |
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
seek
@CanIgnoreReturnValue
fun seek(positionMs: Long): ActionSchedule.Builder!
Schedules a seek action.
| Parameters | |
|---|---|
positionMs: Long |
The seek position. |
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
seek
@CanIgnoreReturnValue
fun seek(mediaItemIndex: Int, positionMs: Long): ActionSchedule.Builder!
Schedules a seek action.
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
seek
@CanIgnoreReturnValue
fun seek(
mediaItemIndex: Int,
positionMs: Long,
catchIllegalSeekException: Boolean
): ActionSchedule.Builder!
Schedules a seek action to be executed.
| Parameters | |
|---|---|
mediaItemIndex: Int |
The media item to seek to. |
positionMs: Long |
The seek position. |
catchIllegalSeekException: Boolean |
Whether an illegal seek position should be caught or not. |
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
seekAndWait
fun seekAndWait(positionMs: Long): ActionSchedule.Builder!
Schedules a seek action and waits until playback resumes after the seek.
| Parameters | |
|---|---|
positionMs: Long |
The seek position. |
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
sendMessage
@CanIgnoreReturnValue
fun sendMessage(target: PlayerMessage.Target!, positionMs: Long): ActionSchedule.Builder!
Schedules sending a PlayerMessage.
| Parameters | |
|---|---|
target: PlayerMessage.Target! |
A message target. |
positionMs: Long |
The position in the current media item at which the message should be sent, in milliseconds. |
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
sendMessage
@CanIgnoreReturnValue
fun sendMessage(
target: PlayerMessage.Target!,
mediaItemIndex: Int,
positionMs: Long
): ActionSchedule.Builder!
Schedules sending a PlayerMessage.
| Parameters | |
|---|---|
target: PlayerMessage.Target! |
A message target. |
mediaItemIndex: Int |
The media item index at which the message should be sent. |
positionMs: Long |
The position at which the message should be sent, in milliseconds. |
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
sendMessage
@CanIgnoreReturnValue
fun sendMessage(
target: PlayerMessage.Target!,
mediaItemIndex: Int,
positionMs: Long,
deleteAfterDelivery: Boolean
): ActionSchedule.Builder!
Schedules to send a PlayerMessage.
| Parameters | |
|---|---|
target: PlayerMessage.Target! |
A message target. |
mediaItemIndex: Int |
The media item index at which the message should be sent. |
positionMs: Long |
The position at which the message should be sent, in milliseconds. |
deleteAfterDelivery: Boolean |
Whether the message will be deleted after delivery. |
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
setAudioAttributes
@CanIgnoreReturnValue
fun setAudioAttributes(
audioAttributes: AudioAttributes!,
handleAudioFocus: Boolean
): ActionSchedule.Builder!
Schedules application of audio attributes.
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
setMediaSources
@CanIgnoreReturnValue
fun setMediaSources(mediaSources: Array<MediaSource!>!): ActionSchedule.Builder!
Schedules a set media items action to be executed.
| Parameters | |
|---|---|
mediaSources: Array<MediaSource!>! |
The media sources to add. |
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
setMediaSources
@CanIgnoreReturnValue
fun setMediaSources(resetPosition: Boolean, sources: Array<MediaSource!>!): ActionSchedule.Builder!
Schedules a set media sources action to be executed.
| Parameters | |
|---|---|
resetPosition: Boolean |
Whether the playback position should be reset. |
sources: Array<MediaSource!>! |
The media sources to be set on the player. |
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
setMediaSources
@CanIgnoreReturnValue
fun setMediaSources(
mediaItemIndex: Int,
positionMs: Long,
sources: Array<MediaSource!>!
): ActionSchedule.Builder!
Schedules a set media source actions to be executed.
| Parameters | |
|---|---|
mediaItemIndex: Int |
The media item index to start playback from or |
positionMs: Long |
The position in milliseconds from where playback should start. If |
sources: Array<MediaSource!>! |
The media sources to be set on the player. |
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
setPlaybackParameters
@CanIgnoreReturnValue
fun setPlaybackParameters(playbackParameters: PlaybackParameters!): ActionSchedule.Builder!
Schedules a playback parameters setting action.
| Parameters | |
|---|---|
playbackParameters: PlaybackParameters! |
The playback parameters to set. |
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
| See also | |
|---|---|
setPlaybackParameters |
setRepeatMode
@CanIgnoreReturnValue
fun setRepeatMode(@Player.RepeatMode repeatMode: Int): ActionSchedule.Builder!
Schedules a repeat mode setting action.
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
setShuffleModeEnabled
@CanIgnoreReturnValue
fun setShuffleModeEnabled(shuffleModeEnabled: Boolean): ActionSchedule.Builder!
Schedules a shuffle setting action to be executed.
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
setShuffleOrder
@CanIgnoreReturnValue
fun setShuffleOrder(shuffleOrder: ShuffleOrder!): ActionSchedule.Builder!
Schedules a set shuffle order action to be executed.
| Parameters | |
|---|---|
shuffleOrder: ShuffleOrder! |
The shuffle order. |
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
setVideoSurface
@CanIgnoreReturnValue
fun setVideoSurface(): ActionSchedule.Builder!
Schedules a set video surface action.
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
stop
@CanIgnoreReturnValue
fun stop(): ActionSchedule.Builder!
Schedules a stop action.
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
throwPlaybackException
@CanIgnoreReturnValue
fun throwPlaybackException(exception: ExoPlaybackException!): ActionSchedule.Builder!
Schedules to throw a playback exception on the playback thread.
| Parameters | |
|---|---|
exception: ExoPlaybackException! |
The exception to throw. |
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
waitForIsLoading
@CanIgnoreReturnValue
fun waitForIsLoading(targetIsLoading: Boolean): ActionSchedule.Builder!
Schedules a delay until player.isLoading() changes to the specified value.
| Parameters | |
|---|---|
targetIsLoading: Boolean |
The target value of |
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
waitForMessage
@CanIgnoreReturnValue
fun waitForMessage(playerTarget: ActionSchedule.PlayerTarget!): ActionSchedule.Builder!
Schedules a delay until a message arrives at the PlayerMessage.Target.
| Parameters | |
|---|---|
playerTarget: ActionSchedule.PlayerTarget! |
The target to observe. |
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
waitForPendingPlayerCommands
@CanIgnoreReturnValue
fun waitForPendingPlayerCommands(): ActionSchedule.Builder!
Schedules a delay until all pending player commands have been handled.
A command is considered as having been handled if it arrived on the playback thread and the player acknowledged that it received the command back to the app thread.
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
waitForPlayWhenReady
@CanIgnoreReturnValue
fun waitForPlayWhenReady(targetPlayWhenReady: Boolean): ActionSchedule.Builder!
Schedules a delay until playWhenReady has the specified value.
| Parameters | |
|---|---|
targetPlayWhenReady: Boolean |
The target playWhenReady value. |
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
waitForPlaybackState
@CanIgnoreReturnValue
fun waitForPlaybackState(@Player.State targetPlaybackState: Int): ActionSchedule.Builder!
Schedules a delay until the playback state changed to the specified state.
| Parameters | |
|---|---|
@Player.State targetPlaybackState: Int |
The target playback state. |
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
waitForPositionDiscontinuity
@CanIgnoreReturnValue
fun waitForPositionDiscontinuity(): ActionSchedule.Builder!
Schedules a delay until the next position discontinuity.
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
waitForTimelineChanged
@CanIgnoreReturnValue
fun waitForTimelineChanged(): ActionSchedule.Builder!
Schedules a delay until any timeline change.
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |
waitForTimelineChanged
@CanIgnoreReturnValue
fun waitForTimelineChanged(
expectedTimeline: Timeline!,
@Player.TimelineChangeReason expectedReason: Int
): ActionSchedule.Builder!
Schedules a delay until the timeline changed to a specified expected timeline.
| Parameters | |
|---|---|
expectedTimeline: Timeline! |
The expected timeline. |
@Player.TimelineChangeReason expectedReason: Int |
The expected reason of the timeline change. |
| Returns | |
|---|---|
ActionSchedule.Builder! |
The builder, for convenience. |