Action.SetMediaItems


public final class Action.SetMediaItems extends Action


Calls setMediaSources.

Summary

Public constructors

SetMediaItems(
    String tag,
    int mediaItemIndex,
    long positionMs,
    MediaSource[] mediaSources
)

Protected methods

void
doActionImpl(
    ExoPlayer player,
    DefaultTrackSelector trackSelector,
    @Nullable Surface surface
)

Called by doActionAndScheduleNextImpl to perform the action.

Public constructors

SetMediaItems

public SetMediaItems(
    String tag,
    int mediaItemIndex,
    long positionMs,
    MediaSource[] mediaSources
)
Parameters
String tag

A tag to use for logging.

int mediaItemIndex

The media item index to start playback from.

long positionMs

The position in milliseconds to start playback from.

MediaSource[] mediaSources

The media sources to populate the playlist with.

Protected methods

doActionImpl

protected void doActionImpl(
    ExoPlayer player,
    DefaultTrackSelector trackSelector,
    @Nullable Surface surface
)

Called by doActionAndScheduleNextImpl to perform the action.

Parameters
ExoPlayer player

The player to which the action should be applied.

DefaultTrackSelector trackSelector

The track selector to which the action should be applied.

@Nullable Surface surface

The surface to use when applying actions, or null if no surface is needed.