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