类 BasePlayer
- java.lang.Object
-
- com.ts.lib.player.BasePlayer
-
public abstract class BasePlayer extends Object implements TsPlayer, DefaultLifecycleObserver
播放器基础抽象类- 作者:
- 💎 Li Junchao
-
-
嵌套类概要
-
从接口继承的嵌套类/接口 com.ts.lib.player.Player
Player.PlayerListener, Player.PositionInfo, Player.RepeatMode, Player.SeekType, Player.State, Player.VideoSurface
-
从接口继承的嵌套类/接口 com.ts.lib.player.TsPlayer
TsPlayer.Builder
-
-
字段概要
-
从接口继承的字段 com.ts.lib.player.Player
CLOSEST_SYNC, EXACT, NEXT_SYNC, PREVIOUS_SYNC, REPEAT_MODE_OFF, REPEAT_MODE_ONE, STATE_BUFFERING, STATE_ENDED, STATE_IDLE, STATE_PAUSE, STATE_PLAYING, STATE_PREPARED, STATE_READY, STATE_SEEKING
-
-
构造器概要
构造器 构造器 说明 BasePlayer(TsPlayer.Builder builder)
-
方法概要
-
从接口继承的方法 com.ts.lib.player.Player
addListener, getBufferedPosition, getCurrentPosition, getDuration, getPlayWhenReady, getRepeatMode, getSpeed, getVolume, isPlaying, pause, play, prepare, removeListener, seekTo, setDataSource, setPlayWhenReady, setRepeatMode, setSeekType, setSpeed, setVolume, stop
-
-
-
-
构造器详细资料
-
BasePlayer
public BasePlayer(TsPlayer.Builder builder)
-
-
方法详细资料
-
onSurfaceAvailable
public void onSurfaceAvailable(@Nullable Surface surface, int width, int height)
-
onSurfaceChanged
public void onSurfaceChanged(int width, int height)
-
setVideoSurface
public void setVideoSurface(@Nullable Surface surface, int width, int height, boolean recordable)
从接口复制的说明:Player.VideoSurface设置一个有效的Surface- 指定者:
setVideoSurface在接口中Player.VideoSurface- 参数:
surface-Surfacewidth- widthheight- heightrecordable- 是否record模式
-
setVideoSurfaceHolder
public void setVideoSurfaceHolder(@Nullable SurfaceHolder surfaceHolder, int width, int height)
从接口复制的说明:Player.VideoSurface设置一个有效的SurfaceHolder- 指定者:
setVideoSurfaceHolder在接口中Player.VideoSurface- 参数:
surfaceHolder-SurfaceHolderwidth- width 其实width、height皆不需要传height- height 可通过SurfaceHolder.getSurfaceFrame()获取
-
setVideoSurfaceView
public void setVideoSurfaceView(@Nullable SurfaceView surfaceView)
从接口复制的说明:Player.VideoSurface用来一个渲染视频的SurfaceView- 指定者:
setVideoSurfaceView在接口中Player.VideoSurface- 参数:
surfaceView-SurfaceView
-
setVideoTextureView
public void setVideoTextureView(@Nullable TextureView textureView)
从接口复制的说明:Player.VideoSurface设置一个渲染视频的TextureView- 指定者:
setVideoTextureView在接口中Player.VideoSurface- 参数:
textureView-TextureView
-
clearVideoSurface
public void clearVideoSurface()
从接口复制的说明:Player.VideoSurface- 指定者:
clearVideoSurface在接口中Player.VideoSurface
-
clearVideoSurface
public void clearVideoSurface(@Nullable Surface surface)
从接口复制的说明:Player.VideoSurface- 指定者:
clearVideoSurface在接口中Player.VideoSurface- 参数:
surface-Surface
-
clearVideoSurfaceHolder
public void clearVideoSurfaceHolder(@Nullable SurfaceHolder surfaceHolder)
从接口复制的说明:Player.VideoSurface- 指定者:
clearVideoSurfaceHolder在接口中Player.VideoSurface- 参数:
surfaceHolder-SurfaceHolder
-
clearVideoSurfaceView
public void clearVideoSurfaceView(@Nullable SurfaceView surfaceView)
从接口复制的说明:Player.VideoSurfaceclear 之前 通过Player.VideoSurface.setVideoSurfaceView(SurfaceView)设置的SurfaceView- 指定者:
clearVideoSurfaceView在接口中Player.VideoSurface- 参数:
surfaceView-SurfaceView
-
clearVideoTextureView
public void clearVideoTextureView(@Nullable TextureView textureView)
从接口复制的说明:Player.VideoSurfaceclear 之前 通过Player.VideoSurface.setVideoTextureView(TextureView)设置的TextureView- 指定者:
clearVideoTextureView在接口中Player.VideoSurface- 参数:
textureView-TextureView
-
onCreate
public void onCreate(@NonNull LifecycleOwner owner)
- 指定者:
onCreate在接口中DefaultLifecycleObserver
-
onStart
public void onStart(@NonNull LifecycleOwner owner)
- 指定者:
onStart在接口中DefaultLifecycleObserver
-
onResume
public void onResume(@NonNull LifecycleOwner owner)
- 指定者:
onResume在接口中DefaultLifecycleObserver
-
onPause
public void onPause(@NonNull LifecycleOwner owner)
- 指定者:
onPause在接口中DefaultLifecycleObserver
-
onStop
public void onStop(@NonNull LifecycleOwner owner)
- 指定者:
onStop在接口中DefaultLifecycleObserver
-
onDestroy
public void onDestroy(@NonNull LifecycleOwner owner)
- 指定者:
onDestroy在接口中DefaultLifecycleObserver
-
-