Java Code Examples for tv.danmaku.ijk.media.player.IMediaPlayer#MEDIA_INFO_BUFFERING_START

The following examples show how to use tv.danmaku.ijk.media.player.IMediaPlayer#MEDIA_INFO_BUFFERING_START . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MxVideoPlayer.java    From MxVideoPlayer with Apache License 2.0 6 votes vote down vote up
@Override
public void onInfo(int what, int extra) {
    Log.i(TAG, "onInfo what : " + what + " extra : " + extra);
    if (what == IMediaPlayer.MEDIA_INFO_BUFFERING_START) {
        MxMediaManager.getInstance().mBackUpBufferState = mCurrentState;
        setUiPlayState(CURRENT_STATE_PLAYING_BUFFERING_START);
        Log.i(TAG, "MEDIA_INFO_BUFFERING_START");
    } else if (what == IMediaPlayer.MEDIA_INFO_BUFFERING_END) {
        if (MxMediaManager.getInstance().mBackUpBufferState != -1) {
            setUiPlayState(MxMediaManager.getInstance().mBackUpBufferState);
            MxMediaManager.getInstance().mBackUpBufferState = -1;
        }
        Log.i(TAG, "MEDIA_INFO_BUFFERING_END");
    } else if (what == IMediaPlayer.MEDIA_INFO_VIDEO_ROTATION_CHANGED) {
        MxMediaManager.getInstance().mVideoRotation = extra;
        MxMediaManager.mTextureView.setRotation(extra);
        mCacheImageView.setRotation(extra);
        Log.i(TAG, "MEDIA_INFO_VIDEO_ROTATION_CHANGED");
    }
}
 
Example 2
Source File: DefaultMediaController.java    From GiraffePlayer2 with Apache License 2.0 6 votes vote down vote up
@Override
    public boolean onInfo(GiraffePlayer giraffePlayer, int what, int extra) {
        switch (what) {
            case IMediaPlayer.MEDIA_INFO_BUFFERING_START:
                statusChange(STATUS_LOADING);
                break;
            case IMediaPlayer.MEDIA_INFO_BUFFERING_END:
                statusChange(STATUS_PLAYING);
                break;
            case IMediaPlayer.MEDIA_INFO_NETWORK_BANDWIDTH:
                //显示 下载速度
//                        Toaster.show("download rate:" + extra);
                break;
            case IMediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START:
                statusChange(STATUS_PLAYING);
                break;

            default:
        }

        return true;
    }
 
Example 3
Source File: XLVideoPlayActivity.java    From TVRemoteIME with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean onInfo(IMediaPlayer iMediaPlayer, int i, int i1) {
    switch (i) {
        case IMediaPlayer.MEDIA_INFO_BUFFERING_START:
            if(isLive){
                isLiveRestarted = false;
                Log.d(TAG, "MSG:MESSAGE_LIVE_RESTART -> begin");
                handler.sendEmptyMessageDelayed(MESSAGE_LIVE_RESTART, 3000);
            }
            statusChange(STATUS_LOADING);
            break;
        case IMediaPlayer.MEDIA_INFO_BUFFERING_END:
            if(isLive && !isLiveRestarted) {
                Log.d(TAG, "MSG:MESSAGE_LIVE_RESTART -> remove");
                handler.removeMessages(MESSAGE_LIVE_RESTART);
            }
            statusChange(STATUS_PLAYING);
            break;
        case IMediaPlayer.MEDIA_INFO_NETWORK_BANDWIDTH:
            //显示下载速度
            Log.i(TAG,"onInfo : i=" + i + ",i1=" + i1);
            break;
        case IMediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START:
            statusChange(STATUS_PLAYING);
            break;
    }
    return false;
}
 
Example 4
Source File: ParsingMediaManager.java    From ParsingPlayer with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public void onInfo(int arg1) {
    if (mStateChangeListener.get() == null)
        return;
    if (arg1 == IMediaPlayer.MEDIA_INFO_BUFFERING_START) {
        mStateChangeListener.get().onBufferingStart();
    } else if (arg1 == IMediaPlayer.MEDIA_INFO_BUFFERING_END) {
        mStateChangeListener.get().onBufferingEnd();
    }
}
 
Example 5
Source File: BaseIjkVideoView.java    From youqu_master with Apache License 2.0 5 votes vote down vote up
@Override
public void onInfo(int what, int extra) {
    switch (what) {
        case IMediaPlayer.MEDIA_INFO_BUFFERING_START:
            setPlayState(STATE_BUFFERING);
            break;
        case IMediaPlayer.MEDIA_INFO_BUFFERING_END:
            setPlayState(STATE_BUFFERED);
            break;
        case IjkMediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START: // 视频开始渲染
            setPlayState(STATE_PLAYING);
            if (getWindowVisibility() != VISIBLE) pause();
            break;
    }
}
 
