20.MoreTv_播放器模块_硬解
2017-04-12 20:50:26 0 举报
MoreTv_播放器模块
作者其他创作
大纲/内容
回调EVENT_MEDIA_PLAY_COMPLETE
MEDIA_INFO_VIDEO_TRACK_LAGGINGMEDIA_INFO_BAD_INTERLEAVING
mPlayerState = PlayerStates_Playing
onVideoSizeChange
isBuffering true
Y
回调EVENT_MEDIA_STARTPLAY
mPlayerState != PlayerStates_Error && skip_complete_message == false
surfaceCreated
onCompletion
同步begin
出错时记录当前播放时间
mMediaPlayer.reset
skipOnprepareNotifyWhileBuffering = false
SurfaceView系列回调
参考api:返回false,或不设置error监听器会触发onComplete
skipOnprepareNotifyWhileBuffering false
获取视频长宽,并设置显示的大小
设置显示的长宽
onPrepared
onError
出错类型 == MediaPlayer.MEDIA_ERROR_IO
mMediaPlayer != null
回调EVENT_MEDIA_BUFFERING事件
OnSeekComplete
mPlayerState = PlayerStates_Prepared
mPlayerState 为PlayerStates_Prepared,PlayerStates_Playing
renewMediaplayer
回调EVENT_MEDIA_SIZE_CHANGED
出错类型 == MediaPlayer.MEDIA_ERROR_SERVER_DIED
mMediaPlayer.start
mSeekWhenPrepared != 0
url_to_play != null
同步end
onBufferingUpdate
N
return true
surfaceChanged
设置视频长宽及显示的大小,重绘
MEDIA_INFO_NOT_SEEKABLE
stop
回调EVENT_MEDIA_PREPARED
setDataSourceAndPlay
回调EVENT_MEDIA_PREPAREDEVENT_MEDIA_STARTPLAY
mSurfaceHolder 置空
回调EVENT_MEDIA_PLAY_ERROR
surfaceDestroy
mPlayerState = PlayerStates_Idle
MEDIA_INFO_BUFFERING_START
skip_complete_message
回调EVENT_MEDIA_NOT_SEEKABLE
记录mSeekWhenPrepared
mStartWhenPrepared true
skipOnprepareNotifyWhileBuffering = true
MEDIA_INFO_BUFFERING_END
mSurfaceHolder置空
! isPlaying
isPlaying
skipOnprepareNotifyWhileBuffering true?
出错类型 == MediaPlayer.MEDIA_ERROR_UNKNOWN && what == MEDIA_ERROR_SYSTEM
MediaPlayer系列监听器
回调EVENT_MEDIA_BUFFERING_END
mPlayerState = PlayerStates_PlaybackCompleted
回调EVENT_MEDIA_BUFFERING_START
mMediaPlayer.seekTo(mSeekWhenPrepared)mSeekWhenPrepared = 0
onInfo
0 条评论
回复 删除
下一页