-
- All Implemented Interfaces:
-
android.graphics.drawable.Drawable.Callback,android.view.KeyEvent.Callback,android.view.accessibility.AccessibilityEventSource,com.getstream.sdk.chat.utils.exomedia.core.api.VideoViewApi,com.getstream.sdk.chat.utils.exomedia.core.video.ClearableSurface
public class ExoSurfaceVideoView extends ResizingSurfaceView implements VideoViewApi
A VideoViewApi implementation that uses the ExoPlayer as the backing media player.
-
-
Constructor Summary
Constructors Constructor Description ExoSurfaceVideoView(Context context)ExoSurfaceVideoView(Context context, AttributeSet attrs)ExoSurfaceVideoView(Context context, AttributeSet attrs, int defStyleAttr)ExoSurfaceVideoView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
-
Method Summary
Modifier and Type Method Description voidsetVideoUri(Uri uri)voidsetVideoUri(Uri uri, MediaSource mediaSource)voidsetDrmCallback(MediaDrmCallback drmCallback)Sets the MediaDrmCallback to use when handling DRM for media. booleanrestart()Prepares the media previously specified for playback. floatgetVolume()booleansetVolume(float volume)voidseekTo(long milliseconds)booleanisPlaying()voidstart()voidpause()voidstopPlayback(boolean clearSurface)Performs the functionality to stop the video in playback voidsuspend()longgetDuration()longgetCurrentPosition()intgetBufferedPercent()WindowInfogetWindowInfo()booleansetPlaybackSpeed(float speed)Sets the playback speed for this MediaPlayer. floatgetPlaybackSpeed()voidsetCaptionListener(CaptionListener listener)booleantrackSelectionAvailable()voidsetTrack(ExoMedia.RendererType trackType, int trackIndex)voidsetTrack(ExoMedia.RendererType type, int groupIndex, int trackIndex)intgetSelectedTrackIndex(ExoMedia.RendererType type, int groupIndex)voidclearSelectedTracks(ExoMedia.RendererType type)Clear all selected tracks for the specified renderer. Map<ExoMedia.RendererType, TrackGroupArray>getAvailableTracks()Retrieves a list of available tracks to select from. voidsetRendererEnabled(ExoMedia.RendererType type, boolean enabled)Enables or disables the track associated with the type.booleanisRendererEnabled(ExoMedia.RendererType type)Return true if at least one renderer for the given type is enabled voidrelease()voidsetListenerMux(ListenerMux listenerMux)voidonVideoSizeChanged(int width, int height, float pixelWidthHeightRatio)voidsetRepeatMode(int repeatMode)-
Methods inherited from class com.getstream.sdk.chat.utils.exomedia.core.video.ResizingSurfaceView
clearSurface, getScaleType, setMeasureBasedOnAspectRatioEnabled, setOnSizeChangeListener, setScaleType, setVideoRotation, setVideoRotation -
Methods inherited from class android.view.SurfaceView
dispatchDraw, draw, gatherTransparentRegion, getHolder, getSurfaceControl, onAttachedToWindow, onDetachedFromWindow, onMeasure, onWindowVisibilityChanged, setSecure, setVisibility, setZOrderMediaOverlay, setZOrderOnTop -
Methods inherited from class android.view.View
addChildrenForAccessibility, addExtraDataToAccessibilityNodeInfo, addFocusables, addKeyboardNavigationClusters, addOnAttachStateChangeListener, addOnLayoutChangeListener, addOnUnhandledKeyEventListener, addTouchables, animate, announceForAccessibility, autofill, awakenScrollBars, bringToFront, buildDrawingCache, buildLayer, callOnClick, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, cancelDragAndDrop, cancelLongPress, cancelPendingInputEvents, checkInputConnectionProxy, clearAnimation, clearFocus, combineMeasuredStates, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeScroll, computeSystemWindowInsets, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchApplyWindowInsets, dispatchCapturedPointerEvent, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchDrawableHotspotChanged, dispatchFinishTemporaryDetach, dispatchGenericFocusedEvent, dispatchGenericMotionEvent, dispatchGenericPointerEvent, dispatchHoverEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPrePerformAccessibilityAction, dispatchNestedPreScroll, dispatchNestedScroll, dispatchPointerCaptureChanged, dispatchPopulateAccessibilityEvent, dispatchProvideAutofillStructure, dispatchProvideStructure, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchStartTemporaryDetach, dispatchSystemUiVisibilityChanged, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, drawableHotspotChanged, drawableStateChanged, findFocus, findViewById, findViewWithTag, findViewsWithText, fitSystemWindows, focusSearch, forceHasOverlappingRendering, forceLayout, generateViewId, getAccessibilityClassName, getAccessibilityDelegate, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAccessibilityPaneTitle, getAccessibilityTraversalAfter, getAccessibilityTraversalBefore, getAlpha, getAnimation, getAnimationMatrix, getApplicationWindowToken, getAttributeResolutionStack, getAttributeSourceResourceMap, getAutofillHints, getAutofillId, getAutofillType, getAutofillValue, getBackground, getBackgroundTintBlendMode, getBackgroundTintList, getBackgroundTintMode, getBaseline, 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, hasFocus, hasFocusable, hasNestedScrollingParent, hasOnClickListeners, hasOverlappingRendering, hasPointerCapture, hasTransientState, 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, jumpDrawablesToCurrentState, keyboardNavigationClusterSearch, layout, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAnimationEnd, onAnimationStart, onApplyWindowInsets, onCancelPendingInputEvents, onCapturedPointerEvent, onCheckIsTextEditor, onConfigurationChanged, onCreateContextMenu, onCreateDrawableState, onCreateInputConnection, onDisplayHint, onDragEvent, onDraw, onDrawForeground, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onGenericMotionEvent, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onLayout, onOverScrolled, onPointerCaptureChange, onPopulateAccessibilityEvent, onProvideAutofillStructure, onProvideAutofillVirtualStructure, onProvideStructure, onProvideVirtualStructure, onResolvePointerIcon, onRestoreInstanceState, onRtlPropertiesChanged, onSaveInstanceState, onScreenStateChanged, onScrollChanged, onSetAlpha, onSizeChanged, onStartTemporaryDetach, onTouchEvent, onTrackballEvent, onVisibilityAggregated, onVisibilityChanged, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, overScrollBy, performAccessibilityAction, performClick, performContextClick, performHapticFeedback, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidateDelayed, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, releasePointerCapture, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, removeOnUnhandledKeyEventListener, requestApplyInsets, requestFitSystemWindows, requestFocus, requestFocusFromTouch, requestLayout, requestPointerCapture, requestRectangleOnScreen, requestUnbufferedDispatch, requireViewById, resetPivot, resolveSize, resolveSizeAndState, restoreDefaultFocus, 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, 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.core.api.VideoViewApi
getHeight, getWidth, setMeasureBasedOnAspectRatioEnabled, setOnTouchListener, setTrack -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
ExoSurfaceVideoView
ExoSurfaceVideoView(Context context)
-
ExoSurfaceVideoView
ExoSurfaceVideoView(Context context, AttributeSet attrs)
-
ExoSurfaceVideoView
ExoSurfaceVideoView(Context context, AttributeSet attrs, int defStyleAttr)
-
ExoSurfaceVideoView
ExoSurfaceVideoView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
-
-
Method Detail
-
setVideoUri
void setVideoUri(Uri uri)
-
setVideoUri
void setVideoUri(Uri uri, MediaSource mediaSource)
-
setDrmCallback
void setDrmCallback(MediaDrmCallback drmCallback)
Sets the MediaDrmCallback to use when handling DRM for media. This should be called before specifying the videos uri or path NOTE: DRM is only supported on API 18 +
- Parameters:
drmCallback- The callback to use when handling DRM media
-
restart
boolean restart()
Prepares the media previously specified for playback. This should only be called after the playback has completed to restart playback from the beginning.
-
getVolume
float getVolume()
-
setVolume
boolean setVolume(float volume)
-
seekTo
void seekTo(long milliseconds)
-
isPlaying
boolean isPlaying()
-
start
void start()
-
pause
void pause()
-
stopPlayback
void stopPlayback(boolean clearSurface)
Performs the functionality to stop the video in playback
- Parameters:
clearSurface-trueif the surface should be cleared
-
suspend
void suspend()
-
getDuration
long getDuration()
-
getCurrentPosition
long getCurrentPosition()
-
getBufferedPercent
int getBufferedPercent()
-
getWindowInfo
@Nullable() WindowInfo getWindowInfo()
-
setPlaybackSpeed
boolean setPlaybackSpeed(float speed)
Sets the playback speed for this MediaPlayer.
- Parameters:
speed- The speed to play the media back at
-
getPlaybackSpeed
float getPlaybackSpeed()
-
setCaptionListener
void setCaptionListener(CaptionListener listener)
-
trackSelectionAvailable
boolean trackSelectionAvailable()
-
setTrack
void setTrack(ExoMedia.RendererType trackType, int trackIndex)
-
setTrack
void setTrack(ExoMedia.RendererType type, int groupIndex, int trackIndex)
-
getSelectedTrackIndex
int getSelectedTrackIndex(ExoMedia.RendererType type, int groupIndex)
-
clearSelectedTracks
void clearSelectedTracks(ExoMedia.RendererType type)
Clear all selected tracks for the specified renderer.
- Parameters:
type- The renderer type
-
getAvailableTracks
@Nullable() Map<ExoMedia.RendererType, TrackGroupArray> getAvailableTracks()
Retrieves a list of available tracks to select from. Typically trackSelectionAvailable should be called before this.
-
setRendererEnabled
void setRendererEnabled(ExoMedia.RendererType type, boolean enabled)
Enables or disables the track associated with the
type. Note, by default all tracks are enabled- Parameters:
type- The to enable or disable the track forenabled-trueif the track should be enabled.
-
isRendererEnabled
boolean isRendererEnabled(ExoMedia.RendererType type)
Return true if at least one renderer for the given type is enabled
- Parameters:
type- The renderer type
-
release
void release()
-
setListenerMux
void setListenerMux(ListenerMux listenerMux)
-
onVideoSizeChanged
void onVideoSizeChanged(int width, int height, float pixelWidthHeightRatio)
-
setRepeatMode
void setRepeatMode(int repeatMode)
-
-
-
-