Example 6
Source File: PlayerView.java    From VRPlayer with Apache License 2.0 4 votes vote down vote up
public boolean onInfo(IMediaPlayer mp, int arg1, int arg2) {
    if (mOnInfoListener != null) {
        mOnInfoListener.onInfo(mp, arg1, arg2);
    }
    switch (arg1) {
        case IMediaPlayer.MEDIA_INFO_VIDEO_TRACK_LAGGING:
            Log.d(TAG, "MEDIA_INFO_VIDEO_TRACK_LAGGING:");
            break;
        case IMediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START:
            Log.d(TAG, "MEDIA_INFO_VIDEO_RENDERING_START:");
            break;
        case IMediaPlayer.MEDIA_INFO_BUFFERING_START:
            Log.d(TAG, "MEDIA_INFO_BUFFERING_START:");
            break;
        case IMediaPlayer.MEDIA_INFO_BUFFERING_END:
            Log.d(TAG, "MEDIA_INFO_BUFFERING_END:");
            break;
        case IMediaPlayer.MEDIA_INFO_NETWORK_BANDWIDTH:
            Log.d(TAG, "MEDIA_INFO_NETWORK_BANDWIDTH: " + arg2);
            break;
        case IMediaPlayer.MEDIA_INFO_BAD_INTERLEAVING:
            Log.d(TAG, "MEDIA_INFO_BAD_INTERLEAVING:");
            break;
        case IMediaPlayer.MEDIA_INFO_NOT_SEEKABLE:
            Log.d(TAG, "MEDIA_INFO_NOT_SEEKABLE:");
            break;
        case IMediaPlayer.MEDIA_INFO_METADATA_UPDATE:
            Log.d(TAG, "MEDIA_INFO_METADATA_UPDATE:");
            break;
        case IMediaPlayer.MEDIA_INFO_UNSUPPORTED_SUBTITLE:
            Log.d(TAG, "MEDIA_INFO_UNSUPPORTED_SUBTITLE:");
            break;
        case IMediaPlayer.MEDIA_INFO_SUBTITLE_TIMED_OUT:
            Log.d(TAG, "MEDIA_INFO_SUBTITLE_TIMED_OUT:");
            break;
        case IMediaPlayer.MEDIA_INFO_VIDEO_ROTATION_CHANGED:
            Log.d(TAG, "MEDIA_INFO_VIDEO_ROTATION_CHANGED: " + arg2);
            break;
        case IMediaPlayer.MEDIA_INFO_AUDIO_RENDERING_START:
            Log.d(TAG, "MEDIA_INFO_AUDIO_RENDERING_START:");
            break;
    }
    return true;
}
 
Example 7
Source File: IjkVideoView.java    From ZZShow with Apache License 2.0 4 votes vote down vote up
public boolean onInfo(IMediaPlayer mp, int arg1, int arg2) {
    if (mOnInfoListener != null) {
        mOnInfoListener.onInfo(mp, arg1, arg2);
    }
    switch (arg1) {
        case IMediaPlayer.MEDIA_INFO_VIDEO_TRACK_LAGGING:
            Log.d(TAG, "MEDIA_INFO_VIDEO_TRACK_LAGGING:");
            break;
        case IMediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START:
            Log.d(TAG, "MEDIA_INFO_VIDEO_RENDERING_START:");
            break;
        case IMediaPlayer.MEDIA_INFO_BUFFERING_START:
            Log.d(TAG, "MEDIA_INFO_BUFFERING_START:");
            break;
        case IMediaPlayer.MEDIA_INFO_BUFFERING_END:
            Log.d(TAG, "MEDIA_INFO_BUFFERING_END:");
            break;
        case IMediaPlayer.MEDIA_INFO_NETWORK_BANDWIDTH:
            Log.d(TAG, "MEDIA_INFO_NETWORK_BANDWIDTH: " + arg2);
            break;
        case IMediaPlayer.MEDIA_INFO_BAD_INTERLEAVING:
            Log.d(TAG, "MEDIA_INFO_BAD_INTERLEAVING:");
            break;
        case IMediaPlayer.MEDIA_INFO_NOT_SEEKABLE:
            Log.d(TAG, "MEDIA_INFO_NOT_SEEKABLE:");
            break;
        case IMediaPlayer.MEDIA_INFO_METADATA_UPDATE:
            Log.d(TAG, "MEDIA_INFO_METADATA_UPDATE:");
            break;
        case IMediaPlayer.MEDIA_INFO_UNSUPPORTED_SUBTITLE:
            Log.d(TAG, "MEDIA_INFO_UNSUPPORTED_SUBTITLE:");
            break;
        case IMediaPlayer.MEDIA_INFO_SUBTITLE_TIMED_OUT:
            Log.d(TAG, "MEDIA_INFO_SUBTITLE_TIMED_OUT:");
            break;
        case IMediaPlayer.MEDIA_INFO_VIDEO_ROTATION_CHANGED:
            mVideoRotationDegree = arg2;
            Log.d(TAG, "MEDIA_INFO_VIDEO_ROTATION_CHANGED: " + arg2);
            if (mRenderView != null)
                mRenderView.setVideoRotation(arg2);
            break;
        case IMediaPlayer.MEDIA_INFO_AUDIO_RENDERING_START:
            Log.d(TAG, "MEDIA_INFO_AUDIO_RENDERING_START:");
            break;
    }
    return true;
}
 
Example 8
Source File: IjkVideoView.java    From MD with Apache License 2.0 4 votes vote down vote up
public boolean onInfo(IMediaPlayer mp, int arg1, int arg2) {
    if (mOnInfoListener != null) {
        mOnInfoListener.onInfo(mp, arg1, arg2);
    }
    switch (arg1) {
        case IMediaPlayer.MEDIA_INFO_VIDEO_TRACK_LAGGING:
            Log.d(TAG, "MEDIA_INFO_VIDEO_TRACK_LAGGING:");
            break;
        case IMediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START:
            Log.d(TAG, "MEDIA_INFO_VIDEO_RENDERING_START:");
            break;
        case IMediaPlayer.MEDIA_INFO_BUFFERING_START:
            Log.d(TAG, "MEDIA_INFO_BUFFERING_START:");
            break;
        case IMediaPlayer.MEDIA_INFO_BUFFERING_END:
            Log.d(TAG, "MEDIA_INFO_BUFFERING_END:");
            break;
        case IMediaPlayer.MEDIA_INFO_NETWORK_BANDWIDTH:
            Log.d(TAG, "MEDIA_INFO_NETWORK_BANDWIDTH: " + arg2);
            break;
        case IMediaPlayer.MEDIA_INFO_BAD_INTERLEAVING:
            Log.d(TAG, "MEDIA_INFO_BAD_INTERLEAVING:");
            break;
        case IMediaPlayer.MEDIA_INFO_NOT_SEEKABLE:
            Log.d(TAG, "MEDIA_INFO_NOT_SEEKABLE:");
            break;
        case IMediaPlayer.MEDIA_INFO_METADATA_UPDATE:
            Log.d(TAG, "MEDIA_INFO_METADATA_UPDATE:");
            break;
        case IMediaPlayer.MEDIA_INFO_UNSUPPORTED_SUBTITLE:
            Log.d(TAG, "MEDIA_INFO_UNSUPPORTED_SUBTITLE:");
            break;
        case IMediaPlayer.MEDIA_INFO_SUBTITLE_TIMED_OUT:
            Log.d(TAG, "MEDIA_INFO_SUBTITLE_TIMED_OUT:");
            break;
        case IMediaPlayer.MEDIA_INFO_VIDEO_ROTATION_CHANGED:
            mVideoRotationDegree = arg2;
            Log.d(TAG, "MEDIA_INFO_VIDEO_ROTATION_CHANGED: " + arg2);
            if (mRenderView != null)
                mRenderView.setVideoRotation(arg2);
            break;
        case IMediaPlayer.MEDIA_INFO_AUDIO_RENDERING_START:
            Log.d(TAG, "MEDIA_INFO_AUDIO_RENDERING_START:");
            break;
    }
    return true;
}
 
