Package 

Class GSYVideoView

  • All Implemented Interfaces:
    android.graphics.drawable.Drawable.Callback , android.view.KeyEvent.Callback , android.view.ViewManager , android.view.ViewParent , android.view.accessibility.AccessibilityEventSource , com.shuyu.gsyvideoplayer.listener.GSYMediaPlayerListener , com.shuyu.gsyvideoplayer.render.view.listener.IGSYSurfaceListener , com.shuyu.gsyvideoplayer.utils.MeasureHelper.MeasureFormVideoParamsListener

    
    public abstract class GSYVideoView
    extends GSYTextureRenderView implements GSYMediaPlayerListener
                        

    视频回调与状态处理等相关层 Created by guoshuyu on 2017/8/2.

    • Method Summary

      Modifier and Type Method Description
      int getCurrentVideoWidth()
      int getCurrentVideoHeight()
      int getVideoSarNum()
      int getVideoSarDen()
      boolean setUp(String url, boolean cacheWithPlay, String title) 设置播放URL
      boolean setUp(String url, boolean cacheWithPlay, File cachePath, Map<String, String> mapHeadData, String title) 设置播放URL
      boolean setUp(String url, boolean cacheWithPlay, File cachePath, String title) 设置播放URL
      void onVideoReset() 重置
      void onVideoPause() 暂停状态
      void onVideoResume() 恢复暂停状态
      void onVideoResume(boolean seek) 恢复暂停状态
      void onPrepared()
      void onAutoCompletion()
      void onCompletion()
      void onSeekComplete()
      void onError(int what, int extra)
      void onInfo(int what, int extra)
      void onVideoSizeChanged()
      void clearCurrentCache() 清除当前缓存
      long getCurrentPositionWhenPlaying() 获取当前播放进度
      long getDuration() 获取当前总时长
      void release() 释放吧
      void startAfterPrepared() prepared成功之后会开始播放
      abstract GSYVideoViewBridge getGSYVideoManager() 获取管理器桥接的实现
      abstract int getLayoutId() 当前UI
      abstract void startPlayLogic() 开始播放
      int getCurrentState() 获取当前播放状态
      boolean isInPlayingState() 根据状态判断是否播放中
      String getPlayTag() 播放tag防止错误,因为普通的url也可能重复
      void setPlayTag(String playTag) 播放tag防止错误,因为普通的url也可能重复
      int getPlayPosition()
      void setPlayPosition(int playPosition) 设置播放位置防止错位
      long getNetSpeed() 网络速度注意,这里如果是开启了缓存,因为读取本地代理,缓存成功后还是存在速度的再打开已经缓存的本地文件,网络速度才会回0.
      String getNetSpeedText() 网络速度注意,这里如果是开启了缓存,因为读取本地代理,缓存成功后还是存在速度的再打开已经缓存的本地文件,网络速度才会回0.
      long getSeekOnStart()
      void setSeekOnStart(long seekOnStart) 从哪里开始播放目前有时候前几秒有跳动问题,毫秒需要在startPlayLogic之前,即播放开始之前
      int getBuffterPoint() 缓冲进度/缓存进度
      boolean isIfCurrentIsFullscreen() 是否全屏
      void setIfCurrentIsFullscreen(boolean ifCurrentIsFullscreen)
      boolean isLooping()
      void setLooping(boolean looping) 设置循环
      void setVideoAllCallBack(VideoAllCallBack mVideoAllCallBack) 设置播放过程中的回调
      float getSpeed()
      void setSpeed(float speed) 播放速度
      void setSpeed(float speed, boolean soundTouch) 播放速度
      void setSpeedPlaying(float speed, boolean soundTouch) 播放中生效的播放数据
      boolean isShowPauseCover()
      void setShowPauseCover(boolean showPauseCover) 是否需要加载显示暂停的cover图片打开状态下,暂停退到后台,再回到前台不会显示黑屏,但可以对某些机型有概率出现OOM关闭情况下,暂停退到后台,再回到前台显示黑屏目前某些特定情况可能会出现切换视频时黑屏:https://github.
      void seekTo(long position) seekto what you want
      boolean isStartAfterPrepared()
      void setStartAfterPrepared(boolean startAfterPrepared) 准备成功之后立即播放
      boolean isReleaseWhenLossAudio()
      void setReleaseWhenLossAudio(boolean releaseWhenLossAudio) 长时间失去音频焦点,暂停播放器
      Map<String, String> getMapHeadData()
      void setMapHeadData(Map<String, String> headData) 单独设置mapHeader
      String getOverrideExtension()
      void setOverrideExtension(String overrideExtension) 是否需要覆盖拓展类型,目前只针对exoPlayer内核模式有效
      • Methods inherited from class com.shuyu.gsyvideoplayer.video.base.GSYTextureRenderView

        getEffectFilter, getRenderProxy, onSurfaceAvailable, onSurfaceDestroyed, onSurfaceSizeChanged, onSurfaceUpdated, setCustomGLRenderer, setEffectFilter, setGLRenderMode, setMatrixGL
      • Methods inherited from class android.widget.FrameLayout

        generateLayoutParams, getAccessibilityClassName, getConsiderGoneChildrenWhenMeasuring, getMeasureAllChildren, setForegroundGravity, setMeasureAllChildren, shouldDelayChildPressedState
      • Methods inherited from class android.view.ViewGroup

        addChildrenForAccessibility, addExtraDataToAccessibilityNodeInfo, addFocusables, addKeyboardNavigationClusters, addStatesFromChildren, addTouchables, addView, bringChildToFront, childDrawableStateChanged, childHasTransientStateChanged, clearChildFocus, clearDisappearingChildren, clearFocus, dispatchApplyWindowInsets, dispatchCapturedPointerEvent, dispatchConfigurationChanged, dispatchCreateViewTranslationRequest, dispatchDisplayHint, dispatchDragEvent, dispatchDrawableHotspotChanged, dispatchFinishTemporaryDetach, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPointerCaptureChanged, dispatchProvideAutofillStructure, dispatchProvideStructure, dispatchScrollCaptureSearch, dispatchSetActivated, dispatchSetSelected, dispatchStartTemporaryDetach, dispatchSystemUiVisibilityChanged, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchWindowFocusChanged, dispatchWindowInsetsAnimationEnd, dispatchWindowInsetsAnimationPrepare, dispatchWindowInsetsAnimationProgress, dispatchWindowInsetsAnimationStart, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, endViewTransition, findFocus, findOnBackInvokedDispatcherForChild, findViewsWithText, focusSearch, focusableViewAvailable, gatherTransparentRegion, getChildAt, getChildCount, 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, startActionModeForChild, startLayoutAnimation, startViewTransition, suppressLayout, updateViewLayout
      • Methods inherited from class android.view.View

        addOnAttachStateChangeListener, addOnLayoutChangeListener, addOnUnhandledKeyEventListener, animate, announceForAccessibility, autofill, bringToFront, buildDrawingCache, buildLayer, callOnClick, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, cancelDragAndDrop, cancelLongPress, cancelPendingInputEvents, checkInputConnectionProxy, clearAnimation, clearViewTranslationCallback, combineMeasuredStates, computeScroll, computeSystemWindowInsets, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchGenericMotionEvent, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPrePerformAccessibilityAction, dispatchNestedPreScroll, dispatchNestedScroll, dispatchPopulateAccessibilityEvent, draw, drawableHotspotChanged, findOnBackInvokedDispatcher, findViewById, findViewWithTag, 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, getBaseline, getBottom, getCameraDistance, getClipBounds, getClipBounds, getClipToOutline, getContentCaptureSession, getContentDescription, getContext, getDefaultFocusHighlightEnabled, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getElevation, getExplicitStyle, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusable, getFocusables, getFocusedRect, getForeground, getForegroundGravity, getForegroundTintBlendMode, getForegroundTintList, getForegroundTintMode, 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, getOverlay, 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, getTextAlignment, getTextDirection, getTooltipText, getTop, getTouchDelegate, getTouchables, 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, 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, isScrollContainer, isScrollbarFadingEnabled, 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, onRtlPropertiesChanged, onScreenStateChanged, onScrollCaptureSearch, onStartTemporaryDetach, onTouchEvent, onTrackballEvent, onViewTranslationResponse, onVirtualViewTranslationResponses, onVisibilityAggregated, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, performAccessibilityAction, performClick, performContextClick, performHapticFeedback, performLongClick, performReceiveContent, playSoundEffect, post, postDelayed, postInvalidate, postInvalidateDelayed, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, releasePointerCapture, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, removeOnUnhandledKeyEventListener, requestApplyInsets, requestFitSystemWindows, requestFocusFromTouch, requestLayout, requestPointerCapture, requestRectangleOnScreen, 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, setAutoHandwritingEnabled, 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, 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, setScrollBarSize, setScrollBarStyle, setScrollCaptureCallback, setScrollCaptureHint, setScrollContainer, setScrollIndicators, setScrollX, setScrollY, setScrollbarFadingEnabled, setSelected, setSoundEffectsEnabled, setStateDescription, setStateListAnimator, setSystemGestureExclusionRects, setSystemUiVisibility, setTag, setTextAlignment, setTextDirection, setTooltipText, setTop, setTouchDelegate, setTransitionAlpha, setTransitionName, setTransitionVisibility, setTranslationX, setTranslationY, setTranslationZ, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVerticalScrollbarThumbDrawable, setVerticalScrollbarTrackDrawable, setViewTranslationCallback, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, setZ, showContextMenu, startActionMode, startAnimation, startDrag, startDragAndDrop, startNestedScroll, stopNestedScroll, toString, transformMatrixToGlobal, transformMatrixToLocal, unscheduleDrawable, updateDragShadow, willNotCacheDrawing, willNotDraw
      • Methods inherited from class com.shuyu.gsyvideoplayer.listener.GSYMediaPlayerListener

        onBackFullscreen, onBufferingUpdate
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • setUp

         boolean setUp(String url, boolean cacheWithPlay, String title)

        设置播放URL

        Parameters:
        url - 播放url
        cacheWithPlay - 是否边播边缓存
        title - title
      • setUp

         boolean setUp(String url, boolean cacheWithPlay, File cachePath, Map<String, String> mapHeadData, String title)

        设置播放URL

        Parameters:
        url - 播放url
        cacheWithPlay - 是否边播边缓存
        cachePath - 缓存路径,如果是M3U8或者HLS,请设置为false
        mapHeadData - 头部信息
        title - title
      • setUp

         boolean setUp(String url, boolean cacheWithPlay, File cachePath, String title)

        设置播放URL

        Parameters:
        url - 播放url
        cacheWithPlay - 是否边播边缓存
        cachePath - 缓存路径,如果是M3U8或者HLS,请设置为false
        title - title
      • onVideoResume

         void onVideoResume(boolean seek)

        恢复暂停状态

        Parameters:
        seek - 是否产生seek动作
      • onError

         void onError(int what, int extra)
      • onInfo

         void onInfo(int what, int extra)
      • getPlayTag

         String getPlayTag()

        播放tag防止错误,因为普通的url也可能重复

      • setPlayTag

         void setPlayTag(String playTag)

        播放tag防止错误,因为普通的url也可能重复

        Parameters:
        playTag - 保证不重复就好
      • setPlayPosition

         void setPlayPosition(int playPosition)

        设置播放位置防止错位

      • getNetSpeed

         long getNetSpeed()

        网络速度注意,这里如果是开启了缓存,因为读取本地代理,缓存成功后还是存在速度的再打开已经缓存的本地文件,网络速度才会回0.因为是播放本地文件了

      • getNetSpeedText

         String getNetSpeedText()

        网络速度注意,这里如果是开启了缓存,因为读取本地代理,缓存成功后还是存在速度的再打开已经缓存的本地文件,网络速度才会回0.因为是播放本地文件了

      • setSeekOnStart

         void setSeekOnStart(long seekOnStart)

        从哪里开始播放目前有时候前几秒有跳动问题,毫秒需要在startPlayLogic之前,即播放开始之前

      • setLooping

         void setLooping(boolean looping)

        设置循环

      • setSpeed

         void setSpeed(float speed)

        播放速度

      • setSpeed

         void setSpeed(float speed, boolean soundTouch)

        播放速度

        Parameters:
        speed - 速度
        soundTouch - 是否对6.
      • setSpeedPlaying

         void setSpeedPlaying(float speed, boolean soundTouch)

        播放中生效的播放数据

      • setShowPauseCover

         void setShowPauseCover(boolean showPauseCover)

        是否需要加载显示暂停的cover图片打开状态下,暂停退到后台,再回到前台不会显示黑屏,但可以对某些机型有概率出现OOM关闭情况下,暂停退到后台,再回到前台显示黑屏目前某些特定情况可能会出现切换视频时黑屏:https://github.com/CarGuo/GSYVideoPlayer/issues/1757#issuecomment-751981100

        Parameters:
        showPauseCover - 默认true
      • seekTo

         void seekTo(long position)

        seekto what you want

      • setStartAfterPrepared

         void setStartAfterPrepared(boolean startAfterPrepared)

        准备成功之后立即播放

        Parameters:
        startAfterPrepared - 默认true,false的时候需要在prepared后调用startAfterPrepared()
      • setReleaseWhenLossAudio

         void setReleaseWhenLossAudio(boolean releaseWhenLossAudio)

        长时间失去音频焦点,暂停播放器

        Parameters:
        releaseWhenLossAudio - 默认true,false的时候只会暂停
      • setOverrideExtension

         void setOverrideExtension(String overrideExtension)

        是否需要覆盖拓展类型,目前只针对exoPlayer内核模式有效

        Parameters:
        overrideExtension - 比如传入 m3u8,mp4,avi 等类型