Class MediaControllerConfig.Builder
java.lang.Object
com.brightcove.player.mediacontroller.MediaControllerConfig.Builder
- Enclosing class:
- MediaControllerConfig
The MediaControllerConfig Builder.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the MediaControllerConfig.setInitialDuration
(int initialDuration) Deprecated.setInitialDuration
(long initialDuration) Sets the initial duration value in milliseconds.setInitialPlayheadPosition
(int initialPlayheadPosition) Deprecated.setInitialPlayheadPosition
(long initialPlayheadPosition) Sets the initial playhead position value in milliseconds.setLayoutId
(int layoutId) Sets the resource layout id.setMediaControllerKeyDispatcher
(MediaControllerKeyDispatcher mediaControllerKeyDispatcher) Sets theMediaControllerKeyDispatcher
.setOnTouchListener
(android.view.View.OnTouchListener onTouchListener) Sets on touch listener.setShowControlsOnCreation
(boolean showControlsOnCreation) Sets whether the Media Controller will be shown when the controller is created.setShowControlsWhenAdIsPlaying
(boolean showControlsWhenAdIsPlaying) Sets whether the Media Controller will be allowed to be shown when an Ad is playing.
-
Constructor Details
-
Builder
public Builder()Instantiates a new MediaControllerConfig.Builder.
-
-
Method Details
-
setLayoutId
Sets the resource layout id.The default value is -1, which will be ignored by the
BrightcoveMediaController
.- Parameters:
layoutId
- the layout id- Returns:
- the builder instance
-
setOnTouchListener
public MediaControllerConfig.Builder setOnTouchListener(@Nullable android.view.View.OnTouchListener onTouchListener) Sets on touch listener.The default value is null, which will be ignored by the
BrightcoveMediaController
.- Parameters:
onTouchListener
- the on touch listener- Returns:
- the builder instance
-
setInitialDuration
Deprecated.Deprecated. Instead use {setInitialDuration(long)
} -
setInitialDuration
Sets the initial duration value in milliseconds.The duration might later be updated by another component or an event. For example, by the
EventType.PROGRESS
or theEventType.VIDEO_DURATION_CHANGED
events.The default value is -1, which will be ignored by the
BrightcoveMediaController
.- Parameters:
initialDuration
- the initial duration value in milliseconds- Returns:
- the builder instance
-
setInitialPlayheadPosition
@Deprecated public MediaControllerConfig.Builder setInitialPlayheadPosition(int initialPlayheadPosition) Deprecated.Deprecated. Instead use {setInitialPlayheadPosition(long)
} -
setInitialPlayheadPosition
Sets the initial playhead position value in milliseconds.The playhead position might later be updated by another component or an event. For example, by the
EventType.PROGRESS
or theEventType.VIDEO_DURATION_CHANGED
events.The default value is -1, which will be ignored by the
BrightcoveMediaController
.- Parameters:
initialPlayheadPosition
- the initial playhead position value in milliseconds- Returns:
- the builder instance
-
setShowControlsOnCreation
Sets whether the Media Controller will be shown when the controller is created. The Default value is true.- Parameters:
showControlsOnCreation
- true to show the controller when it is created.- Returns:
- the builder instance
-
setShowControlsWhenAdIsPlaying
public MediaControllerConfig.Builder setShowControlsWhenAdIsPlaying(boolean showControlsWhenAdIsPlaying) Sets whether the Media Controller will be allowed to be shown when an Ad is playing. The Default value is false.- Parameters:
showControlsWhenAdIsPlaying
- true to show the controller when an Ad is playing.- Returns:
- the builder instance
-
setMediaControllerKeyDispatcher
public MediaControllerConfig.Builder setMediaControllerKeyDispatcher(@Nullable MediaControllerKeyDispatcher mediaControllerKeyDispatcher) Sets theMediaControllerKeyDispatcher
. The default value is null.- Parameters:
mediaControllerKeyDispatcher
- the media controller key dispatcher- Returns:
- the builder instance
-
build
Builds the MediaControllerConfig.- Returns:
- the media controller config
-