Example 9
Source File: IjkVideoView.java    From LivePlayback with Apache License 2.0 4 votes vote down vote up
public boolean onInfo(IMediaPlayer mp, int arg1, int arg2) {
    if (mOnInfoListener != null) {
        mOnInfoListener.onInfo(mp, arg1, arg2);
    }
    switch (arg1) {
        case IMediaPlayer.MEDIA_INFO_VIDEO_TRACK_LAGGING:
            Log.d(TAG, "MEDIA_INFO_VIDEO_TRACK_LAGGING:");
            break;
        case IMediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START:
            Log.d(TAG, "MEDIA_INFO_VIDEO_RENDERING_START:");
            break;
        case IMediaPlayer.MEDIA_INFO_BUFFERING_START:
            Log.d(TAG, "MEDIA_INFO_BUFFERING_START:");
            break;
        case IMediaPlayer.MEDIA_INFO_BUFFERING_END:
            Log.d(TAG, "MEDIA_INFO_BUFFERING_END:");
            break;
        case IMediaPlayer.MEDIA_INFO_NETWORK_BANDWIDTH:
            Log.d(TAG, "MEDIA_INFO_NETWORK_BANDWIDTH: " + arg2);
            break;
        case IMediaPlayer.MEDIA_INFO_BAD_INTERLEAVING:
            Log.d(TAG, "MEDIA_INFO_BAD_INTERLEAVING:");
            break;
        case IMediaPlayer.MEDIA_INFO_NOT_SEEKABLE:
            Log.d(TAG, "MEDIA_INFO_NOT_SEEKABLE:");
            break;
        case IMediaPlayer.MEDIA_INFO_METADATA_UPDATE:
            Log.d(TAG, "MEDIA_INFO_METADATA_UPDATE:");
            break;
        case IMediaPlayer.MEDIA_INFO_UNSUPPORTED_SUBTITLE:
            Log.d(TAG, "MEDIA_INFO_UNSUPPORTED_SUBTITLE:");
            break;
        case IMediaPlayer.MEDIA_INFO_SUBTITLE_TIMED_OUT:
            Log.d(TAG, "MEDIA_INFO_SUBTITLE_TIMED_OUT:");
            break;
        case IMediaPlayer.MEDIA_INFO_VIDEO_ROTATION_CHANGED:
            mVideoRotationDegree = arg2;
            Log.d(TAG, "MEDIA_INFO_VIDEO_ROTATION_CHANGED: " + arg2);
            if (mRenderView != null)
                mRenderView.setVideoRotation(arg2);
            break;
        case IMediaPlayer.MEDIA_INFO_AUDIO_RENDERING_START:
            Log.d(TAG, "MEDIA_INFO_AUDIO_RENDERING_START:");
            break;
    }
    return true;
}
 
Example 10
Source File: IjkVideoView.java    From TvPlayer with Apache License 2.0 4 votes vote down vote up
public boolean onInfo(IMediaPlayer mp, int arg1, int arg2) {
    if (mOnInfoListener != null) {
        mOnInfoListener.onInfo(mp, arg1, arg2);
    }
    switch (arg1) {
        case IMediaPlayer.MEDIA_INFO_VIDEO_TRACK_LAGGING:
            Log.d(TAG, "MEDIA_INFO_VIDEO_TRACK_LAGGING:");
            break;
        case IMediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START:
            Log.d(TAG, "MEDIA_INFO_VIDEO_RENDERING_START:");
            break;
        case IMediaPlayer.MEDIA_INFO_BUFFERING_START:
            Log.d(TAG, "MEDIA_INFO_BUFFERING_START:");
            break;
        case IMediaPlayer.MEDIA_INFO_BUFFERING_END:
            Log.d(TAG, "MEDIA_INFO_BUFFERING_END:");
            break;
        case IMediaPlayer.MEDIA_INFO_NETWORK_BANDWIDTH:
            Log.d(TAG, "MEDIA_INFO_NETWORK_BANDWIDTH: " + arg2);
            break;
        case IMediaPlayer.MEDIA_INFO_BAD_INTERLEAVING:
            Log.d(TAG, "MEDIA_INFO_BAD_INTERLEAVING:");
            break;
        case IMediaPlayer.MEDIA_INFO_NOT_SEEKABLE:
            Log.d(TAG, "MEDIA_INFO_NOT_SEEKABLE:");
            break;
        case IMediaPlayer.MEDIA_INFO_METADATA_UPDATE:
            Log.d(TAG, "MEDIA_INFO_METADATA_UPDATE:");
            break;
        case IMediaPlayer.MEDIA_INFO_UNSUPPORTED_SUBTITLE:
            Log.d(TAG, "MEDIA_INFO_UNSUPPORTED_SUBTITLE:");
            break;
        case IMediaPlayer.MEDIA_INFO_SUBTITLE_TIMED_OUT:
            Log.d(TAG, "MEDIA_INFO_SUBTITLE_TIMED_OUT:");
            break;
        case IMediaPlayer.MEDIA_INFO_VIDEO_ROTATION_CHANGED:
            mVideoRotationDegree = arg2;
            Log.d(TAG, "MEDIA_INFO_VIDEO_ROTATION_CHANGED: " + arg2);
            if (mRenderView != null)
                mRenderView.setVideoRotation(arg2);
            break;
        case IMediaPlayer.MEDIA_INFO_AUDIO_RENDERING_START:
            Log.d(TAG, "MEDIA_INFO_AUDIO_RENDERING_START:");
            break;
    }
    return true;
}
 
