Class MultiControllerPlaylist.Builder
java.lang.Object
com.castlabs.android.player.playlist.MultiControllerPlaylist.Builder
- Enclosing class:
MultiControllerPlaylist
Builder for
MultiControllerPlaylist
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of the Builder.Builder
(PlayerView playerView) Creates an instance of the Builder. -
Method Summary
Modifier and TypeMethodDescriptionbackPlayers
(int backPlayersCount) Sets the number of "back players".forwardPlayers
(int forwardPlayersCount) Sets the number of "forward players".get()
Constructs theMultiControllerPlaylist
.itemChangeFlags
(int itemChangeFlags) Sets the behaviour that will be applied when a new playlist item is about to be played.justEnableAnalyticsForCurrentItem
(boolean justEnableAnalyticsForCurrentItem) If set to true the analytics sessions are just enabled for current item in the playlist.loop
(boolean loop) Sets theloop
flagnextItemThresholdMs
(int nextItemThresholdMs) Sets thenextItemThreshold
in milliseconds.playBackground
(boolean playBackground) Sets the flag indicating whether or not to immediately start playing the background PlayerControllers.seekToDefaultPositionOnItemChange
(boolean seek) Determines whether to seek to the default position of each item upon transitioning to it.
-
Constructor Details
-
Builder
Creates an instance of the Builder.- Parameters:
playerView
- the PlayerView from which to use thecontext
.
-
Builder
Creates an instance of the Builder.- Parameters:
context
- the Context to use when creatingPlayerController
instances.
-
-
Method Details
-
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:
-
listener
public MultiControllerPlaylist.Builder listener(@Nullable MultiControllerPlaylist.PlaylistListener listener) - Parameters:
listener
- the listener to set- Returns:
- the Builder
-
loop
Sets theloop
flag- Parameters:
loop
- the looping flag- Returns:
- the Builder
-
nextItemThresholdMs
Sets thenextItemThreshold
in milliseconds.- Parameters:
nextItemThresholdMs
- the next item threshold in milliseconds- Returns:
- the Builder
-
backPlayers
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
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
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
-
justEnableAnalyticsForCurrentItem
public MultiControllerPlaylist.Builder justEnableAnalyticsForCurrentItem(boolean justEnableAnalyticsForCurrentItem) If set to true the analytics sessions are just enabled for current item in the playlist.- Parameters:
justEnableAnalyticsForCurrentItem
- the value- Returns:
- the Builder
-
seekToDefaultPositionOnItemChange
Determines whether to seek to the default position of each item upon transitioning to it. When false, each controller instance will simply continue from its last position if it hadn't been released when switching back to it.- Parameters:
seek
- seek to the default position of each item upon transitioning to it- Returns:
- the Builder
-
get
Constructs theMultiControllerPlaylist
.- Returns:
- an instance of
MultiControllerPlaylist
-