Class PlayerControllerView
- All Implemented Interfaces:
Drawable.Callback
,AccessibilityEventSource
,KeyEvent.Callback
,View.OnClickListener
,ViewManager
,ViewParent
,SeekBar.OnSeekBarChangeListener
PlayerController
to show controls.
The implementation can be customized without extending the class up to a certain degree using either view parameters or methods on the instance.
The following attributes are supported through XML in your layout files:
controller_layout_id
- Specifies the id of the layout to be inflated. See below for more details.- Corresponding method:
setControllerLayoutId(int)
- Default:
R.layout.cl_player_controls_view
- Corresponding method:
skip_increase_ms
- Specifies time in milliseconds that the player should skip forward when the skip forward button is pressed- Corresponding method:
setSkipIncreaseMs(int)
- Default: 10000
- Corresponding method:
skip_increase_ms
- Specifies time in milliseconds that the player should skip backward when the skip back button is pressed- Corresponding method:
setSkipDecreaseMs(int)
- Default: 10000
- Corresponding method:
auto_hide
- Specifies if the controller should be hidden automatically.- Note that this used the
DefaultVisibilityController
. If you set a custom visibility controller, this might not apply - Default: true
- Note that this used the
toggle_visibility
- Specify if visibility should be toggled when the root view is touched multiple times.- Note that this used the
DefaultVisibilityController
. If you set a custom visibility controller, this might not apply - You need to bind a
IPlayerView
to register the touch events successfully. - Default: true
- Note that this used the
auto_hide_delay
- Specify the delay in milliseconds if auto hiding is enabled.- Note that this used the
DefaultVisibilityController
. If you set a custom visibility controller, this might not apply - Default: 5000
- Note that this used the
animation_enabled
- Specify if default hide and show animations are enabled- Note that this used the
DefaultVisibilityController
. If you set a custom visibility controller, this might not apply - Default: true
- Note that this used the
animation_duration
- Specify if default duration for hide and show animations- Note that this used the
DefaultVisibilityController
. If you set a custom visibility controller, this might not apply - Default: 200
- Note that this used the
animation_view_position
- Specify the controls position relative to the parent. Currenttop
andbottom
are supported. This defined on which direction the default animation will run.- Note that this used the
DefaultVisibilityController
. If you set a custom visibility controller, this might not apply - Default:
bottom
- Note that this used the
Overriding the default layout
The view, by default loads its corresponding layout definition fromres/layout/cl_player_controller_view.xml
.
If you create such file in you own app, this will effectively override the default layout
definition.
Alternatively, you can always use the controller_layout_id
parameter and reference
a custom layout when you add this view.
When the view initializes its components, we are looking for specific ids in the layout file. All of the components are optional, but if you want to make sure the the default behaviour is enabled, please use the corresponding ids to identify the components in you layout:
presto_play_pause_button
- The play/pause toggle button. Please note that the default implementation uses state lists on the views "selected" state to change the image icon that will be used.- Type:
View
- Type:
presto_rewind_button
- The rewind button.- Type:
View
- Type:
presto_fastforward_button
- The fast-forward button.- Type:
View
- Type:
presto_skip_back_button
- The skip backwards button- Type:
View
- Type:
presto_skip_forward_button
- The skip backwards button- Type:
View
- Type:
presto_next_button
- Select next item button- Type:
View
- Note: There is not default binding logic in place for this button and you need to register your own click listener
- Type:
presto_previous_button
- Select next item button- Type:
View
- Note: There is not default binding logic in place for this button and you need to register your own click listener
- Type:
presto_select_scale_button
- The scale selection button.- Type:
View
- Type:
presto_select_audio_button
- The audio or language selection button.- Type:
View
- Type:
presto_select_subtitle_button
- The subtitle selection button.- Type:
View
- Type:
presto_select_video_button
- The video quality selection button.- Type:
View
- Type:
presto_current_time
- Text view that shows the current playback position- Type:
TextView
- Type:
presto_total_time
- Text view that shows the total duration or the "live" indicator- Type:
TextView
- Type:
presto_playback_speed_text
- Text view that shows the playback speed when fast-forward playback is active- Type:
TextView
- Type:
presto_seek_bar
- The scrubbing seek bar- Type:
SeekBar
- Type:
Using custom layout files
Setting the controller_layout_id
attribute on a PlayerControllerView allows you to
selectively change the layout resource that will be used by this component. This can be used
for example if you do not want to overwrite the default or you need to apply a different layout
per instance.
Selection Dialogs
If you bind this view not only to aPlayerController
but also to a IPlayerView
using bind(IPlayerView)
or bind(PlayerController, IPlayerView, Playlist)
,
default track and scale selection dialogs are available. You can sub-class this view to overwrite
the dialog displays and customize the way the selection will be presented to the user. For this,
you should overwrite showAudioSelection()
, showVideoQualitySelection()
,
showSubtitleSelection()
, and showScaleSelection()
respectively.
If you would like to go with the default dialogs, you can customize the label rendering for each
of the dialog by setting a Converter
that will be used to create the textual representation
for the items that can be selected. The default dialogs use the tracks label.
Subtitle Track selection
You can usesetSubtitleTrackConverter(Converter)
to create labels for subtitle tracks.
By default, the selection dialog will use the R.string.presto_controls_subtitle_selection_dialog_title
string reference to set the Dialog title. You can use the same string ID to overwrite the
default title.
Video Track selection
You can usesetVideoTrackConverter(Converter)
to create labels for video tracks.
By default, the selection dialog will use the R.string.presto_controls_quality_selection_dialog_title
string reference to set the Dialog title. You can use the same string ID to overwrite the
default title.
Audio Track selection
You can usesetAudioTrackConverter(Converter)
to create labels for audio tracks.
By default, the selection dialog will use the R.string.presto_controls_language_selection_dialog_title
string reference to set the Dialog title. You can use the same string ID to overwrite the
default title.
Scaling Mode selection
You can usesetScalingModeConverter(Converter)
to create labels for scaling modes.
By default, the selection dialog will use the R.string.presto_controls_scaling_selection_dialog_title
string reference to set the Dialog title. You can use the same string ID to overwrite the
default title.
Visibility controls
The view exposes a defaultVisibilityController
that is used to hide the controls for
example when Advertisements are played. You can set your own controller using
setVisibilityController(VisibilityController)
. Take a look at the DefaultVisibilityController
,
it provides the ability to add touch events to toggle controls and can be used to add
simple animation to show and hide the controls view.- Since:
- 4.0.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Generic listener interface that can be used to receive specific events from this view.static interface
This interface is used to adjust the seekbar position to the thumbnail cue-points.static interface
Listener interface that can be implemented to receive callbacks when the seekbar is scrubbed.Nested classes/interfaces inherited from class android.widget.LinearLayout
LinearLayout.LayoutParams
Nested classes/interfaces inherited from class android.view.ViewGroup
ViewGroup.MarginLayoutParams, ViewGroup.OnHierarchyChangeListener
Nested classes/interfaces inherited from class android.view.View
View.AccessibilityDelegate, View.BaseSavedState, View.DragShadowBuilder, View.MeasureSpec, View.OnApplyWindowInsetsListener, View.OnAttachStateChangeListener, View.OnCapturedPointerListener, View.OnClickListener, View.OnContextClickListener, View.OnCreateContextMenuListener, View.OnDragListener, View.OnFocusChangeListener, View.OnGenericMotionListener, View.OnHoverListener, View.OnKeyListener, View.OnLayoutChangeListener, View.OnLongClickListener, View.OnScrollChangeListener, View.OnSystemUiVisibilityChangeListener, View.OnTouchListener, View.OnUnhandledKeyEventListener
-
Field Summary
Fields inherited from class android.widget.LinearLayout
HORIZONTAL, SHOW_DIVIDER_BEGINNING, SHOW_DIVIDER_END, SHOW_DIVIDER_MIDDLE, SHOW_DIVIDER_NONE, VERTICAL
Fields inherited from class android.view.ViewGroup
FOCUS_AFTER_DESCENDANTS, FOCUS_BEFORE_DESCENDANTS, FOCUS_BLOCK_DESCENDANTS, LAYOUT_MODE_CLIP_BOUNDS, LAYOUT_MODE_OPTICAL_BOUNDS, PERSISTENT_ALL_CACHES, PERSISTENT_ANIMATION_CACHE, PERSISTENT_NO_CACHE, PERSISTENT_SCROLLING_CACHE
Fields inherited from class android.view.View
ACCESSIBILITY_DATA_SENSITIVE_AUTO, ACCESSIBILITY_DATA_SENSITIVE_NO, ACCESSIBILITY_DATA_SENSITIVE_YES, ACCESSIBILITY_LIVE_REGION_ASSERTIVE, ACCESSIBILITY_LIVE_REGION_NONE, ACCESSIBILITY_LIVE_REGION_POLITE, ALPHA, AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR, AUTOFILL_HINT_CREDIT_CARD_NUMBER, AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE, AUTOFILL_HINT_EMAIL_ADDRESS, AUTOFILL_HINT_NAME, AUTOFILL_HINT_PASSWORD, AUTOFILL_HINT_PHONE, AUTOFILL_HINT_POSTAL_ADDRESS, AUTOFILL_HINT_POSTAL_CODE, AUTOFILL_HINT_USERNAME, AUTOFILL_TYPE_DATE, AUTOFILL_TYPE_LIST, AUTOFILL_TYPE_NONE, AUTOFILL_TYPE_TEXT, AUTOFILL_TYPE_TOGGLE, DRAG_FLAG_ACCESSIBILITY_ACTION, DRAG_FLAG_GLOBAL, DRAG_FLAG_GLOBAL_PERSISTABLE_URI_PERMISSION, DRAG_FLAG_GLOBAL_PREFIX_URI_PERMISSION, DRAG_FLAG_GLOBAL_URI_READ, DRAG_FLAG_GLOBAL_URI_WRITE, DRAG_FLAG_OPAQUE, DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, FIND_VIEWS_WITH_CONTENT_DESCRIPTION, FIND_VIEWS_WITH_TEXT, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLE, FOCUSABLE_AUTO, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, GONE, HAPTIC_FEEDBACK_ENABLED, IMPORTANT_FOR_ACCESSIBILITY_AUTO, IMPORTANT_FOR_ACCESSIBILITY_NO, IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS, IMPORTANT_FOR_ACCESSIBILITY_YES, IMPORTANT_FOR_AUTOFILL_AUTO, IMPORTANT_FOR_AUTOFILL_NO, IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS, IMPORTANT_FOR_AUTOFILL_YES, IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS, IMPORTANT_FOR_CONTENT_CAPTURE_AUTO, IMPORTANT_FOR_CONTENT_CAPTURE_NO, IMPORTANT_FOR_CONTENT_CAPTURE_NO_EXCLUDE_DESCENDANTS, IMPORTANT_FOR_CONTENT_CAPTURE_YES, IMPORTANT_FOR_CONTENT_CAPTURE_YES_EXCLUDE_DESCENDANTS, INVISIBLE, KEEP_SCREEN_ON, LAYER_TYPE_HARDWARE, LAYER_TYPE_NONE, LAYER_TYPE_SOFTWARE, LAYOUT_DIRECTION_INHERIT, LAYOUT_DIRECTION_LOCALE, LAYOUT_DIRECTION_LTR, LAYOUT_DIRECTION_RTL, MEASURED_HEIGHT_STATE_SHIFT, MEASURED_SIZE_MASK, MEASURED_STATE_MASK, MEASURED_STATE_TOO_SMALL, NO_ID, NOT_FOCUSABLE, OVER_SCROLL_ALWAYS, OVER_SCROLL_IF_CONTENT_SCROLLS, OVER_SCROLL_NEVER, ROTATION, ROTATION_X, ROTATION_Y, SCALE_X, SCALE_Y, SCREEN_STATE_OFF, SCREEN_STATE_ON, SCROLL_AXIS_HORIZONTAL, SCROLL_AXIS_NONE, SCROLL_AXIS_VERTICAL, SCROLL_CAPTURE_HINT_AUTO, SCROLL_CAPTURE_HINT_EXCLUDE, SCROLL_CAPTURE_HINT_EXCLUDE_DESCENDANTS, SCROLL_CAPTURE_HINT_INCLUDE, SCROLL_INDICATOR_BOTTOM, SCROLL_INDICATOR_END, SCROLL_INDICATOR_LEFT, SCROLL_INDICATOR_RIGHT, SCROLL_INDICATOR_START, SCROLL_INDICATOR_TOP, SCROLLBAR_POSITION_DEFAULT, SCROLLBAR_POSITION_LEFT, SCROLLBAR_POSITION_RIGHT, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SOUND_EFFECTS_ENABLED, STATUS_BAR_HIDDEN, STATUS_BAR_VISIBLE, SYSTEM_UI_FLAG_FULLSCREEN, SYSTEM_UI_FLAG_HIDE_NAVIGATION, SYSTEM_UI_FLAG_IMMERSIVE, SYSTEM_UI_FLAG_IMMERSIVE_STICKY, SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN, SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LAYOUT_STABLE, SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR, SYSTEM_UI_FLAG_LIGHT_STATUS_BAR, SYSTEM_UI_FLAG_LOW_PROFILE, SYSTEM_UI_FLAG_VISIBLE, SYSTEM_UI_LAYOUT_FLAGS, TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_GRAVITY, TEXT_ALIGNMENT_INHERIT, TEXT_ALIGNMENT_TEXT_END, TEXT_ALIGNMENT_TEXT_START, TEXT_ALIGNMENT_VIEW_END, TEXT_ALIGNMENT_VIEW_START, TEXT_DIRECTION_ANY_RTL, TEXT_DIRECTION_FIRST_STRONG, TEXT_DIRECTION_FIRST_STRONG_LTR, TEXT_DIRECTION_FIRST_STRONG_RTL, TEXT_DIRECTION_INHERIT, TEXT_DIRECTION_LOCALE, TEXT_DIRECTION_LTR, TEXT_DIRECTION_RTL, TRANSLATION_X, TRANSLATION_Y, TRANSLATION_Z, VISIBLE, X, Y, Z
-
Constructor Summary
ConstructorDescriptionPlayerControllerView
(Context context) PlayerControllerView
(Context context, AttributeSet attrs) PlayerControllerView
(Context context, AttributeSet attrs, int defStyleAttr) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(PlayerControllerView.Listener listener) Add a new listener.void
allowMultiTrackVideoSelection
(boolean allowMultiTrackVideoSelection) Enable or disable multi video track selection, default is disabledvoid
bind
(IPlayerView playerView) Binds the controls to the given player view and the controller that is exposed by the view.void
bind
(IPlayerView playerView, Playlist playlist) void
bind
(PlayerController playerController) Binds the controls to the given player controller.void
bind
(PlayerController playerController, IPlayerView playerView, Playlist playlist) Binds the controls view to the given player controller and the the optional player view.boolean
dispatchKeyEvent
(KeyEvent event) boolean
dispatchMediaKeyEvent
(KeyEvent event) Handles key event for the default keys implemented by this component.find
(int id) Returns the current visibility controllervoid
void
onProgressChanged
(SeekBar seekBar, int progress, boolean fromUser) void
onStartTrackingTouch
(SeekBar seekBar) void
onStopTrackingTouch
(SeekBar seekBar) void
removeListener
(PlayerControllerView.Listener listener) Remove a listener.void
setAnimateSubtitleMargins
(boolean animateSubtitleMargins) Enable or disable subtitles margins animation, default is disabledvoid
setAudioTrackConverter
(Converter<AudioTrack, String> audioTrackConverter) Set the converter that will be used to create textual representations for audio tracks.void
setControllerLayoutId
(int controllerLayoutId) Sets the layout resource and re-initializes the view with that layout resource.void
setEnabled
(boolean enabled) void
setPositionAdjuster
(PlayerControllerView.PositionAdjuster positionAdjuster) Sets the position adjuster, could also be null.void
setScalingModeConverter
(Converter<Integer, String> scalingModeConverter) Set the converter that will be used to create textual representation of scaling modes.void
setSeekBarListener
(PlayerControllerView.SeekBarListener seekBarListener) Set the seek bar listener that can be used to receive callbacks when the user interacts with the seekbar.void
setSkipDecreaseMs
(int decreaseMs) ASet the amount of time in milliseconds that the player should skip backward when the skip back button is pressed.void
setSkipIncreaseMs
(int increaseMs) Set the amount of time in milliseconds that player should skip forward when the skip forward button is pressed.void
setSubtitleTrackConverter
(Converter<SubtitleTrack, String> subtitleTrackConverter) Set the converter that will be used to create textual representations for subtitle tracks.void
setTranslationY
(float translationY) void
setVideoTrackAndQualityConverter
(Converter<VideoTrackAndQuality, String> videoTrackAndQualityConverter) Set the converter that will be used to create textual representations for video and quality tracks.void
setVideoTrackConverter
(Converter<VideoTrackQuality, String> videoTrackConverter) Set the converter that will be used to create textual representations for video tracks.void
setVisibility
(int visibility) void
setVisibilityController
(VisibilityController visibilityController) Set the visibility controller that will be used to show or hide this control view.void
void
showControlsAndFocus
(boolean userInteraction) Shows player controls.void
showExtendedTrackInfo
(boolean showExtendedTrackInfo) If the default convert are used for selection dialogs, this can be enabled to render additional track information such as bitrate information or codec information into the track label.void
void
void
void
unbind()
Unbinds the controls and the view from this controller and resets all attached listeners.Methods inherited from class android.widget.LinearLayout
generateLayoutParams, getAccessibilityClassName, getBaseline, getBaselineAlignedChildIndex, getDividerDrawable, getDividerPadding, getGravity, getOrientation, getShowDividers, getWeightSum, isBaselineAligned, isMeasureWithLargestChildEnabled, onRtlPropertiesChanged, setBaselineAligned, setBaselineAlignedChildIndex, setDividerDrawable, setDividerPadding, setGravity, setHorizontalGravity, setMeasureWithLargestChildEnabled, setOrientation, setShowDividers, setVerticalGravity, setWeightSum, shouldDelayChildPressedState
Methods inherited from class android.view.ViewGroup
addChildrenForAccessibility, addExtraDataToAccessibilityNodeInfo, addFocusables, addKeyboardNavigationClusters, addStatesFromChildren, addTouchables, addView, addView, addView, addView, addView, bringChildToFront, childDrawableStateChanged, childHasTransientStateChanged, clearChildFocus, clearDisappearingChildren, clearFocus, dispatchApplyWindowInsets, dispatchCapturedPointerEvent, dispatchConfigurationChanged, dispatchCreateViewTranslationRequest, dispatchDisplayHint, dispatchDragEvent, dispatchDrawableHotspotChanged, dispatchFinishTemporaryDetach, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPointerCaptureChanged, dispatchProvideAutofillStructure, dispatchProvideStructure, dispatchScrollCaptureSearch, dispatchSetActivated, dispatchSetSelected, dispatchStartTemporaryDetach, dispatchSystemUiVisibilityChanged, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchWindowFocusChanged, dispatchWindowInsetsAnimationEnd, dispatchWindowInsetsAnimationPrepare, dispatchWindowInsetsAnimationProgress, dispatchWindowInsetsAnimationStart, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, endViewTransition, findFocus, findOnBackInvokedDispatcherForChild, findViewsWithText, focusableViewAvailable, focusSearch, gatherTransparentRegion, getChildAt, getChildCount, getChildDrawingOrder, getChildMeasureSpec, getChildVisibleRect, getClipChildren, getClipToPadding, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getLayoutMode, getLayoutTransition, getNestedScrollAxes, getOverlay, getPersistentDrawingCache, getTouchscreenBlocksFocus, hasFocus, hasTransientState, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isLayoutSuppressed, isMotionEventSplittingEnabled, isTransitionGroup, jumpDrawablesToCurrentState, layout, notifySubtreeAccessibilityStateChanged, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onDescendantInvalidated, onInterceptHoverEvent, onInterceptTouchEvent, onNestedFling, onNestedPreFling, onNestedPrePerformAccessibilityAction, onNestedPreScroll, onNestedScroll, onNestedScrollAccepted, onRequestSendAccessibilityEvent, onResolvePointerIcon, onStartNestedScroll, onStopNestedScroll, onViewAdded, onViewRemoved, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestChildRectangleOnScreen, requestDisallowInterceptTouchEvent, requestFocus, requestSendAccessibilityEvent, requestTransparentRegion, restoreDefaultFocus, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setLayoutMode, setLayoutTransition, setMotionEventSplittingEnabled, setOnHierarchyChangeListener, setPersistentDrawingCache, setTouchscreenBlocksFocus, setTransitionGroup, setWindowInsetsAnimationCallback, showContextMenuForChild, showContextMenuForChild, startActionModeForChild, startActionModeForChild, startLayoutAnimation, startViewTransition, suppressLayout, updateViewLayout
Methods inherited from class android.view.View
addFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, addOnUnhandledKeyEventListener, animate, announceForAccessibility, autofill, autofill, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelDragAndDrop, cancelLongPress, cancelPendingInputEvents, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAnimation, clearViewTranslationCallback, combineMeasuredStates, computeScroll, computeSystemWindowInsets, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchGenericMotionEvent, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPrePerformAccessibilityAction, dispatchNestedPreScroll, dispatchNestedScroll, dispatchPopulateAccessibilityEvent, draw, drawableHotspotChanged, findOnBackInvokedDispatcher, findViewById, findViewWithTag, focusSearch, forceHasOverlappingRendering, forceLayout, generateDisplayHash, generateViewId, getAccessibilityDelegate, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAccessibilityPaneTitle, getAccessibilityTraversalAfter, getAccessibilityTraversalBefore, getAllowedHandwritingDelegatePackageName, getAllowedHandwritingDelegatorPackageName, getAlpha, getAnimation, getAnimationMatrix, getApplicationWindowToken, getAttributeResolutionStack, getAttributeSourceResourceMap, getAutofillHints, getAutofillId, getAutofillType, getAutofillValue, getBackground, getBackgroundTintBlendMode, getBackgroundTintList, getBackgroundTintMode, getBottom, getCameraDistance, getClipBounds, getClipBounds, getClipToOutline, getContentCaptureSession, getContentDescription, getContext, getDefaultFocusHighlightEnabled, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getElevation, getExplicitStyle, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusable, getFocusables, getFocusedRect, getForeground, getForegroundGravity, getForegroundTintBlendMode, getForegroundTintList, getForegroundTintMode, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHandwritingBoundsOffsetBottom, getHandwritingBoundsOffsetLeft, getHandwritingBoundsOffsetRight, getHandwritingBoundsOffsetTop, getHandwritingDelegatorCallback, getHasOverlappingRendering, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarThumbDrawable, getHorizontalScrollbarTrackDrawable, getId, getImportantForAccessibility, getImportantForAutofill, getImportantForContentCapture, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLocalVisibleRect, getLocationInSurface, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextClusterForwardId, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOutlineAmbientShadowColor, getOutlineProvider, getOutlineSpotShadowColor, getOverScrollMode, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getPointerIcon, getPreferKeepClearRects, getReceiveContentMimeTypes, getResources, getRevealOnFocusHint, getRight, getRootSurfaceControl, getRootView, getRootWindowInsets, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollCaptureHint, getScrollIndicators, getScrollX, getScrollY, getSolidColor, getSourceLayoutResId, getStateDescription, getStateListAnimator, getSystemGestureExclusionRects, getSystemUiVisibility, getTag, getTag, getTextAlignment, getTextDirection, getTooltipText, getTop, getTouchables, getTouchDelegate, getTransitionAlpha, getTransitionName, getTranslationX, getTranslationY, getTranslationZ, getUniqueDrawingId, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarThumbDrawable, getVerticalScrollbarTrackDrawable, getVerticalScrollbarWidth, getViewTranslationResponse, getViewTreeObserver, getVisibility, getWidth, getWindowId, getWindowInsetsController, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, getZ, hasExplicitFocusable, hasFocusable, hasNestedScrollingParent, hasOnClickListeners, hasOnLongClickListeners, hasOverlappingRendering, hasPointerCapture, hasWindowFocus, inflate, invalidate, invalidate, invalidate, invalidateDrawable, invalidateOutline, isAccessibilityDataSensitive, isAccessibilityFocused, isAccessibilityHeading, isActivated, isAttachedToWindow, isAutoHandwritingEnabled, isClickable, isContextClickable, isCredential, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isFocusedByDefault, isForceDarkAllowed, isHandwritingDelegate, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isImportantForAccessibility, isImportantForAutofill, isImportantForContentCapture, isInEditMode, isInLayout, isInTouchMode, isKeyboardNavigationCluster, isLaidOut, isLayoutDirectionResolved, isLayoutRequested, isLongClickable, isNestedScrollingEnabled, isOpaque, isPaddingRelative, isPivotSet, isPreferKeepClear, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScreenReaderFocusable, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShowingLayoutBounds, isShown, isSoundEffectsEnabled, isTemporarilyDetached, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, isVisibleToUserForAutofill, keyboardNavigationClusterSearch, measure, offsetLeftAndRight, offsetTopAndBottom, onApplyWindowInsets, onCancelPendingInputEvents, onCapturedPointerEvent, onCheckIsTextEditor, onCreateInputConnection, onCreateViewTranslationRequest, onCreateVirtualViewTranslationRequests, onDragEvent, onDrawForeground, onFilterTouchEventForSecurity, onFinishTemporaryDetach, onGenericMotionEvent, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onPointerCaptureChange, onPopulateAccessibilityEvent, onProvideAutofillStructure, onProvideAutofillVirtualStructure, onProvideContentCaptureStructure, onProvideStructure, onProvideVirtualStructure, onReceiveContent, onScreenStateChanged, onScrollCaptureSearch, onStartTemporaryDetach, onTouchEvent, onTrackballEvent, onViewTranslationResponse, onVirtualViewTranslationResponses, onVisibilityAggregated, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, performAccessibilityAction, performClick, performContextClick, performContextClick, performHapticFeedback, performHapticFeedback, performLongClick, performLongClick, performReceiveContent, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, releasePointerCapture, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, removeOnUnhandledKeyEventListener, requestApplyInsets, requestFitSystemWindows, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestPointerCapture, requestRectangleOnScreen, requestRectangleOnScreen, requestUnbufferedDispatch, requestUnbufferedDispatch, requireViewById, resetPivot, resolveSize, resolveSizeAndState, restoreHierarchyState, saveAttributeDataForStyleable, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDataSensitive, setAccessibilityDelegate, setAccessibilityHeading, setAccessibilityLiveRegion, setAccessibilityPaneTitle, setAccessibilityTraversalAfter, setAccessibilityTraversalBefore, setActivated, setAllowClickWhenDisabled, setAllowedHandwritingDelegatePackage, setAllowedHandwritingDelegatorPackage, setAlpha, setAnimation, setAnimationMatrix, setAutofillHints, setAutofillId, setAutoHandwritingEnabled, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBackgroundTintBlendMode, setBackgroundTintList, setBackgroundTintMode, setBottom, setCameraDistance, setClickable, setClipBounds, setClipToOutline, setContentCaptureSession, setContentDescription, setContextClickable, setDefaultFocusHighlightEnabled, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setElevation, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusable, setFocusableInTouchMode, setFocusedByDefault, setForceDarkAllowed, setForeground, setForegroundGravity, setForegroundTintBlendMode, setForegroundTintList, setForegroundTintMode, setHandwritingBoundsOffsets, setHandwritingDelegatorCallback, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHorizontalScrollbarThumbDrawable, setHorizontalScrollbarTrackDrawable, setHovered, setId, setImportantForAccessibility, setImportantForAutofill, setImportantForContentCapture, setIsCredential, setIsHandwritingDelegate, setKeepScreenOn, setKeyboardNavigationCluster, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLeftTopRightBottom, setLongClickable, setMinimumHeight, setMinimumWidth, setNestedScrollingEnabled, setNextClusterForwardId, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnCapturedPointerListener, setOnClickListener, setOnContextClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnReceiveContentListener, setOnScrollChangeListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOutlineAmbientShadowColor, setOutlineProvider, setOutlineSpotShadowColor, setOverScrollMode, setPadding, setPaddingRelative, setPivotX, setPivotY, setPointerIcon, setPreferKeepClear, setPreferKeepClearRects, setPressed, setRenderEffect, setRevealOnFocusHint, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScreenReaderFocusable, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollCaptureCallback, setScrollCaptureHint, setScrollContainer, setScrollIndicators, setScrollIndicators, setScrollX, setScrollY, setSelected, setSoundEffectsEnabled, setStateDescription, setStateListAnimator, setSystemGestureExclusionRects, setSystemUiVisibility, setTag, setTag, setTextAlignment, setTextDirection, setTooltipText, setTop, setTouchDelegate, setTransitionAlpha, setTransitionName, setTransitionVisibility, setTranslationX, setTranslationZ, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVerticalScrollbarThumbDrawable, setVerticalScrollbarTrackDrawable, setViewTranslationCallback, setWillNotCacheDrawing, setWillNotDraw, setX, setY, setZ, showContextMenu, showContextMenu, startActionMode, startActionMode, startAnimation, startDrag, startDragAndDrop, startNestedScroll, stopNestedScroll, toString, transformMatrixToGlobal, transformMatrixToLocal, unscheduleDrawable, unscheduleDrawable, updateDragShadow, willNotCacheDrawing, willNotDraw
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface android.view.ViewParent
canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, createContextMenu, getLayoutDirection, getParent, getParentForAccessibility, getTextAlignment, getTextDirection, isLayoutDirectionResolved, isLayoutRequested, isTextAlignmentResolved, isTextDirectionResolved, keyboardNavigationClusterSearch, requestFitSystemWindows, requestLayout
-
Constructor Details
-
PlayerControllerView
-
PlayerControllerView
-
PlayerControllerView
-
-
Method Details
-
showControlsAndFocus
public void showControlsAndFocus(boolean userInteraction) Shows player controls. Focus is set to the play/pause button.- Parameters:
userInteraction
- Indicates that the call was due to a user interaction
-
addListener
Add a new listener.- Parameters:
listener
- The listener
-
removeListener
Remove a listener.- Parameters:
listener
- The listener
-
setPositionAdjuster
Sets the position adjuster, could also be null.- Parameters:
positionAdjuster
- The position adjuster
-
setVisibility
public void setVisibility(int visibility) - Overrides:
setVisibility
in classView
-
setControllerLayoutId
public void setControllerLayoutId(@LayoutRes int controllerLayoutId) Sets the layout resource and re-initializes the view with that layout resource. The component expects the ID's listed in the documentation to be available on the given layout.Note that you need to call this method before you bind a
PlayerController
to this view!- Parameters:
controllerLayoutId
- The layout ID
-
setSkipIncreaseMs
public void setSkipIncreaseMs(int increaseMs) Set the amount of time in milliseconds that player should skip forward when the skip forward button is pressed.- Parameters:
increaseMs
- Time in MS
-
setSkipDecreaseMs
public void setSkipDecreaseMs(int decreaseMs) ASet the amount of time in milliseconds that the player should skip backward when the skip back button is pressed.- Parameters:
decreaseMs
- Time in MS
-
setSubtitleTrackConverter
public void setSubtitleTrackConverter(@NonNull Converter<SubtitleTrack, String> subtitleTrackConverter) Set the converter that will be used to create textual representations for subtitle tracks.- Parameters:
subtitleTrackConverter
- The converter
-
setVideoTrackConverter
public void setVideoTrackConverter(@NonNull Converter<VideoTrackQuality, String> videoTrackConverter) Set the converter that will be used to create textual representations for video tracks.- Parameters:
videoTrackConverter
- The video track converter
-
setVideoTrackAndQualityConverter
public void setVideoTrackAndQualityConverter(@NonNull Converter<VideoTrackAndQuality, String> videoTrackAndQualityConverter) Set the converter that will be used to create textual representations for video and quality tracks.- Parameters:
videoTrackAndQualityConverter
- The video track and quality converter
-
setAudioTrackConverter
Set the converter that will be used to create textual representations for audio tracks.- Parameters:
audioTrackConverter
- The audio track converter
-
setScalingModeConverter
Set the converter that will be used to create textual representation of scaling modes.- Parameters:
scalingModeConverter
- The scaling mode converter
-
showExtendedTrackInfo
public void showExtendedTrackInfo(boolean showExtendedTrackInfo) If the default convert are used for selection dialogs, this can be enabled to render additional track information such as bitrate information or codec information into the track label. This is usually used only for debugging purposes!- Parameters:
showExtendedTrackInfo
- Enable rendering of additional track information
-
allowMultiTrackVideoSelection
public void allowMultiTrackVideoSelection(boolean allowMultiTrackVideoSelection) Enable or disable multi video track selection, default is disabled- Parameters:
allowMultiTrackVideoSelection
- Enable multi video track selection
-
setAnimateSubtitleMargins
public void setAnimateSubtitleMargins(boolean animateSubtitleMargins) Enable or disable subtitles margins animation, default is disabled- Parameters:
animateSubtitleMargins
- True to animate otherwise false
-
getVisibilityController
Returns the current visibility controller- Returns:
- The visibility controller
-
setVisibilityController
Set the visibility controller that will be used to show or hide this control view.- Parameters:
visibilityController
- The visibility controller
-
setSeekBarListener
Set the seek bar listener that can be used to receive callbacks when the user interacts with the seekbar.- Parameters:
seekBarListener
- The listener
-
bind
Binds the controls to the given player view and the controller that is exposed by the view. In case thePlayerController
attached to theIPlayerView
implements thePlaylist
then it is also used as thePlaylist
controller- Parameters:
playerView
- The player view
-
bind
-
bind
Binds the controls to the given player controller. NOTE that this will permit the default dialogs to work properly since they require a player view to to bound as well. In case thePlayerController
implements thePlaylist
then it is also used as thePlaylist
controller- Parameters:
playerController
- The player controller
-
bind
public void bind(@NonNull PlayerController playerController, @Nullable IPlayerView playerView, @Nullable Playlist playlist) Binds the controls view to the given player controller and the the optional player view. The player view is not mandatory but is required to show the default track selection dialogs.- Parameters:
playerController
- The player controllerplayerView
- The player view
-
unbind
public void unbind()Unbinds the controls and the view from this controller and resets all attached listeners. Please note that if you are calling this method, you will need to bind this controller again and also attach any custom listeners such as thePlayerControllerView.SeekBarListener
. -
setEnabled
public void setEnabled(boolean enabled) - Overrides:
setEnabled
in classView
-
dispatchKeyEvent
- Overrides:
dispatchKeyEvent
in classViewGroup
-
dispatchMediaKeyEvent
Handles key event for the default keys implemented by this component.- Parameters:
event
- The key event- Returns:
- True if the event was handled by this method
-
onClick
- Specified by:
onClick
in interfaceView.OnClickListener
-
setTranslationY
public void setTranslationY(float translationY) - Overrides:
setTranslationY
in classView
-
showSubtitleSelection
public void showSubtitleSelection() -
showVideoQualitySelection
public void showVideoQualitySelection() -
showAudioSelection
public void showAudioSelection() -
showScaleSelection
public void showScaleSelection() -
onProgressChanged
- Specified by:
onProgressChanged
in interfaceSeekBar.OnSeekBarChangeListener
-
onStartTrackingTouch
- Specified by:
onStartTrackingTouch
in interfaceSeekBar.OnSeekBarChangeListener
-
onStopTrackingTouch
- Specified by:
onStopTrackingTouch
in interfaceSeekBar.OnSeekBarChangeListener
-
find
-