Example 11
Source File: VideoMediaPlayer.java    From YCVideoPlayer with Apache License 2.0 4 votes vote down vote up
@Override
public boolean onInfo(IMediaPlayer mp, int what, int extra) {
    if (what == IMediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START) {
        // 播放器开始渲染
        videoPlayer.setCurrentState(ConstantKeys.CurrentState.STATE_PLAYING);
        videoPlayer.getController().onPlayStateChanged(videoPlayer.getCurrentState());
        VideoLogUtil.d("listener---------onInfo ——> MEDIA_INFO_VIDEO_RENDERING_START:STATE_PLAYING");
    } else if (what == IMediaPlayer.MEDIA_INFO_BUFFERING_START) {
        // MediaPlayer暂时不播放,以缓冲更多的数据
        if (videoPlayer.getCurrentState() == ConstantKeys.CurrentState.STATE_PAUSED ||
                videoPlayer.getCurrentState() == ConstantKeys.CurrentState.STATE_BUFFERING_PAUSED) {
            videoPlayer.setCurrentState(ConstantKeys.CurrentState.STATE_BUFFERING_PAUSED);
            VideoLogUtil.d("listener---------onInfo ——> MEDIA_INFO_BUFFERING_START:STATE_BUFFERING_PAUSED");
        } else {
            videoPlayer.setCurrentState(ConstantKeys.CurrentState.STATE_BUFFERING_PLAYING);
            VideoLogUtil.d("listener---------onInfo ——> MEDIA_INFO_BUFFERING_START:STATE_BUFFERING_PLAYING");
        }
        videoPlayer.getController().onPlayStateChanged(videoPlayer.getCurrentState());
    } else if (what == IMediaPlayer.MEDIA_INFO_BUFFERING_END) {
        // 填充缓冲区后,MediaPlayer恢复播放/暂停
        if (videoPlayer.getCurrentState() == ConstantKeys.CurrentState.STATE_BUFFERING_PLAYING) {
            videoPlayer.setCurrentState(ConstantKeys.CurrentState.STATE_PLAYING);
            videoPlayer.getController().onPlayStateChanged(videoPlayer.getCurrentState());
            VideoLogUtil.d("listener---------onInfo ——> MEDIA_INFO_BUFFERING_END: STATE_PLAYING");
        }
        if (videoPlayer.getCurrentState() == ConstantKeys.CurrentState.STATE_BUFFERING_PAUSED) {
            videoPlayer.setCurrentState(ConstantKeys.CurrentState.STATE_PAUSED);
            videoPlayer.getController().onPlayStateChanged(videoPlayer.getCurrentState());
            VideoLogUtil.d("listener---------onInfo ——> MEDIA_INFO_BUFFERING_END: STATE_PAUSED");
        }
    } else if (what == IMediaPlayer.MEDIA_INFO_VIDEO_ROTATION_CHANGED) {
        // 视频旋转了extra度,需要恢复
        if (mTextureView != null) {
            mTextureView.setRotation(extra);
            VideoLogUtil.d("listener---------视频旋转角度:" + extra);
        }
    } else if (what == IMediaPlayer.MEDIA_INFO_NOT_SEEKABLE) {
        VideoLogUtil.d("listener---------视频不能seekTo,为直播视频");
    } else {
        VideoLogUtil.d("listener---------onInfo ——> what:" + what);
    }
    return true;
}
 
Example 12
Source File: IjkPlayer.java    From PlayerBase with Apache License 2.0 4 votes vote down vote up
public boolean onInfo(IMediaPlayer mp, int arg1, int arg2) {
    switch (arg1) {
        case IMediaPlayer.MEDIA_INFO_VIDEO_TRACK_LAGGING:
            PLog.d(TAG, "MEDIA_INFO_VIDEO_TRACK_LAGGING:");
            break;
        case IMediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START:
            PLog.d(TAG, "MEDIA_INFO_VIDEO_RENDERING_START");
            startSeekPos = 0;
            submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_VIDEO_RENDER_START,null);
            break;
        case IMediaPlayer.MEDIA_INFO_BUFFERING_START:
            PLog.d(TAG, "MEDIA_INFO_BUFFERING_START:");
            submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_BUFFERING_START,null);
            break;
        case IMediaPlayer.MEDIA_INFO_BUFFERING_END:
            PLog.d(TAG, "MEDIA_INFO_BUFFERING_END:");
            submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_BUFFERING_END,null);
            break;
        case IMediaPlayer.MEDIA_INFO_NETWORK_BANDWIDTH:
            //not support
            break;
        case IMediaPlayer.MEDIA_INFO_BAD_INTERLEAVING:
            PLog.d(TAG, "MEDIA_INFO_BAD_INTERLEAVING:");
            submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_BAD_INTERLEAVING,null);
            break;
        case IMediaPlayer.MEDIA_INFO_NOT_SEEKABLE:
            PLog.d(TAG, "MEDIA_INFO_NOT_SEEKABLE:");
            submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_NOT_SEEK_ABLE,null);
            break;
        case IMediaPlayer.MEDIA_INFO_METADATA_UPDATE:
            PLog.d(TAG, "MEDIA_INFO_METADATA_UPDATE:");
            submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_METADATA_UPDATE,null);
            break;
        case IMediaPlayer.MEDIA_INFO_TIMED_TEXT_ERROR:
            PLog.d(TAG, "MEDIA_INFO_TIMED_TEXT_ERROR:");
            submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_TIMED_TEXT_ERROR,null);
            break;
        case IMediaPlayer.MEDIA_INFO_UNSUPPORTED_SUBTITLE:
            PLog.d(TAG, "MEDIA_INFO_UNSUPPORTED_SUBTITLE:");
            submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_UNSUPPORTED_SUBTITLE,null);
            break;
        case IMediaPlayer.MEDIA_INFO_SUBTITLE_TIMED_OUT:
            PLog.d(TAG, "MEDIA_INFO_SUBTITLE_TIMED_OUT:");
            submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_SUBTITLE_TIMED_OUT,null);
            break;
        case IMediaPlayer.MEDIA_INFO_VIDEO_ROTATION_CHANGED:
            PLog.d(TAG, "MEDIA_INFO_VIDEO_ROTATION_CHANGED: " + arg2);
            Bundle bundle = BundlePool.obtain();
            bundle.putInt(EventKey.INT_DATA,arg2);
            submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_VIDEO_ROTATION_CHANGED,bundle);
            break;
        case IMediaPlayer.MEDIA_INFO_AUDIO_RENDERING_START:
            PLog.d(TAG, "MEDIA_INFO_AUDIO_RENDERING_START:");
            submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_AUDIO_RENDER_START,null);
            break;
        case IMediaPlayer.MEDIA_INFO_AUDIO_DECODED_START:
            PLog.d(TAG, "MEDIA_INFO_AUDIO_DECODED_START:");
            submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_AUDIO_DECODER_START,null);
            break;
        case IMediaPlayer.MEDIA_INFO_AUDIO_SEEK_RENDERING_START:
            PLog.d(TAG, "MEDIA_INFO_AUDIO_SEEK_RENDERING_START:");
            submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_AUDIO_SEEK_RENDERING_START,null);
            break;
    }
    return true;
}
 
