Class MultiControllerPlaylist.Builder
- java.lang.Object
-
- com.castlabs.android.player.playlist.MultiControllerPlaylist.Builder
-
- Enclosing class:
- MultiControllerPlaylist
public static final class MultiControllerPlaylist.Builder extends Object
Builder forMultiControllerPlaylist
-
-
Constructor Summary
Constructors Constructor Description Builder(Context context)
Creates an instance of the Builder.Builder(PlayerView playerView)
Creates an instance of the Builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MultiControllerPlaylist.Builder
backPlayers(int backPlayersCount)
Sets the number of "back players".MultiControllerPlaylist.Builder
forwardPlayers(int forwardPlayersCount)
Sets the number of "forward players".MultiControllerPlaylist
get()
Constructs theMultiControllerPlaylist
.MultiControllerPlaylist.Builder
itemChangeFlags(int itemChangeFlags)
Sets the behaviour that will be applied when a new playlist item is about to be played.MultiControllerPlaylist.Builder
listener(MultiControllerPlaylist.PlaylistListener listener)
MultiControllerPlaylist.Builder
loop(boolean loop)
Sets theloop
flagMultiControllerPlaylist.Builder
nextItemThresholdMs(int nextItemThresholdMs)
Sets thenextItemThreshold
in milliseconds.MultiControllerPlaylist.Builder
playBackground(boolean playBackground)
Sets the flag indicating whether or not to immediately start playing the background PlayerControllers.
-
-
-
Constructor Detail
-
Builder
public Builder(@NonNull PlayerView playerView)
Creates an instance of the Builder.- Parameters:
playerView
- the PlayerView from which to use thecontext
.
-
Builder
public Builder(@NonNull Context context)
Creates an instance of the Builder.- Parameters:
context
- the Context to use when creatingPlayerController
instances.
-
-
Method Detail
-
itemChangeFlags
public MultiControllerPlaylist.Builder itemChangeFlags(int itemChangeFlags)
Sets the behaviour that will be applied when a new playlist item is about to be played.- Parameters:
itemChangeFlags
- flags to set- Returns:
- the Builder
- See Also:
MultiControllerPlaylist.setItemChangeFlags(int)
-
listener
public MultiControllerPlaylist.Builder listener(@Nullable MultiControllerPlaylist.PlaylistListener listener)
- Parameters:
listener
- the listener to set- Returns:
- the Builder
-
loop
public MultiControllerPlaylist.Builder loop(boolean loop)
Sets theloop
flag- Parameters:
loop
- the looping flag- Returns:
- the Builder
-
nextItemThresholdMs
public MultiControllerPlaylist.Builder nextItemThresholdMs(int nextItemThresholdMs)
Sets thenextItemThreshold
in milliseconds.- Parameters:
nextItemThresholdMs
- the next item threshold in milliseconds- Returns:
- the Builder
-
backPlayers
public MultiControllerPlaylist.Builder backPlayers(int backPlayersCount)
Sets the number of "back players". This is the number of concurrently maintained background players for past playlist items. Defaults to 0.- Parameters:
backPlayersCount
- the number of back players to use- Returns:
- the Builder
-
forwardPlayers
public MultiControllerPlaylist.Builder forwardPlayers(int forwardPlayersCount)
Sets the number of "forward players". This is the number of concurrently maintained background players for future playlist items. Defaults to 1.- Parameters:
forwardPlayersCount
- the number of forward players to use- Returns:
- the Builder
-
playBackground
public MultiControllerPlaylist.Builder playBackground(boolean playBackground)
Sets the flag indicating whether or not to immediately start playing the background PlayerControllers. If false, the PlayerController will be inpaused
state until it is attached.- Parameters:
playBackground
- whether to allow background playback or not.- Returns:
- the Builder
-
get
public MultiControllerPlaylist get()
Constructs theMultiControllerPlaylist
.- Returns:
- an instance of
MultiControllerPlaylist
-
-