-
- All Implemented Interfaces:
-
com.brightcove.player.event.Component
,com.brightcove.player.mediacontroller.ShowHideController
public class BrightcoveMediaController extends AbstractComponent implements ShowHideController
The default Brightcove media controller patterned on the Brightcove Web Player.
The media controller provides a container for managing the large play button and the media controls (including control bar, seekbar and the defined set of media control buttons and views) as well as managing the activity lifecycle for these controls.
-
-
Field Summary
Fields Modifier and Type Field Description public final static int
DEFAULT_TIMEOUT
public final static String
CONTROL_BAR_CREATED
public final static String
DURATION
public final static String
MARKER_LIST
public final static String
PROGRESS
public final static String
SEEK_BAR_PROGRESS
public final static String
SEEK_BAR_MAX
public final static String
SET_MARKERS
private BrightcoveMediaControlRegistry
mediaControlRegistry
public final boolean
isTvMode
private boolean
isDVRControllerEnabled
private int
showHideTimeout
-
Constructor Summary
Constructors Constructor Description BrightcoveMediaController(BaseVideoView videoView)
Builds a default media controller for a given video view. BrightcoveMediaController(BaseVideoView videoView, int layout)
Builds a media controller for a given video view and layout.
-
Method Summary
Modifier and Type Method Description BrightcoveMediaControlRegistry
getMediaControlRegistry()
Obtains the button controller registry. boolean
isDVRControllerEnabled()
Checks if the DVR controller is enabled. void
setShowHideTimeout(int value)
Sets the animation timeout. BrightcoveControlBar
getBrightcoveControlBar()
Obtains the current control bar. BrightcoveSeekBar
getBrightcoveSeekBar()
Obtains the current seek bar. int
getSeekBarOffset()
Deprecated. long
getSeekBarOffsetLong()
Gets the live fixed sliding window offset. void
setDVRControllerEnabled(boolean enable)
Enables or disables the DVR controller. boolean
isDragging()
Obtains the dragging state. void
setCuePointMarkersEnabled(boolean state)
Set the enable/disable state that allows (enabled) or prevents (disabled) ad markers being set automaticallywhenever a cue point has been set. void
hide()
Hides the media controls. boolean
isShowing()
Determines whether or not the media controls are showing. boolean
isShowControllerEnable()
It indicates whether the hide mechanism of the ShowHideController is enable or disable.It's enabled by default. boolean
isHideControllerEnable()
It indicates whether the hide mechanism of the ShowHideController is enable or disable.It's enabled by default. void
setShowControllerEnable(boolean showControllerEnable)
The ShowHideController reacts to several events which causes the Media Controller to show.This methods allows you to enable or disable the hide functionality.It's enabled by default. void
setHideControllerEnable(boolean hideControllerEnable)
The ShowHideController reacts to several events which causes the Media Controller to hide.This methods allows you to enable or disable the hide functionality.It's enabled by default. void
setShowHideAnimationStyle(BrightcoveMediaController.AnimationStyle value)
Sets the animation style. void
show()
Shows the media controls. void
disableSeeking(boolean disable)
Disables or enables the BrightcoveControlBar of allowing seeking static boolean
checkTvMode(Context context)
void
requestFocusPlayButtonTV()
Request focus for the play button if videoView is in TV mode boolean
dispatchKeyEvent(KeyEvent event)
Dispatch the key event. void
removeListeners()
Removes all set listeners from the EventEmitter. BrightcoveSeekBarController
getBrightcoveSeekbarController()
-
-
Constructor Detail
-
BrightcoveMediaController
BrightcoveMediaController(BaseVideoView videoView)
Builds a default media controller for a given video view.- Parameters:
videoView
- The Brightcove video view object which will beattached to this media controller.
-
BrightcoveMediaController
BrightcoveMediaController(BaseVideoView videoView, int layout)
Builds a media controller for a given video view and layout.- Parameters:
videoView
- The given Brightcove video view object.layout
- The given layout resource identifier.
-
-
Method Detail
-
getMediaControlRegistry
BrightcoveMediaControlRegistry getMediaControlRegistry()
Obtains the button controller registry.
-
isDVRControllerEnabled
boolean isDVRControllerEnabled()
Checks if the DVR controller is enabled. It only applies for Live videos.It is enabled by default.
If it is disabled and the current video is live stream,the BrightcoveMediaController will disable several buttons,for example, the SeekBar and the Rewind button.
-
setShowHideTimeout
void setShowHideTimeout(int value)
Sets the animation timeout.
- Parameters:
value
- The new animation timeout, in milliseconds.
-
getBrightcoveControlBar
BrightcoveControlBar getBrightcoveControlBar()
Obtains the current control bar.
-
getBrightcoveSeekBar
BrightcoveSeekBar getBrightcoveSeekBar()
Obtains the current seek bar.
-
getSeekBarOffset
@Deprecated() int getSeekBarOffset()
Deprecated. Instead use {getSeekBarOffsetLong}
-
getSeekBarOffsetLong
long getSeekBarOffsetLong()
Gets the live fixed sliding window offset.
-
setDVRControllerEnabled
void setDVRControllerEnabled(boolean enable)
Enables or disables the DVR controller. It only applies for Live videos.
- Parameters:
enable
- true to enable
-
isDragging
boolean isDragging()
Obtains the dragging state.
-
setCuePointMarkersEnabled
void setCuePointMarkersEnabled(boolean state)
Set the enable/disable state that allows (enabled) or prevents (disabled) ad markers being set automaticallywhenever a cue point has been set.
- Parameters:
state
- The enable (true) or disable (false) state value.
-
hide
void hide()
Hides the media controls.
-
isShowing
boolean isShowing()
Determines whether or not the media controls are showing.
-
isShowControllerEnable
boolean isShowControllerEnable()
It indicates whether the hide mechanism of the ShowHideController is enable or disable.It's enabled by default.
-
isHideControllerEnable
boolean isHideControllerEnable()
It indicates whether the hide mechanism of the ShowHideController is enable or disable.It's enabled by default.
-
setShowControllerEnable
void setShowControllerEnable(boolean showControllerEnable)
The ShowHideController reacts to several events which causes the Media Controller to show.This methods allows you to enable or disable the hide functionality.It's enabled by default.
- Parameters:
showControllerEnable
- true to enable.
-
setHideControllerEnable
void setHideControllerEnable(boolean hideControllerEnable)
The ShowHideController reacts to several events which causes the Media Controller to hide.This methods allows you to enable or disable the hide functionality.It's enabled by default.
- Parameters:
hideControllerEnable
- true to enable.
-
setShowHideAnimationStyle
void setShowHideAnimationStyle(BrightcoveMediaController.AnimationStyle value)
Sets the animation style.
- Parameters:
value
- The new animation style.
-
show
void show()
Shows the media controls.
-
disableSeeking
void disableSeeking(boolean disable)
Disables or enables the BrightcoveControlBar of allowing seeking
- Parameters:
disable
- - Set this to true to disable seeking
-
checkTvMode
@Deprecated() static boolean checkTvMode(Context context)
-
requestFocusPlayButtonTV
void requestFocusPlayButtonTV()
Request focus for the play button if videoView is in TV mode
-
dispatchKeyEvent
boolean dispatchKeyEvent(KeyEvent event)
Dispatch the key event. This method has to be called from a Android View, overriding theit's dispatchKeyEven method.
When a MediaControllerKeyDispatcher has been set through the MediaControllerConfig,its dispatchKeyEvent will be called.When either the MediaControllerKeyDispatcher is not set or when dispatchKeyEvent returns false, the default dispatch key event implementation will be used.
- Parameters:
event
- the android.View.
-
removeListeners
void removeListeners()
Removes all set listeners from the EventEmitter.
-
getBrightcoveSeekbarController
BrightcoveSeekBarController getBrightcoveSeekbarController()
-
-
-
-