Example 13
Source File: IjkVideoView.java    From ShareBox with Apache License 2.0 4 votes vote down vote up
public boolean onInfo(IMediaPlayer mp, int arg1, int arg2) {
    if (mOnInfoListener != null) {
        mOnInfoListener.onInfo(mp, arg1, arg2);
    }
    switch (arg1) {
        case IMediaPlayer.MEDIA_INFO_VIDEO_TRACK_LAGGING:
            Log.d(TAG, "MEDIA_INFO_VIDEO_TRACK_LAGGING:");
            break;
        case IMediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START:
            Log.d(TAG, "MEDIA_INFO_VIDEO_RENDERING_START:");
            break;
        case IMediaPlayer.MEDIA_INFO_BUFFERING_START:
            Log.d(TAG, "MEDIA_INFO_BUFFERING_START:");
            break;
        case IMediaPlayer.MEDIA_INFO_BUFFERING_END:
            Log.d(TAG, "MEDIA_INFO_BUFFERING_END:");
            break;
        case IMediaPlayer.MEDIA_INFO_NETWORK_BANDWIDTH:
            Log.d(TAG, "MEDIA_INFO_NETWORK_BANDWIDTH: " + arg2);
            break;
        case IMediaPlayer.MEDIA_INFO_BAD_INTERLEAVING:
            Log.d(TAG, "MEDIA_INFO_BAD_INTERLEAVING:");
            break;
        case IMediaPlayer.MEDIA_INFO_NOT_SEEKABLE:
            Log.d(TAG, "MEDIA_INFO_NOT_SEEKABLE:");
            break;
        case IMediaPlayer.MEDIA_INFO_METADATA_UPDATE:
            Log.d(TAG, "MEDIA_INFO_METADATA_UPDATE:");
            break;
        case IMediaPlayer.MEDIA_INFO_UNSUPPORTED_SUBTITLE:
            Log.d(TAG, "MEDIA_INFO_UNSUPPORTED_SUBTITLE:");
            break;
        case IMediaPlayer.MEDIA_INFO_SUBTITLE_TIMED_OUT:
            Log.d(TAG, "MEDIA_INFO_SUBTITLE_TIMED_OUT:");
            break;
        case IMediaPlayer.MEDIA_INFO_VIDEO_ROTATION_CHANGED:
            mVideoRotationDegree = arg2;
            Log.d(TAG, "MEDIA_INFO_VIDEO_ROTATION_CHANGED: " + arg2);
            if (mRenderView != null)
                mRenderView.setVideoRotation(arg2);
            break;
        case IMediaPlayer.MEDIA_INFO_AUDIO_RENDERING_START:
            Log.d(TAG, "MEDIA_INFO_AUDIO_RENDERING_START:");
            break;
    }
    return true;
}
 
