public abstract class SeekButtonController extends AbstractButtonController
computeTargetSeekPosition(int, int)
and the getDidSeekHandler()
Modifier and Type | Class and Description |
---|---|
protected class |
SeekButtonController.HideSeekControlsHandler
Provides a handler for hiding the rewind button.
|
protected class |
SeekButtonController.OnHoldHandler
Android Handler used to send
EventType.SEEKBAR_DRAGGING_PROGRESS event when any of the Seek button is kept held,
and EventType.SEEKBAR_DRAGGING_STOP event when the Seek button was released. |
protected class |
SeekButtonController.SeekConfigurationHandler
Provides a handler for configuring the SeekButtonController with custom values,
which listen for
EventType.SEEK_CONTROLLER_CONFIGURATION event. |
protected class |
SeekButtonController.SeekHandler
Provides a handler for dealing with a rewind operation, before the fact.
|
protected class |
SeekButtonController.SeekOffsetHandler
Provides a handler for calculating the seekDefault offset based on the length of the video
and the seekPercentage
|
protected class |
SeekButtonController.ShowSeekControlsHandler
Provides a handler for hiding the rewind button.
|
AbstractButtonController.Visibility
Modifier and Type | Field and Description |
---|---|
protected static int |
DEFAULT_ON_HOLD_START_TIME |
protected static int |
DEFAULT_ON_HOLD_UPDATE_FREQUENCY |
protected static int |
DEFAULT_SEEK_PERCENTAGE |
protected static int |
LIVE_OFFSET |
protected SeekButtonController.OnHoldHandler |
onHoldHandler
Instance handler that reacts to control key inputs.
|
protected int |
onHoldUpdateFrequency
The time in milliseconds, used to send the
EventType.SEEKBAR_DRAGGING_PROGRESS event to update the Media Controller seek bar. |
protected int |
onHoldWaitTime
The time in milliseconds to be waited, for the key event to be considered a long press instead of a regular press.
|
protected int |
seekDefault
The default amount of time (milliseconds) the seek button will skip.
|
protected int |
seekPercentage
The percentage number used to calculate the seekDefault based on the video duration.
|
protected boolean |
seekRelativeEnabled
If enabled, the
seekDefault will be set relative to the video duration
and the seekPercentage . |
protected int |
seekStartPosition
The start playhead position for the last seek operation.
|
protected int |
seekTargetPosition
The target playhead position for the last seek operation.
|
DEFAULT_AUDIO_TRACKS_BUTTON_ID, DEFAULT_CAPTIONS_BUTTON_ID, DEFAULT_FAST_FORWARD_BUTTON_ID, DEFAULT_FULL_SCREEN_BUTTON_ID, DEFAULT_LIVE_BUTTON_ID, DEFAULT_PLAY_BUTTON_ID, DEFAULT_REWIND_BUTTON_ID, DEFAULT_SEEK_BUTTON_ID, properties, stateList, videoView
eventEmitter, listenerTokens
Constructor and Description |
---|
SeekButtonController(android.content.Context context,
BaseVideoView videoView,
android.view.View controlBar,
int id,
android.graphics.Typeface font,
java.lang.String eventType)
Builds a button controller to handle the rewind button.
|
Modifier and Type | Method and Description |
---|---|
protected abstract int |
computeTargetSeekPosition(int seekStartPosition,
int offset)
Compute the target seek position based on the seekStartPosition and an offset.
|
protected abstract EventListener |
getDidSeekHandler()
Gets the EventListener callback to trigger when the DID_SEEK_TO event is received.
|
int |
getManagedState()
Implements a getter for the managed state.
|
int |
getOnHoldUpdateFrequency()
Gets the on hold update frequency time in milliseconds, used to send the
EventType.SEEKBAR_DRAGGING_PROGRESS event
to update the Media Controller seek bar. |
int |
getOnHoldWaitTime()
Gets the on hold button wait time, which is the time in milliseconds to be waited, so that
the key event is considered a long press instead of a regular press.
|
java.util.Map<java.lang.String,java.lang.Object> |
getProperties()
Implements a getter to add the current playhead position to the payload when emitting a rewind event.
|
int |
getSeekDefault()
Gets default seek time.
|
int |
getSeekPercentage()
Gets the seek percentage relative to video duration, used to set the
seekDefault
The values are greater than 0 and lower than 100 |
int |
getVisibilityState()
Gets the current visibility state.
|
protected boolean |
handleSeekEvent(android.view.KeyEvent event) |
boolean |
isSeekRelativeEnabled()
If enabled, the
seekDefault will be set relative to the video duration
and the seekPercentage . |
boolean |
onDpadCenter(android.view.KeyEvent event)
On dpad center key actioned
|
void |
setOnHoldUpdateFrequency(int onHoldUpdateFrequency)
Sets the on hold update frequency time in milliseconds, used to send the
EventType.SEEKBAR_DRAGGING_PROGRESS event
to update the Media Controller seek bar. |
void |
setOnHoldWaitTime(int onHoldWaitTime)
Sets the on hold button wait time, which is the time in milliseconds to be waited, so that
the key event is considered a long press instead of a regular press.
|
void |
setSeekDefault(int value)
Sets the default seek time.
|
void |
setSeekPercentage(int seekPercentage)
Sets the seek percentage relative to video duration, used to set the
seekDefault
The values are greater than 0 and lower than 100 |
void |
setSeekRelativeEnabled(boolean seekRelativeEnabled)
Enable or disable relative seeking.
|
getButton, getEventEmitter, getFont, getId, getStateList, onAccessibilityStateChanged, onBack, onDpadDown, onDpadLeft, onDpadRight, onDpadUp, onFastForward, onHome, onMenu, onPause, onPlay, onPlayPause, onRewind, onSkipBackward, onSkipForward, setVisibility, syncStates
addListener, addOnceListener, removeListener, removeListeners
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
removeListeners
protected static final int LIVE_OFFSET
protected static final int DEFAULT_SEEK_PERCENTAGE
protected static final int DEFAULT_ON_HOLD_START_TIME
protected static final int DEFAULT_ON_HOLD_UPDATE_FREQUENCY
protected int seekDefault
protected int seekStartPosition
protected int seekTargetPosition
protected boolean seekRelativeEnabled
seekDefault
will be set relative to the video duration
and the seekPercentage
.
seekDefault
is calculated on EventType.VIDEO_DURATION_CHANGED
event.protected int seekPercentage
DEFAULT_SEEK_PERCENTAGE
.protected int onHoldWaitTime
DEFAULT_ON_HOLD_START_TIME
.protected int onHoldUpdateFrequency
EventType.SEEKBAR_DRAGGING_PROGRESS
event to update the Media Controller seek bar.
Default value is DEFAULT_ON_HOLD_UPDATE_FREQUENCY
.protected final SeekButtonController.OnHoldHandler onHoldHandler
public SeekButtonController(@NonNull android.content.Context context, @NonNull BaseVideoView videoView, @NonNull android.view.View controlBar, int id, @Nullable android.graphics.Typeface font, java.lang.String eventType)
context
- The Android application context.videoView
- The SDK video view object parenting the control bar.controlBar
- The button widget parent view.font
- The, possibly null, typeface for the button.public int getManagedState()
ButtonController.getManagedState()
public java.util.Map<java.lang.String,java.lang.Object> getProperties()
getProperties
in interface ButtonController
getProperties
in class AbstractButtonController
ButtonController.getProperties()
public int getVisibilityState()
getVisibilityState
in interface ButtonController
getVisibilityState
in class AbstractButtonController
ButtonController.getVisibilityState()
public int getSeekDefault()
public void setSeekDefault(int value)
value
- The number of milliseconds to seek.public boolean isSeekRelativeEnabled()
seekDefault
will be set relative to the video duration
and the seekPercentage
.
seekDefault
is calculated on EventType.VIDEO_DURATION_CHANGED
event.public void setSeekRelativeEnabled(boolean seekRelativeEnabled)
seekDefault
will be set relative to the video duration
and the seekPercentage
.
seekDefault
is calculated on EventType.VIDEO_DURATION_CHANGED
event.seekRelativeEnabled
- public int getSeekPercentage()
seekDefault
The values are greater than 0 and lower than 100public void setSeekPercentage(int seekPercentage)
seekDefault
The values are greater than 0 and lower than 100seekPercentage
- the seek percentagepublic int getOnHoldWaitTime()
public void setOnHoldWaitTime(int onHoldWaitTime)
onHoldWaitTime
- the on hold start timepublic int getOnHoldUpdateFrequency()
EventType.SEEKBAR_DRAGGING_PROGRESS
event
to update the Media Controller seek bar.public void setOnHoldUpdateFrequency(int onHoldUpdateFrequency)
EventType.SEEKBAR_DRAGGING_PROGRESS
event
to update the Media Controller seek bar.onHoldUpdateFrequency
- the time in millisecondspublic boolean onDpadCenter(android.view.KeyEvent event)
RemoteControlKeyState
onDpadCenter
in interface RemoteControlKeyState
onDpadCenter
in class AbstractButtonController
event
- the android.view.KeyEventprotected boolean handleSeekEvent(android.view.KeyEvent event)
protected abstract int computeTargetSeekPosition(int seekStartPosition, int offset)
setSeekDefault(int)
The default offset for a Live video is LIVE_OFFSET
seekStartPosition
- the seek start positionoffset
- the amount of time in milliseconds to seek.setSeekDefault(int)
protected abstract EventListener getDidSeekHandler()