-
- All Implemented Interfaces:
-
android.graphics.drawable.Drawable.Callback,android.view.KeyEvent.Callback,android.view.ViewManager,android.view.ViewParent,android.view.accessibility.AccessibilityEventSource,com.getstream.sdk.chat.utils.exomedia.ui.widget.VideoControlsCore
public abstract class VideoControls extends RelativeLayout implements VideoControlsCore
This is a simple abstraction for the VideoView to have a single "View" to add or remove for the Default Video Controls.
-
-
Field Summary
Fields Modifier and Type Field Description public final static intDEFAULT_CONTROL_HIDE_DELAYprotected VideoViewvideoViewprotected VideoControlsSeekListenerseekListenerprotected VideoControlsVisibilityListenervisibilityListenerprotected longhideDelayprotected booleanisVisibleprotected booleanhideEmptyTextContainer
-
Constructor Summary
Constructors Constructor Description VideoControls(Context context)VideoControls(Context context, AttributeSet attrs)VideoControls(Context context, AttributeSet attrs, int defStyleAttr)VideoControls(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
-
Method Summary
Modifier and Type Method Description abstract voidsetPosition(long position)Sets the current video position, updating the seek bar and the current time field abstract voidupdateProgress(long position, long duration, int bufferPercent)Performs the progress update on the current time field, and the seek bar voidonAttachedToView(VideoView videoView)Called when the controls have been registered by the VideoView. voidonDetachedFromView(VideoView videoView)Called when the controls have been cleaned up on the VideoView side in preparation for detachment. voidsetButtonListener(VideoControlsButtonListener callback)Specifies the callback to inform of button click events voidupdatePlaybackState(boolean isPlaying)Informs the controls that the playback state has changed. voidsetTitle(CharSequence title)Sets the title to display for the current item in playback voidsetSubTitle(CharSequence subTitle)Sets the subtitle to display for the current item in playback. voidsetDescription(CharSequence description)voidsetPlayPauseDrawables(Drawable playDrawable, Drawable pauseDrawable)Sets the drawables to use for the PlayPause button voidsetPreviousDrawable(Drawable drawable)Sets the drawable for the previous button voidsetNextDrawable(Drawable drawable)Sets the drawable for the next button voidsetRewindDrawable(Drawable drawable)Sets the drawable for the rewind button voidsetFastForwardDrawable(Drawable drawable)Sets the drawable for the Fast button voidupdatePlayPauseImage(boolean isPlaying)Makes sure the playPause button represents the correct playback state voidsetPreviousButtonEnabled(boolean enabled)Sets the button state for the Previous button. voidsetNextButtonEnabled(boolean enabled)Sets the button state for the Next button. voidsetRewindButtonEnabled(boolean enabled)Sets the button state for the Rewind button. voidsetFastForwardButtonEnabled(boolean enabled)Sets the button state for the Fast Forward button. voidsetPreviousButtonRemoved(boolean removed)Adds or removes the Previous button. voidsetNextButtonRemoved(boolean removed)Adds or removes the Next button. voidsetRewindButtonRemoved(boolean removed)Adds or removes the Rewind button. voidsetFastForwardButtonRemoved(boolean removed)Adds or removes the FastForward button. voidaddExtraView(View view)voidremoveExtraView(View view)List<View>getExtraViews()voidshow()Immediately starts the animation to show the controls voidhide(boolean delayed)Hides the controls immediately if delayedis false otherwise a delay determined by the implementation will be used before the controls are hidden.voidhide()Immediately starts the animation to hide the controls voidhideDelayed()After the specified delay the view will be hidden. voidhideDelayed(long delay)After the specified delay the view will be hidden. voidsetCanHide(boolean canHide)Sets weather this control can be hidden. booleanisVisible()Returns trueif the VideoControls are visiblevoidsetVideoView(VideoView VideoView)Sets the parent view to use for determining playback length, position, state, etc. voidsetSeekListener(VideoControlsSeekListener callbacks)Sets the callbacks to inform of progress seek events voidsetVisibilityListener(VideoControlsVisibilityListener callbacks)Sets the callbacks to inform of visibility changes voidsetHideDelay(long delay)Sets the delay to use when hiding the controls via the hideDelayed method. voidsetHideEmptyTextContainer(boolean hide)Sets weather the text block and associated container will be hidden when no content is specified. -
Methods inherited from class android.widget.RelativeLayout
checkLayoutParams, generateDefaultLayoutParams, generateLayoutParams, getAccessibilityClassName, getBaseline, getGravity, getIgnoreGravity, onLayout, onMeasure, requestLayout, setGravity, setHorizontalGravity, setIgnoreGravity, setVerticalGravity, shouldDelayChildPressedState -
Methods inherited from class android.view.ViewGroup
addChildrenForAccessibility, addFocusables, addKeyboardNavigationClusters, addStatesFromChildren, addTouchables, addView, addViewInLayout, attachLayoutAnimationParameters, attachViewToParent, bringChildToFront, canAnimate, childDrawableStateChanged, childHasTransientStateChanged, cleanupLayoutState, clearChildFocus, clearDisappearingChildren, clearFocus, debug, detachAllViewsFromParent, detachViewFromParent, detachViewsFromParent, dispatchApplyWindowInsets, dispatchCapturedPointerEvent, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchDraw, dispatchDrawableHotspotChanged, dispatchFinishTemporaryDetach, dispatchFreezeSelfOnly, dispatchGenericFocusedEvent, dispatchGenericPointerEvent, dispatchHoverEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPointerCaptureChanged, dispatchProvideAutofillStructure, dispatchProvideStructure, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchStartTemporaryDetach, dispatchSystemUiVisibilityChanged, dispatchThawSelfOnly, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, drawChild, drawableStateChanged, endViewTransition, findFocus, findViewsWithText, focusSearch, focusableViewAvailable, gatherTransparentRegion, getChildAt, getChildCount, getChildDrawingOrder, getChildMeasureSpec, getChildStaticTransformation, getChildVisibleRect, getClipChildren, getClipToPadding, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getLayoutMode, getLayoutTransition, getNestedScrollAxes, getOverlay, getPersistentDrawingCache, getTouchscreenBlocksFocus, hasFocus, hasTransientState, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isChildrenDrawingOrderEnabled, isChildrenDrawnWithCacheEnabled, isLayoutSuppressed, isMotionEventSplittingEnabled, isTransitionGroup, jumpDrawablesToCurrentState, layout, measureChild, measureChildWithMargins, measureChildren, notifySubtreeAccessibilityStateChanged, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onAttachedToWindow, onCreateDrawableState, onDescendantInvalidated, onDetachedFromWindow, onInterceptHoverEvent, onInterceptTouchEvent, onNestedFling, onNestedPreFling, onNestedPrePerformAccessibilityAction, onNestedPreScroll, onNestedScroll, onNestedScrollAccepted, onRequestFocusInDescendants, onRequestSendAccessibilityEvent, onResolvePointerIcon, onStartNestedScroll, onStopNestedScroll, onViewAdded, onViewRemoved, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeDetachedView, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestChildRectangleOnScreen, requestDisallowInterceptTouchEvent, requestFocus, requestSendAccessibilityEvent, requestTransparentRegion, restoreDefaultFocus, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setChildrenDrawingCacheEnabled, setChildrenDrawingOrderEnabled, setChildrenDrawnWithCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setLayoutMode, setLayoutTransition, setMotionEventSplittingEnabled, setOnHierarchyChangeListener, setPersistentDrawingCache, setStaticTransformationsEnabled, setTouchscreenBlocksFocus, setTransitionGroup, showContextMenuForChild, startActionModeForChild, startLayoutAnimation, startViewTransition, suppressLayout, updateViewLayout -
Methods inherited from class android.view.View
addExtraDataToAccessibilityNodeInfo, addOnAttachStateChangeListener, addOnLayoutChangeListener, addOnUnhandledKeyEventListener, animate, announceForAccessibility, autofill, awakenScrollBars, bringToFront, buildDrawingCache, buildLayer, callOnClick, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, cancelDragAndDrop, cancelLongPress, cancelPendingInputEvents, checkInputConnectionProxy, clearAnimation, combineMeasuredStates, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeScroll, computeSystemWindowInsets, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchGenericMotionEvent, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPrePerformAccessibilityAction, dispatchNestedPreScroll, dispatchNestedScroll, dispatchPopulateAccessibilityEvent, draw, drawableHotspotChanged, findViewById, findViewWithTag, fitSystemWindows, forceHasOverlappingRendering, forceLayout, generateViewId, getAccessibilityDelegate, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAccessibilityPaneTitle, getAccessibilityTraversalAfter, getAccessibilityTraversalBefore, getAlpha, getAnimation, getAnimationMatrix, getApplicationWindowToken, getAttributeResolutionStack, getAttributeSourceResourceMap, getAutofillHints, getAutofillId, getAutofillType, getAutofillValue, getBackground, getBackgroundTintBlendMode, getBackgroundTintList, getBackgroundTintMode, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getCameraDistance, getClipBounds, getClipBounds, getClipToOutline, getContentCaptureSession, getContentDescription, getContext, getContextMenuInfo, getDefaultFocusHighlightEnabled, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getElevation, getExplicitStyle, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusable, getFocusables, getFocusedRect, getForeground, getForegroundGravity, getForegroundTintBlendMode, getForegroundTintList, getForegroundTintMode, getGlobalVisibleRect, getHandler, getHasOverlappingRendering, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getHorizontalScrollbarThumbDrawable, getHorizontalScrollbarTrackDrawable, getId, getImportantForAccessibility, getImportantForAutofill, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLocalVisibleRect, getLocationInSurface, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextClusterForwardId, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOutlineAmbientShadowColor, getOutlineProvider, getOutlineSpotShadowColor, getOverScrollMode, getOverlay, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getPointerIcon, getResources, getRevealOnFocusHint, getRight, getRightFadingEdgeStrength, getRightPaddingOffset, getRootView, getRootWindowInsets, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollIndicators, getScrollX, getScrollY, getSolidColor, getSourceLayoutResId, getStateListAnimator, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getSystemGestureExclusionRects, getSystemUiVisibility, getTag, getTextAlignment, getTextDirection, getTooltipText, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchDelegate, getTouchables, getTransitionAlpha, getTransitionName, getTranslationX, getTranslationY, getTranslationZ, getUniqueDrawingId, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarThumbDrawable, getVerticalScrollbarTrackDrawable, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowId, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, getZ, hasExplicitFocusable, hasFocusable, hasNestedScrollingParent, hasOnClickListeners, hasOverlappingRendering, hasPointerCapture, hasWindowFocus, inflate, invalidate, invalidateDrawable, invalidateOutline, isAccessibilityFocused, isAccessibilityHeading, isActivated, isAttachedToWindow, isClickable, isContextClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isFocusedByDefault, isForceDarkAllowed, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isImportantForAccessibility, isImportantForAutofill, isInEditMode, isInLayout, isInTouchMode, isKeyboardNavigationCluster, isLaidOut, isLayoutDirectionResolved, isLayoutRequested, isLongClickable, isNestedScrollingEnabled, isOpaque, isPaddingOffsetRequired, isPaddingRelative, isPivotSet, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScreenReaderFocusable, isScrollContainer, isScrollbarFadingEnabled, isSelected, isShown, isSoundEffectsEnabled, isTemporarilyDetached, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, isVisibleToUserForAutofill, keyboardNavigationClusterSearch, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAnimationEnd, onAnimationStart, onApplyWindowInsets, onCancelPendingInputEvents, onCapturedPointerEvent, onCheckIsTextEditor, onConfigurationChanged, onCreateContextMenu, onCreateInputConnection, onDisplayHint, onDragEvent, onDraw, onDrawForeground, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onGenericMotionEvent, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onOverScrolled, onPointerCaptureChange, onPopulateAccessibilityEvent, onProvideAutofillStructure, onProvideAutofillVirtualStructure, onProvideStructure, onProvideVirtualStructure, onRestoreInstanceState, onRtlPropertiesChanged, onSaveInstanceState, onScreenStateChanged, onScrollChanged, onSetAlpha, onSizeChanged, onStartTemporaryDetach, onTouchEvent, onTrackballEvent, onVisibilityAggregated, onVisibilityChanged, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, overScrollBy, performAccessibilityAction, performClick, performContextClick, performHapticFeedback, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidateDelayed, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, releasePointerCapture, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, removeOnUnhandledKeyEventListener, requestApplyInsets, requestFitSystemWindows, requestFocusFromTouch, requestPointerCapture, requestRectangleOnScreen, requestUnbufferedDispatch, requireViewById, resetPivot, resolveSize, resolveSizeAndState, restoreHierarchyState, saveAttributeDataForStyleable, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setAccessibilityHeading, setAccessibilityLiveRegion, setAccessibilityPaneTitle, setAccessibilityTraversalAfter, setAccessibilityTraversalBefore, setActivated, setAlpha, setAnimation, setAnimationMatrix, setAutofillHints, setAutofillId, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBackgroundTintBlendMode, setBackgroundTintList, setBackgroundTintMode, setBottom, setCameraDistance, setClickable, setClipBounds, setClipToOutline, setContentCaptureSession, setContentDescription, setContextClickable, setDefaultFocusHighlightEnabled, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setElevation, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusableInTouchMode, setFocusedByDefault, setForceDarkAllowed, setForeground, setForegroundGravity, setForegroundTintBlendMode, setForegroundTintList, setForegroundTintMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHorizontalScrollbarThumbDrawable, setHorizontalScrollbarTrackDrawable, setHovered, setId, setImportantForAccessibility, setImportantForAutofill, setKeepScreenOn, setKeyboardNavigationCluster, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLeftTopRightBottom, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNestedScrollingEnabled, setNextClusterForwardId, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnCapturedPointerListener, setOnClickListener, setOnContextClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnScrollChangeListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOutlineAmbientShadowColor, setOutlineProvider, setOutlineSpotShadowColor, setOverScrollMode, setPadding, setPaddingRelative, setPivotX, setPivotY, setPointerIcon, setPressed, setRevealOnFocusHint, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScreenReaderFocusable, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollIndicators, setScrollX, setScrollY, setScrollbarFadingEnabled, setSelected, setSoundEffectsEnabled, setStateListAnimator, setSystemGestureExclusionRects, setSystemUiVisibility, setTag, setTextAlignment, setTextDirection, setTooltipText, setTop, setTouchDelegate, setTransitionAlpha, setTransitionName, setTransitionVisibility, setTranslationX, setTranslationY, setTranslationZ, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVerticalScrollbarThumbDrawable, setVerticalScrollbarTrackDrawable, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, setZ, showContextMenu, startActionMode, startAnimation, startDrag, startDragAndDrop, startNestedScroll, stopNestedScroll, toString, transformMatrixToGlobal, transformMatrixToLocal, unscheduleDrawable, updateDragShadow, verifyDrawable, willNotCacheDrawing, willNotDraw -
Methods inherited from class com.getstream.sdk.chat.utils.exomedia.ui.widget.VideoControlsCore
finishLoading, setDuration, showLoading -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
VideoControls
VideoControls(Context context)
-
VideoControls
VideoControls(Context context, AttributeSet attrs)
-
VideoControls
VideoControls(Context context, AttributeSet attrs, int defStyleAttr)
-
VideoControls
VideoControls(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
-
-
Method Detail
-
setPosition
abstract void setPosition(long position)
Sets the current video position, updating the seek bar and the current time field
- Parameters:
position- The position in milliseconds
-
updateProgress
abstract void updateProgress(long position, long duration, int bufferPercent)
Performs the progress update on the current time field, and the seek bar
- Parameters:
position- The position in millisecondsduration- The duration of the video in millisecondsbufferPercent- The integer percent that is buffered [0, 100] inclusive
-
onAttachedToView
void onAttachedToView(VideoView videoView)
Called when the controls have been registered by the VideoView.
- Parameters:
videoView- The that the controls are attached to
-
onDetachedFromView
void onDetachedFromView(VideoView videoView)
Called when the controls have been cleaned up on the VideoView side in preparation for detachment.
- Parameters:
videoView- The that the controls are detaching from
-
setButtonListener
void setButtonListener(VideoControlsButtonListener callback)
Specifies the callback to inform of button click events
- Parameters:
callback- The callback
-
updatePlaybackState
void updatePlaybackState(boolean isPlaying)
Informs the controls that the playback state has changed. This will update to display the correct views, and manage progress polling.
- Parameters:
isPlaying- True if the media is currently playing
-
setTitle
void setTitle(CharSequence title)
Sets the title to display for the current item in playback
- Parameters:
title- The title to display
-
setSubTitle
void setSubTitle(CharSequence subTitle)
Sets the subtitle to display for the current item in playback. This will be displayed as the second line of text
- Parameters:
subTitle- The sub title to display
-
setDescription
void setDescription(CharSequence description)
-
setPlayPauseDrawables
void setPlayPauseDrawables(Drawable playDrawable, Drawable pauseDrawable)
Sets the drawables to use for the PlayPause button
- Parameters:
playDrawable- The drawable to represent playpauseDrawable- The drawable to represent pause
-
setPreviousDrawable
void setPreviousDrawable(Drawable drawable)
Sets the drawable for the previous button
- Parameters:
drawable- The drawable to use
-
setNextDrawable
void setNextDrawable(Drawable drawable)
Sets the drawable for the next button
- Parameters:
drawable- The drawable to use
-
setRewindDrawable
void setRewindDrawable(Drawable drawable)
Sets the drawable for the rewind button
- Parameters:
drawable- The drawable to use
-
setFastForwardDrawable
void setFastForwardDrawable(Drawable drawable)
Sets the drawable for the Fast button
- Parameters:
drawable- The drawable to use
-
updatePlayPauseImage
void updatePlayPauseImage(boolean isPlaying)
Makes sure the playPause button represents the correct playback state
- Parameters:
isPlaying- If the video is currently playing
-
setPreviousButtonEnabled
void setPreviousButtonEnabled(boolean enabled)
Sets the button state for the Previous button. This will just change the images specified with setPreviousDrawable, or use the defaults if they haven't been set, and block any click events.
This method will NOT re-add buttons that have previously been removed with setNextButtonRemoved.
- Parameters:
enabled- If the Previous button is enabled [default: false]
-
setNextButtonEnabled
void setNextButtonEnabled(boolean enabled)
Sets the button state for the Next button. This will just change the images specified with setNextDrawable, or use the defaults if they haven't been set, and block any click events.
This method will NOT re-add buttons that have previously been removed with setPreviousButtonRemoved.
- Parameters:
enabled- If the Next button is enabled [default: false]
-
setRewindButtonEnabled
void setRewindButtonEnabled(boolean enabled)
Sets the button state for the Rewind button. This will just change the images specified with setRewindDrawable, or use the defaults if they haven't been set
This method will NOT re-add buttons that have previously been removed with setRewindButtonRemoved.
- Parameters:
enabled- If the Rewind button is enabled [default: false]
-
setFastForwardButtonEnabled
void setFastForwardButtonEnabled(boolean enabled)
Sets the button state for the Fast Forward button. This will just change the images specified with setFastForwardDrawable, or use the defaults if they haven't been set
This method will NOT re-add buttons that have previously been removed with setFastForwardButtonRemoved.
- Parameters:
enabled- If the Rewind button is enabled [default: false]
-
setPreviousButtonRemoved
void setPreviousButtonRemoved(boolean removed)
Adds or removes the Previous button. This will change the visibility of the button, if you want to change the enabled/disabled images see setPreviousButtonEnabled
- Parameters:
removed- If the Previous button should be removed [default: true]
-
setNextButtonRemoved
void setNextButtonRemoved(boolean removed)
Adds or removes the Next button. This will change the visibility of the button, if you want to change the enabled/disabled images see setNextButtonEnabled
- Parameters:
removed- If the Next button should be removed [default: true]
-
setRewindButtonRemoved
void setRewindButtonRemoved(boolean removed)
Adds or removes the Rewind button. This will change the visibility of the button, if you want to change the enabled/disabled images see setRewindButtonEnabled
- Parameters:
removed- If the Rewind button should be removed [default: true]
-
setFastForwardButtonRemoved
void setFastForwardButtonRemoved(boolean removed)
Adds or removes the FastForward button. This will change the visibility of the button, if you want to change the enabled/disabled images see setFastForwardButtonEnabled
- Parameters:
removed- If the FastForward button should be removed [default: true]
-
addExtraView
void addExtraView(View view)
-
removeExtraView
void removeExtraView(View view)
-
getExtraViews
@NonNull() List<View> getExtraViews()
-
show
void show()
Immediately starts the animation to show the controls
-
hide
void hide(boolean delayed)
Hides the controls immediately if
delayedis false otherwise a delay determined by the implementation will be used before the controls are hidden. If the user is interacting with the controls then we wait until after they are done to start the delay.
-
hide
void hide()
Immediately starts the animation to hide the controls
-
hideDelayed
void hideDelayed()
After the specified delay the view will be hidden. If the user is interacting with the controls then we wait until after they are done to start the delay.
-
hideDelayed
void hideDelayed(long delay)
After the specified delay the view will be hidden. If the user is interacting with the controls then we wait until after they are done to start the delay.
- Parameters:
delay- The delay in milliseconds to wait to start the hide animation
-
setCanHide
void setCanHide(boolean canHide)
Sets weather this control can be hidden.
- Parameters:
canHide- If this control can be hidden [default: true]
-
isVisible
boolean isVisible()
Returns
trueif the VideoControls are visible
-
setVideoView
@Deprecated() void setVideoView(VideoView VideoView)
Sets the parent view to use for determining playback length, position, state, etc. This should only be called once, during the setup process
- Parameters:
VideoView- The Parent view to these controls
-
setSeekListener
void setSeekListener(VideoControlsSeekListener callbacks)
Sets the callbacks to inform of progress seek events
- Parameters:
callbacks- The callbacks to inform
-
setVisibilityListener
void setVisibilityListener(VideoControlsVisibilityListener callbacks)
Sets the callbacks to inform of visibility changes
- Parameters:
callbacks- The callbacks to inform
-
setHideDelay
void setHideDelay(long delay)
Sets the delay to use when hiding the controls via the hideDelayed method. This value will be overridden if hideDelayed is called.
- Parameters:
delay- The delay in milliseconds to wait to start the hide animation
-
setHideEmptyTextContainer
void setHideEmptyTextContainer(boolean hide)
Sets weather the text block and associated container will be hidden when no content is specified.
- Parameters:
hide- If the empty text blocks can be hidden [default: true]
-
-
-
-