Example 14
Source File: IjkVideoView.java    From AndroidTvDemo with Apache License 2.0 4 votes vote down vote up
public boolean onInfo(IMediaPlayer mp, int arg1, int arg2)
{
    if (mOnInfoListener != null)
    {
        mOnInfoListener.onInfo(mp, arg1, arg2);
    }
    switch (arg1)
    {
        case IMediaPlayer.MEDIA_INFO_VIDEO_TRACK_LAGGING:
            Log.d(TAG, "MEDIA_INFO_VIDEO_TRACK_LAGGING:");
            break;
        case IMediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START:
            Log.d(TAG, "MEDIA_INFO_VIDEO_RENDERING_START:");
            break;
        case IMediaPlayer.MEDIA_INFO_BUFFERING_START:
            Log.d(TAG, "MEDIA_INFO_BUFFERING_START:");
            break;
        case IMediaPlayer.MEDIA_INFO_BUFFERING_END:
            Log.d(TAG, "MEDIA_INFO_BUFFERING_END:");
            break;
        case IMediaPlayer.MEDIA_INFO_NETWORK_BANDWIDTH:
            Log.d(TAG, "MEDIA_INFO_NETWORK_BANDWIDTH: " + arg2);
            break;
        case IMediaPlayer.MEDIA_INFO_BAD_INTERLEAVING:
            Log.d(TAG, "MEDIA_INFO_BAD_INTERLEAVING:");
            break;
        case IMediaPlayer.MEDIA_INFO_NOT_SEEKABLE:
            Log.d(TAG, "MEDIA_INFO_NOT_SEEKABLE:");
            break;
        case IMediaPlayer.MEDIA_INFO_METADATA_UPDATE:
            Log.d(TAG, "MEDIA_INFO_METADATA_UPDATE:");
            break;
        case IMediaPlayer.MEDIA_INFO_UNSUPPORTED_SUBTITLE:
            Log.d(TAG, "MEDIA_INFO_UNSUPPORTED_SUBTITLE:");
            break;
        case IMediaPlayer.MEDIA_INFO_SUBTITLE_TIMED_OUT:
            Log.d(TAG, "MEDIA_INFO_SUBTITLE_TIMED_OUT:");
            break;
        case IMediaPlayer.MEDIA_INFO_VIDEO_ROTATION_CHANGED:
            mVideoRotationDegree = arg2;
            Log.d(TAG, "MEDIA_INFO_VIDEO_ROTATION_CHANGED: " + arg2);
            if (mRenderView != null)
                mRenderView.setVideoRotation(arg2);
            break;
        case IMediaPlayer.MEDIA_INFO_AUDIO_RENDERING_START:
            Log.d(TAG, "MEDIA_INFO_AUDIO_RENDERING_START:");
            break;
    }
    return true;
}
 
Example 15
Source File: IjkPlayerView.java    From DanDanPlayForAndroid with MIT License 4 votes vote down vote up
/**
 * 视频播放状态处理
 */
private void _switchStatus(int status) {
    switch (status) {
        case IMediaPlayer.MEDIA_INFO_BUFFERING_START:
            mIsIjkPlayerReady = false;
            _pauseDanmaku();
            if (!mIsNeverPlay) {
                mLoadingView.setVisibility(View.VISIBLE);
            }
        case MediaPlayerParams.STATE_PREPARING:
            break;

        case IMediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START:
            mIsRenderingStart = true;
        case IMediaPlayer.MEDIA_INFO_BUFFERING_END:
            mIsIjkPlayerReady = true;
            mLoadingView.setVisibility(View.GONE);
            // 更新进度
            mHandler.sendEmptyMessage(MSG_UPDATE_SEEK);
            if (mSkipPosition != INVALID_VALUE) {
                _showSkipTip(); // 显示跳转提示
            }
            if (mVideoView.isPlaying()) {
                _resumeDanmaku();   // 开启弹幕
            }
            break;

        case MediaPlayerParams.STATE_PLAYING:
            if (mIsRenderingStart && mIsIjkPlayerReady) {
                _resumeDanmaku();   // 开启弹幕
            }
            break;
        case MediaPlayerParams.STATE_ERROR:
            _pauseDanmaku();
            break;
        case MediaPlayerParams.STATE_COMPLETED:
            pause();
            mIsPlayComplete = true;
            break;
    }
}
 
Example 16
Source File: IjkVideoView.java    From DanDanPlayForAndroid with MIT License 4 votes vote down vote up
public boolean onInfo(IMediaPlayer mp, int arg1, int arg2) {
    if (mOnInfoListener != null) {
        mOnInfoListener.onInfo(mp, arg1, arg2);
    }
    switch (arg1) {
        case IMediaPlayer.MEDIA_INFO_VIDEO_TRACK_LAGGING:
            Log.d(TAG, "MEDIA_INFO_VIDEO_TRACK_LAGGING:");
            break;
        case IMediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START:
            Log.d(TAG, "MEDIA_INFO_VIDEO_RENDERING_START:");
            break;
        case IMediaPlayer.MEDIA_INFO_BUFFERING_START:
            Log.d(TAG, "MEDIA_INFO_BUFFERING_START:");
            break;
        case IMediaPlayer.MEDIA_INFO_BUFFERING_END:
            Log.d(TAG, "MEDIA_INFO_BUFFERING_END:");
            break;
        case IMediaPlayer.MEDIA_INFO_NETWORK_BANDWIDTH:
            Log.d(TAG, "MEDIA_INFO_NETWORK_BANDWIDTH: " + arg2);
            break;
        case IMediaPlayer.MEDIA_INFO_BAD_INTERLEAVING:
            Log.d(TAG, "MEDIA_INFO_BAD_INTERLEAVING:");
            break;
        case IMediaPlayer.MEDIA_INFO_NOT_SEEKABLE:
            Log.d(TAG, "MEDIA_INFO_NOT_SEEKABLE:");
            break;
        case IMediaPlayer.MEDIA_INFO_METADATA_UPDATE:
            Log.d(TAG, "MEDIA_INFO_METADATA_UPDATE:");
            break;
        case IMediaPlayer.MEDIA_INFO_UNSUPPORTED_SUBTITLE:
            Log.d(TAG, "MEDIA_INFO_UNSUPPORTED_SUBTITLE:");
            break;
        case IMediaPlayer.MEDIA_INFO_SUBTITLE_TIMED_OUT:
            Log.d(TAG, "MEDIA_INFO_SUBTITLE_TIMED_OUT:");
            break;
        case IMediaPlayer.MEDIA_INFO_VIDEO_ROTATION_CHANGED:
            mVideoRotationDegree = arg2;
            Log.d(TAG, "MEDIA_INFO_VIDEO_ROTATION_CHANGED: " + arg2);
            if (mRenderView != null)
                mRenderView.setVideoRotation(arg2);
            break;
        case IMediaPlayer.MEDIA_INFO_AUDIO_RENDERING_START:
            Log.d(TAG, "MEDIA_INFO_AUDIO_RENDERING_START:");
            break;
    }
    return true;
}
 
