-
- All Implemented Interfaces:
-
com.brightcove.player.accessibility.AccessibilityListener
,com.brightcove.player.event.Component
,com.brightcove.player.mediacontroller.buttons.ButtonController
,com.brightcove.player.mediacontroller.buttons.RemoteControlKeyState
public abstract class AbstractButtonController extends AbstractComponent implements ButtonController, RemoteControlKeyState
Provides a class for customers which consists of basic ButtonController method implementations to simplify adding customized media controls.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public @interface
AbstractButtonController.Visibility
-
Field Summary
Fields Modifier and Type Field Description public final static int
DEFAULT_AUDIO_TRACKS_BUTTON_ID
public final static int
DEFAULT_CAPTIONS_BUTTON_ID
public final static int
DEFAULT_FAST_FORWARD_BUTTON_ID
public final static int
DEFAULT_FULL_SCREEN_BUTTON_ID
public final static int
DEFAULT_LIVE_BUTTON_ID
public final static int
DEFAULT_PLAY_BUTTON_ID
public final static int
DEFAULT_REWIND_BUTTON_ID
public final static int
DEFAULT_SEEK_BUTTON_ID
protected final Map<String, Object>
properties
protected final List<ButtonState>
stateList
private Button
button
private final int
id
private final Typeface
font
-
Constructor Summary
Constructors Constructor Description AbstractButtonController(Context context, BaseVideoView videoView, View controlBar, int id, Typeface font)
Builds a complete controller.
-
Method Summary
Modifier and Type Method Description Map<String, Object>
getProperties()
Implements a default behavior to get the current properties without any additional processing. List<ButtonState>
getStateList()
Gets the button state list providing information about the states associated with a button face. Button
getButton()
Implements a getter for the button. int
getId()
Typeface
getFont()
Gets the button font. void
setVisibility(int visibility)
Sets the button visibility. EventEmitter
getEventEmitter()
Implements a getter for the SDK event emitter. int
getVisibilityState()
Gets the maintained visibility state for a button. void
syncStates()
Implements to update a state (toggle) button to display the correct glyph andcontent description for the current managed state value. boolean
onSkipBackward(KeyEvent event)
On skip backward key actioned boolean
onSkipForward(KeyEvent event)
On skip forward key actioned boolean
onHome(KeyEvent event)
On home key actioned boolean
onMenu(KeyEvent event)
On menu key actioned boolean
onBack(KeyEvent event)
On back key actioned boolean
onRewind(KeyEvent event)
On rewind key actioned boolean
onFastForward(KeyEvent event)
On fast forward key actioned boolean
onPlayPause(KeyEvent event)
On play pause key actioned boolean
onPause(KeyEvent event)
On pause key actioned boolean
onPlay(KeyEvent event)
On play key actioned boolean
onDpadCenter(KeyEvent event)
On dpad center key actioned boolean
onDpadRight(KeyEvent event)
On dpad right key actioned boolean
onDpadLeft(KeyEvent event)
On dpad left key actioned boolean
onDpadDown(KeyEvent event)
On dpad down key actioned boolean
onDpadUp(KeyEvent event)
On dpad up key actioned void
onAccessibilityStateChanged(boolean enabled)
Called back on change in the accessibility state. -
Methods inherited from class com.brightcove.player.event.AbstractComponent
addListener, addOnceListener, removeListener, removeListeners
-
Methods inherited from class com.brightcove.player.mediacontroller.buttons.ButtonController
getManagedState
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
AbstractButtonController
AbstractButtonController(Context context, BaseVideoView videoView, View controlBar, int id, Typeface font)
Builds a complete controller.- Parameters:
context
- The given Android application context.videoView
- The SDK video view used, possibly, to determine managed state asssociated with the button.controlBar
- The layout widget to which the button will be added.id
- The Android resource identifier for the button being controlled.
-
-
Method Detail
-
getProperties
Map<String, Object> getProperties()
Implements a default behavior to get the current properties without any additional processing. Subclasses shouldoverride to tailor the properties emitted on a button click.
-
getStateList
List<ButtonState> getStateList()
Gets the button state list providing information about the states associated with a button face.
-
getId
int getId()
-
setVisibility
void setVisibility(int visibility)
Sets the button visibility.
-
getEventEmitter
EventEmitter getEventEmitter()
Implements a getter for the SDK event emitter.
-
getVisibilityState
int getVisibilityState()
Gets the maintained visibility state for a button. Defaults to View.VISIBLE but can be overridden based onevents. An example is the caption button.
-
syncStates
void syncStates()
Implements to update a state (toggle) button to display the correct glyph andcontent description for the current managed state value.
-
onSkipBackward
boolean onSkipBackward(KeyEvent event)
On skip backward key actioned
- Parameters:
event
- the android.view.
-
onSkipForward
boolean onSkipForward(KeyEvent event)
On skip forward key actioned
- Parameters:
event
- the android.view.
-
onRewind
boolean onRewind(KeyEvent event)
On rewind key actioned
- Parameters:
event
- the android.view.
-
onFastForward
boolean onFastForward(KeyEvent event)
On fast forward key actioned
- Parameters:
event
- the android.view.
-
onPlayPause
boolean onPlayPause(KeyEvent event)
On play pause key actioned
- Parameters:
event
- the android.view.
-
onDpadCenter
boolean onDpadCenter(KeyEvent event)
On dpad center key actioned
- Parameters:
event
- the android.view.
-
onDpadRight
boolean onDpadRight(KeyEvent event)
On dpad right key actioned
- Parameters:
event
- the android.view.
-
onDpadLeft
boolean onDpadLeft(KeyEvent event)
On dpad left key actioned
- Parameters:
event
- the android.view.
-
onDpadDown
boolean onDpadDown(KeyEvent event)
On dpad down key actioned
- Parameters:
event
- the android.view.
-
onDpadUp
boolean onDpadUp(KeyEvent event)
On dpad up key actioned
- Parameters:
event
- the android.view.
-
onAccessibilityStateChanged
void onAccessibilityStateChanged(boolean enabled)
Called back on change in the accessibility state.
- Parameters:
enabled
- Whether accessibility is enabled.
-
-
-
-