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

The following examples show how to use tv.danmaku.ijk.media.player.IMediaPlayer#MEDIA_INFO_VIDEO_RENDERING_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: 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 2
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 3
Source File: XVideoView.java    From XPlayer2 with Apache License 2.0 5 votes vote down vote up
@Override
public void onInfo(int what, int extra) {
    if (what == IMediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START) {
        // 视频准备渲染
        showCoverView(false);
    }
}
 
Example 4
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 5
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 6
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 7
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 8
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 9
Source File: ParsingPlayerProxy.java    From ParsingPlayer with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public boolean onInfo(IMediaPlayer mp, int arg1, int arg2) {
    if (mStateListener != null)
        mStateListener.onInfo(arg1);
    switch (arg1) {
        case IMediaPlayer.MEDIA_INFO_VIDEO_TRACK_LAGGING:
            LogUtil.d(TAG, "MEDIA_INFO_VIDEO_TRACK_LAGGING:");
            break;
        case IMediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START:
            LogUtil.d(TAG, "MEDIA_INFO_VIDEO_RENDERING_START:");
            break;
        case IMediaPlayer.MEDIA_INFO_BUFFERING_START:
            LogUtil.d(TAG, "MEDIA_INFO_BUFFERING_START:");
            break;
        case IMediaPlayer.MEDIA_INFO_BUFFERING_END:
            LogUtil.w(TAG, "Bad networking!");
            LogUtil.d(TAG, "MEDIA_INFO_BUFFERING_END:");
            break;
        case IMediaPlayer.MEDIA_INFO_NETWORK_BANDWIDTH:
            LogUtil.d(TAG, "MEDIA_INFO_NETWORK_BANDWIDTH: " + arg2);
            break;
        case IMediaPlayer.MEDIA_INFO_BAD_INTERLEAVING:
            LogUtil.d(TAG, "MEDIA_INFO_BAD_INTERLEAVING:");
            break;
        case IMediaPlayer.MEDIA_INFO_NOT_SEEKABLE:
            LogUtil.d(TAG, "MEDIA_INFO_NOT_SEEKABLE:");
            break;
        case IMediaPlayer.MEDIA_INFO_METADATA_UPDATE:
            LogUtil.d(TAG, "MEDIA_INFO_METADATA_UPDATE:");
            break;
        case IMediaPlayer.MEDIA_INFO_UNSUPPORTED_SUBTITLE:
            LogUtil.d(TAG, "MEDIA_INFO_UNSUPPORTED_SUBTITLE:");
            break;
        case IMediaPlayer.MEDIA_INFO_SUBTITLE_TIMED_OUT:
            LogUtil.d(TAG, "MEDIA_INFO_SUBTITLE_TIMED_OUT:");
            break;
        case IMediaPlayer.MEDIA_INFO_VIDEO_ROTATION_CHANGED:
            LogUtil.d(TAG, "MEDIA_INFO_VIDEO_ROTATION_CHANGED: " + arg2);
            break;
        case IMediaPlayer.MEDIA_INFO_AUDIO_RENDERING_START:
            LogUtil.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: 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;
}
 
Example 15
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 16
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 17
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 18
Source File: XMediaPlayer.java    From XPlayer2 with Apache License 2.0 4 votes vote down vote up
@Override
    public boolean onInfo(IMediaPlayer iMediaPlayer, int what, int extra) {
        if (mMediaPlayerListener != null) {
            mMediaPlayerListener.onInfo(what, extra);
        }

        MLog.i("TTT", "what="+what+"\n extra=" + extra);


//        int MEDIA_INFO_VIDEO_RENDERING_START = 3;//视频准备渲染
//        int MEDIA_INFO_BUFFERING_START = 701;//开始缓冲
//        int MEDIA_INFO_BUFFERING_END = 702;//缓冲结束
//        int MEDIA_INFO_VIDEO_ROTATION_CHANGED = 10001;//视频选择信息
//        int MEDIA_ERROR_SERVER_DIED = 100;//视频中断,一般是视频源异常或者不支持的视频类型。
//        int MEDIA_ERROR_IJK_PLAYER = -10000,//一般是视频源有问题或者数据格式不支持,比如音频不是AAC之类的
//        int MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK = 200;//数据错误没有有效的回收


//        int MEDIA_INFO_UNKNOWN = 1;//未知信息
//        int MEDIA_INFO_STARTED_AS_NEXT = 2;//播放下一条
//        int MEDIA_INFO_VIDEO_RENDERING_START = 3;//视频开始整备中
//        int MEDIA_INFO_VIDEO_TRACK_LAGGING = 700;//视频日志跟踪
//        int MEDIA_INFO_BUFFERING_START = 701;//开始缓冲中
//        int MEDIA_INFO_BUFFERING_END = 702;//缓冲结束
//        int MEDIA_INFO_NETWORK_BANDWIDTH = 703;//网络带宽,网速方面
//        int MEDIA_INFO_BAD_INTERLEAVING = 800;//
//        int MEDIA_INFO_NOT_SEEKABLE = 801;//不可设置播放位置,直播方面
//        int MEDIA_INFO_METADATA_UPDATE = 802;//
//        int MEDIA_INFO_TIMED_TEXT_ERROR = 900;
//        int MEDIA_INFO_UNSUPPORTED_SUBTITLE = 901;//不支持字幕
//        int MEDIA_INFO_SUBTITLE_TIMED_OUT = 902;//字幕超时
//
//        int MEDIA_INFO_VIDEO_INTERRUPT= -10000;//数据连接中断
//        int MEDIA_INFO_VIDEO_ROTATION_CHANGED = 10001;//视频方向改变
//        int MEDIA_INFO_AUDIO_RENDERING_START = 10002;//音频开始整备中
//
//        int MEDIA_ERROR_UNKNOWN = 1;//未知错误
//        int MEDIA_ERROR_SERVER_DIED = 100;//服务挂掉
//        int MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK = 200;//数据错误没有有效的回收
//        int MEDIA_ERROR_IO = -1004;//IO错误
//        int MEDIA_ERROR_MALFORMED = -1007;
//        int MEDIA_ERROR_UNSUPPORTED = -1010;//数据不支持
//        int MEDIA_ERROR_TIMED_OUT = -110;//数据超时



        switch (what) {
            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: " + extra);
                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: " + extra);

//                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: 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 20
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;
}