Example 17
Source File: IjkVideoView.java    From WliveTV with Apache License 2.0 4 votes vote down vote up
public boolean onInfo(IMediaPlayer mp, int arg1, int arg2) {
    if (mOnInfoListener != null) {
        mOnInfoListener.onInfo(mp, arg1, arg2);
    }
    switch (arg1) {
        case IMediaPlayer.MEDIA_INFO_VIDEO_TRACK_LAGGING:
            Log.d(TAG, "MEDIA_INFO_VIDEO_TRACK_LAGGING:");
            break;
        case IMediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START:
            Log.d(TAG, "MEDIA_INFO_VIDEO_RENDERING_START:");
            break;
        case IMediaPlayer.MEDIA_INFO_BUFFERING_START:
            Log.d(TAG, "MEDIA_INFO_BUFFERING_START:");
            break;
        case IMediaPlayer.MEDIA_INFO_BUFFERING_END:
            Log.d(TAG, "MEDIA_INFO_BUFFERING_END:");
            break;
        case IMediaPlayer.MEDIA_INFO_NETWORK_BANDWIDTH:
            Log.d(TAG, "MEDIA_INFO_NETWORK_BANDWIDTH: " + arg2);
            break;
        case IMediaPlayer.MEDIA_INFO_BAD_INTERLEAVING:
            Log.d(TAG, "MEDIA_INFO_BAD_INTERLEAVING:");
            break;
        case IMediaPlayer.MEDIA_INFO_NOT_SEEKABLE:
            Log.d(TAG, "MEDIA_INFO_NOT_SEEKABLE:");
            break;
        case IMediaPlayer.MEDIA_INFO_METADATA_UPDATE:
            Log.d(TAG, "MEDIA_INFO_METADATA_UPDATE:");
            break;
        case IMediaPlayer.MEDIA_INFO_UNSUPPORTED_SUBTITLE:
            Log.d(TAG, "MEDIA_INFO_UNSUPPORTED_SUBTITLE:");
            break;
        case IMediaPlayer.MEDIA_INFO_SUBTITLE_TIMED_OUT:
            Log.d(TAG, "MEDIA_INFO_SUBTITLE_TIMED_OUT:");
            break;
        case IMediaPlayer.MEDIA_INFO_VIDEO_ROTATION_CHANGED:
            mVideoRotationDegree = arg2;
            Log.d(TAG, "MEDIA_INFO_VIDEO_ROTATION_CHANGED: " + arg2);
            if (mRenderView != null)
                mRenderView.setVideoRotation(arg2);
            break;
        case IMediaPlayer.MEDIA_INFO_AUDIO_RENDERING_START:
            Log.d(TAG, "MEDIA_INFO_AUDIO_RENDERING_START:");
            break;
    }
    return true;
}
 
Example 18
Source File: IjkVideoView.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
public boolean onInfo(IMediaPlayer mp, int arg1, int arg2) {
    if (mOnInfoListener != null) {
        mOnInfoListener.onInfo(mp, arg1, arg2);
    }
    switch (arg1) {
        case IMediaPlayer.MEDIA_INFO_VIDEO_TRACK_LAGGING:
            Log.d(TAG, "MEDIA_INFO_VIDEO_TRACK_LAGGING:");
            break;
        case IMediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START:
            Log.d(TAG, "MEDIA_INFO_VIDEO_RENDERING_START:");
            break;
        case IMediaPlayer.MEDIA_INFO_BUFFERING_START:
            Log.d(TAG, "MEDIA_INFO_BUFFERING_START:");
            break;
        case IMediaPlayer.MEDIA_INFO_BUFFERING_END:
            Log.d(TAG, "MEDIA_INFO_BUFFERING_END:");
            break;
        case IMediaPlayer.MEDIA_INFO_NETWORK_BANDWIDTH:
            Log.d(TAG, "MEDIA_INFO_NETWORK_BANDWIDTH: " + arg2);
            break;
        case IMediaPlayer.MEDIA_INFO_BAD_INTERLEAVING:
            Log.d(TAG, "MEDIA_INFO_BAD_INTERLEAVING:");
            break;
        case IMediaPlayer.MEDIA_INFO_NOT_SEEKABLE:
            Log.d(TAG, "MEDIA_INFO_NOT_SEEKABLE:");
            break;
        case IMediaPlayer.MEDIA_INFO_METADATA_UPDATE:
            Log.d(TAG, "MEDIA_INFO_METADATA_UPDATE:");
            break;
        case IMediaPlayer.MEDIA_INFO_UNSUPPORTED_SUBTITLE:
            Log.d(TAG, "MEDIA_INFO_UNSUPPORTED_SUBTITLE:");
            break;
        case IMediaPlayer.MEDIA_INFO_SUBTITLE_TIMED_OUT:
            Log.d(TAG, "MEDIA_INFO_SUBTITLE_TIMED_OUT:");
            break;
        case IMediaPlayer.MEDIA_INFO_VIDEO_ROTATION_CHANGED:
            mVideoRotationDegree = arg2;
            Log.d(TAG, "MEDIA_INFO_VIDEO_ROTATION_CHANGED: " + arg2);
            if (mRenderView != null)
                mRenderView.setVideoRotation(arg2);
            break;
        case IMediaPlayer.MEDIA_INFO_AUDIO_RENDERING_START:
            Log.d(TAG, "MEDIA_INFO_AUDIO_RENDERING_START:");
            break;
    }
    return true;
}
 
