Package com.castlabs.sdk.playerui

# Class PlayerControllerView

java.lang.Object
android.view.View
android.view.ViewGroup
android.widget.LinearLayout
com.castlabs.sdk.playerui.PlayerControllerView

All Implemented Interfaces:
  `Drawable.Callback`, `AccessibilityEventSource`, `KeyEvent.Callback`, `View.OnClickListener`, `ViewManager`, `ViewParent`, `SeekBar.OnSeekBarChangeListener`

public class PlayerControllerView extends LinearLayout implements View.OnClickListener, SeekBar.OnSeekBarChangeListener
This view component can be bound to a `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`
- `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
- `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
- `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
- `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
- `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
- `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
- `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
- `animation_view_position` - Specify the controls position relative to the parent. Current `top` and `bottom` 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`

## Overriding the default layout

The view, by default loads its corresponding layout definition from `res/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`
- `presto_rewind_button` - The rewind button.
  - Type: `View`
- `presto_fastforward_button` - The fast-forward button.
  - Type: `View`
- `presto_skip_back_button` - The skip backwards button
  - Type: `View`
- `presto_skip_forward_button` - The skip backwards button
  - Type: `View`
- `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
- `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
- `presto_select_scale_button` - The scale selection button.
  - Type: `View`
- `presto_select_audio_button` - The audio or language selection button.
  - Type: `View`
- `presto_select_subtitle_button` - The subtitle selection button.
  - Type: `View`
- `presto_select_video_button` - The video quality selection button.
  - Type: `View`
- `presto_current_time` - Text view that shows the current playback position
  - Type: `TextView`
- `presto_total_time` - Text view that shows the total duration or the "live" indicator
  - Type: `TextView`
- `presto_playback_speed_text` - Text view that shows the playback speed when fast-forward playback is active
  - Type: `TextView`
- `presto_seek_bar` - The scrubbing seek bar
  - Type: `SeekBar`