Example 19
Source File: IjkPlayer.java    From VideoDemoJava with MIT License 4 votes vote down vote up
public boolean onInfo(IMediaPlayer mp, int arg1, int arg2) {
    switch (arg1) {
        case IMediaPlayer.MEDIA_INFO_VIDEO_TRACK_LAGGING:
            PLog.d(TAG, "MEDIA_INFO_VIDEO_TRACK_LAGGING:");
            break;
        case IMediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START:
            PLog.d(TAG, "MEDIA_INFO_VIDEO_RENDERING_START");
            startSeekPos = 0;
            submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_VIDEO_RENDER_START, null);
            break;
        case IMediaPlayer.MEDIA_INFO_BUFFERING_START:
            PLog.d(TAG, "MEDIA_INFO_BUFFERING_START:");
            submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_BUFFERING_START, null);
            break;
        case IMediaPlayer.MEDIA_INFO_BUFFERING_END:
            PLog.d(TAG, "MEDIA_INFO_BUFFERING_END:");
            submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_BUFFERING_END, null);
            break;
        case IMediaPlayer.MEDIA_INFO_NETWORK_BANDWIDTH:
            //not support
            break;
        case IMediaPlayer.MEDIA_INFO_BAD_INTERLEAVING:
            PLog.d(TAG, "MEDIA_INFO_BAD_INTERLEAVING:");
            submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_BAD_INTERLEAVING, null);
            break;
        case IMediaPlayer.MEDIA_INFO_NOT_SEEKABLE:
            PLog.d(TAG, "MEDIA_INFO_NOT_SEEKABLE:");
            submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_NOT_SEEK_ABLE, null);
            break;
        case IMediaPlayer.MEDIA_INFO_METADATA_UPDATE:
            PLog.d(TAG, "MEDIA_INFO_METADATA_UPDATE:");
            submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_METADATA_UPDATE, null);
            break;
        case IMediaPlayer.MEDIA_INFO_TIMED_TEXT_ERROR:
            PLog.d(TAG, "MEDIA_INFO_TIMED_TEXT_ERROR:");
            submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_TIMED_TEXT_ERROR, null);
            break;
        case IMediaPlayer.MEDIA_INFO_UNSUPPORTED_SUBTITLE:
            PLog.d(TAG, "MEDIA_INFO_UNSUPPORTED_SUBTITLE:");
            submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_UNSUPPORTED_SUBTITLE, null);
            break;
        case IMediaPlayer.MEDIA_INFO_SUBTITLE_TIMED_OUT:
            PLog.d(TAG, "MEDIA_INFO_SUBTITLE_TIMED_OUT:");
            submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_SUBTITLE_TIMED_OUT, null);
            break;
        case IMediaPlayer.MEDIA_INFO_VIDEO_ROTATION_CHANGED:
            PLog.d(TAG, "MEDIA_INFO_VIDEO_ROTATION_CHANGED: " + arg2);
            Bundle bundle = BundlePool.obtain();
            bundle.putInt(EventKey.INT_DATA, arg2);
            submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_VIDEO_ROTATION_CHANGED, bundle);
            break;
        case IMediaPlayer.MEDIA_INFO_AUDIO_RENDERING_START:
            PLog.d(TAG, "MEDIA_INFO_AUDIO_RENDERING_START:");
            submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_AUDIO_RENDER_START, null);
            break;
        case IMediaPlayer.MEDIA_INFO_AUDIO_DECODED_START:
            PLog.d(TAG, "MEDIA_INFO_AUDIO_DECODED_START:");
            submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_AUDIO_DECODER_START, null);
            break;
        case IMediaPlayer.MEDIA_INFO_AUDIO_SEEK_RENDERING_START:
            PLog.d(TAG, "MEDIA_INFO_AUDIO_SEEK_RENDERING_START:");
            submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_AUDIO_SEEK_RENDERING_START, null);
            break;
    }
    return true;
}
 
Example 20
Source File: NiceVideoPlayer.java    From Mrthumb with Apache License 2.0 4 votes vote down vote up
@Override
public boolean onInfo(IMediaPlayer mp, int what, int extra) {
    if (what == IMediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START) {
        // 播放器开始渲染
        mCurrentState = STATE_PLAYING;
        if (mController != null) {
            mController.onPlayStateChanged(mCurrentState);
        }
        LogUtil.d("onInfo ——> MEDIA_INFO_VIDEO_RENDERING_START:STATE_PLAYING");
    } else if (what == IMediaPlayer.MEDIA_INFO_BUFFERING_START) {
        // MediaPlayer暂时不播放,以缓冲更多的数据
        if (mCurrentState == STATE_PAUSED || mCurrentState == STATE_BUFFERING_PAUSED) {
            mCurrentState = STATE_BUFFERING_PAUSED;
            LogUtil.d("onInfo ——> MEDIA_INFO_BUFFERING_START:STATE_BUFFERING_PAUSED");
        } else {
            mCurrentState = STATE_BUFFERING_PLAYING;
            LogUtil.d("onInfo ——> MEDIA_INFO_BUFFERING_START:STATE_BUFFERING_PLAYING");
        }
        if (mController != null) {
            mController.onPlayStateChanged(mCurrentState);
        }
    } else if (what == IMediaPlayer.MEDIA_INFO_BUFFERING_END) {
        // 填充缓冲区后,MediaPlayer恢复播放/暂停
        if (mCurrentState == STATE_BUFFERING_PLAYING) {
            mCurrentState = STATE_PLAYING;
            if (mController != null) {
                mController.onPlayStateChanged(mCurrentState);
            }
            LogUtil.d("onInfo ——> MEDIA_INFO_BUFFERING_END: STATE_PLAYING");
        }
        if (mCurrentState == STATE_BUFFERING_PAUSED) {
            mCurrentState = STATE_PAUSED;
            if (mController != null) {
                mController.onPlayStateChanged(mCurrentState);
            }
            LogUtil.d("onInfo ——> MEDIA_INFO_BUFFERING_END: STATE_PAUSED");
        }
    } else if (what == IMediaPlayer.MEDIA_INFO_VIDEO_ROTATION_CHANGED) {
        // 视频旋转了extra度,需要恢复
        if (mTextureView != null) {
            mTextureView.setRotation(extra);
            LogUtil.d("视频旋转角度:" + extra);
        }
    } else if (what == IMediaPlayer.MEDIA_INFO_NOT_SEEKABLE) {
        LogUtil.d("视频不能seekTo,为直播视频");
    } else {
        LogUtil.d("onInfo ——> what:" + what);
    }
    return true;
}