## 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 a `PlayerController` 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 use `setSubtitleTrackConverter(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 use `setVideoTrackConverter(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 use `setAudioTrackConverter(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 use `setScalingModeConverter(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 default `VisibilityController` 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

  Nested Classes
  Modifier and Type
  Class
  Description
  `static interface`
  `PlayerControllerView.Listener`
  Generic listener interface that can be used to receive specific events from this view.
  `static interface`
  `PlayerControllerView.PositionAdjuster`
  This interface is used to adjust the seekbar position to the thumbnail cue-points.
  `static interface`
  `PlayerControllerView.SeekBarListener`
  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, CONTENT_SENSITIVITY_AUTO, CONTENT_SENSITIVITY_NOT_SENSITIVE, CONTENT_SENSITIVITY_SENSITIVE, DRAG_FLAG_ACCESSIBILITY_ACTION, DRAG_FLAG_GLOBAL, DRAG_FLAG_GLOBAL_PERSISTABLE_URI_PERMISSION, DRAG_FLAG_GLOBAL_PREFIX_URI_PERMISSION, DRAG_FLAG_GLOBAL_SAME_APPLICATION, DRAG_FLAG_GLOBAL_URI_READ, DRAG_FLAG_GLOBAL_URI_WRITE, DRAG_FLAG_OPAQUE, DRAG_FLAG_START_INTENT_SENDER_ON_UNHANDLED_DRAG, 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, REQUESTED_FRAME_RATE_CATEGORY_DEFAULT, REQUESTED_FRAME_RATE_CATEGORY_HIGH, REQUESTED_FRAME_RATE_CATEGORY_LOW, REQUESTED_FRAME_RATE_CATEGORY_NO_PREFERENCE, REQUESTED_FRAME_RATE_CATEGORY_NORMAL, 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

  Constructors
  Constructor
  Description
  `PlayerControllerView(Context context)`
  Creates a new PlayerControllerView.
  `PlayerControllerView(Context context, AttributeSet attrs)`
  Creates a new PlayerControllerView.
  `PlayerControllerView(Context context, AttributeSet attrs, int defStyleAttr)`
  Creates a new PlayerControllerView.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addListener(PlayerControllerView.Listener listener)`
  Add a new listener.
  `void`
  `allowMultiTrackVideoSelection(boolean allowMultiTrackVideoSelection)`
  Enable or disable multi video track selection, default is disabled
  `void`
  `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)`
  Binds the player view to the 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.
  `View`
  `find(int id)`
  Finds a view by its ID.
  `VisibilityController`
  `getVisibilityController()`
  Returns the current visibility controller
  `void`
  `onClick(View v)`
  `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 disabled
  `void`
  `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`
  `showAudioSelection()`
  Shows the audio selection dialog.
  `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`
  `showScaleSelection()`
  Shows the scaling mode selection dialog.
  `void`
  `showSubtitleSelection()`
  Shows the subtitle selection dialog.
  `void`
  `showVideoQualitySelection()`
  Shows the video quality selection dialog.
  `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, clearPendingCredentialRequest, 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, getContentSensitivity, getContext, getDefaultFocusHighlightEnabled, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getElevation, getExplicitStyle, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusable, getFocusables, getFocusedRect, getForeground, getForegroundGravity, getForegroundTintBlendMode, getForegroundTintList, getForegroundTintMode, getFrameContentVelocity, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHandwritingBoundsOffsetBottom, getHandwritingBoundsOffsetLeft, getHandwritingBoundsOffsetRight, getHandwritingBoundsOffsetTop, getHandwritingDelegateFlags, 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, getPendingCredentialCallback, getPendingCredentialRequest, getPivotX, getPivotY, getPointerIcon, getPreferKeepClearRects, getReceiveContentMimeTypes, getRequestedFrameRate, 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, isContentSensitive, 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, setContentSensitivity, setContextClickable, setDefaultFocusHighlightEnabled, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setElevation, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusable, setFocusableInTouchMode, setFocusedByDefault, setForceDarkAllowed, setForeground, setForegroundGravity, setForegroundTintBlendMode, setForegroundTintList, setForegroundTintMode, setFrameContentVelocity, setHandwritingBoundsOffsets, setHandwritingDelegateFlags, 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, setPendingCredentialRequest, setPivotX, setPivotY, setPointerIcon, setPreferKeepClear, setPreferKeepClearRects, setPressed, setRenderEffect, setRequestedFrameRate, 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

    public PlayerControllerView(Context context)
    Creates a new PlayerControllerView.
    Parameters:
      `context` - The context to use.

  - ### PlayerControllerView

    public PlayerControllerView(Context context, AttributeSet attrs)
    Creates a new PlayerControllerView.
    Parameters:
      `context` - The context to use.
      `attrs` - The attributes of the XML tag that is inflating the view.

  - ### PlayerControllerView

    public PlayerControllerView(Context context, AttributeSet attrs, int defStyleAttr)
    Creates a new PlayerControllerView.
    Parameters:
      `context` - The context to use.
      `attrs` - The attributes of the XML tag that is inflating the view.
      `defStyleAttr` - An attribute in the current theme that contains a reference to a style resource that supplies default values for the view. Can be 0 to not look for defaults.

- ## 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

    public void addListener(PlayerControllerView.Listener listener)
    Add a new listener.
    Parameters:
      `listener` - The listener

  - ### removeListener

    public void removeListener(PlayerControllerView.Listener listener)
    Remove a listener.
    Parameters:
      `listener` - The listener

  - ### setPositionAdjuster

    public void setPositionAdjuster(@Nullable PlayerControllerView.PositionAdjuster positionAdjuster)
    Sets the position adjuster, could also be null.
    Parameters:
      `positionAdjuster` - The position adjuster

  - ### setVisibility

    public void setVisibility(int visibility)
    Overrides:
      `setVisibility` in class `View`

  - ### 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

    public void setAudioTrackConverter(Converter<AudioTrack,String> audioTrackConverter)
    Set the converter that will be used to create textual representations for audio tracks.
    Parameters:
      `audioTrackConverter` - The audio track converter

  - ### setScalingModeConverter

    public void setScalingModeConverter(Converter<Integer,String> scalingModeConverter)
    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

    public VisibilityController getVisibilityController()
    Returns the current visibility controller
    Returns:
      The visibility controller

  - ### setVisibilityController

    public void setVisibilityController(@NonNull VisibilityController visibilityController)
    Set the visibility controller that will be used to show or hide this control view.
    Parameters:
      `visibilityController` - The visibility controller

  - ### setSeekBarListener

    public void setSeekBarListener(@Nullable PlayerControllerView.SeekBarListener seekBarListener)
    Set the seek bar listener that can be used to receive callbacks when the user interacts with the seekbar.
    Parameters:
      `seekBarListener` - The listener

  - ### bind

    public void bind(@NonNull IPlayerView playerView)
    Binds the controls to the given player view and the controller that is exposed by the view. In case the `PlayerController` attached to the `IPlayerView` implements the `Playlist` then it is also used as the `Playlist` controller
    Parameters:
      `playerView` - The player view

  - ### bind

    public void bind(@NonNull IPlayerView playerView, @NonNull Playlist playlist)
    Binds the player view to the playlist.
    Parameters:
      `playerView` - The player view to bind.
      `playlist` - The playlist to bind.

  - ### bind

    public void bind(@NonNull PlayerController playerController)
    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 the `PlayerController` implements the `Playlist` then it is also used as the `Playlist` 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 controller
      `playerView` - The player view
      `playlist` - The playlist controller or null if not available

  - ### 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 the `PlayerControllerView.SeekBarListener`.

  - ### setEnabled

    public void setEnabled(boolean enabled)
    Overrides:
      `setEnabled` in class `View`

  - ### dispatchKeyEvent

    public boolean dispatchKeyEvent(KeyEvent event)
    Overrides:
      `dispatchKeyEvent` in class `ViewGroup`

  - ### dispatchMediaKeyEvent

    public boolean dispatchMediaKeyEvent(KeyEvent event)
    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

    public void onClick(View v)
    Specified by:
      `onClick` in interface `View.OnClickListener`

  - ### setTranslationY

    public void setTranslationY(float translationY)
    Overrides:
      `setTranslationY` in class `View`

  - ### showSubtitleSelection

    public void showSubtitleSelection()
    Shows the subtitle selection dialog.

  - ### showVideoQualitySelection

    public void showVideoQualitySelection()
    Shows the video quality selection dialog. If multi-track video selection is allowed, a dialog for selecting video tracks and qualities is shown. Otherwise, if a video track is available, a dialog for selecting video qualities is shown.

  - ### showAudioSelection

    public void showAudioSelection()
    Shows the audio selection dialog.

  - ### showScaleSelection

    public void showScaleSelection()
    Shows the scaling mode selection dialog.

    The scaling mode selection dialog allows the user to select a scaling mode for the video.

  - ### onProgressChanged

    public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser)
    Specified by:
      `onProgressChanged` in interface `SeekBar.OnSeekBarChangeListener`

  - ### onStartTrackingTouch

    public void onStartTrackingTouch(SeekBar seekBar)
    Specified by:
      `onStartTrackingTouch` in interface `SeekBar.OnSeekBarChangeListener`

  - ### onStopTrackingTouch

    public void onStopTrackingTouch(SeekBar seekBar)
    Specified by:
      `onStopTrackingTouch` in interface `SeekBar.OnSeekBarChangeListener`

  - ### find

    public View find(int id)
    Finds a view by its ID.
    Parameters:
      `id` - The ID of the view to find.
    Returns:
      The view with the given ID, or null if not found.