Java Code Examples for android.media.MediaPlayer#MEDIA_INFO_VIDEO_TRACK_LAGGING
The following examples show how to use
android.media.MediaPlayer#MEDIA_INFO_VIDEO_TRACK_LAGGING .
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: PlaybackActivity.java From PLDroidShortVideo with Apache License 2.0 | 5 votes |
@Override public boolean onInfo(MediaPlayer mp, int what, int extra) { Log.i(TAG, "OnInfo, what = " + what + ", extra = " + extra); switch (what) { case MediaPlayer.MEDIA_INFO_UNKNOWN: break; case MediaPlayer.MEDIA_INFO_VIDEO_TRACK_LAGGING: break; case MediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START: Log.i(TAG, "video rendering start, ts = " + extra); break; case MediaPlayer.MEDIA_INFO_BUFFERING_START: Log.i(TAG, "onInfo: MediaPlayer.MEDIA_INFO_BUFFERING_START"); break; case MediaPlayer.MEDIA_INFO_BUFFERING_END: Log.i(TAG, "onInfo: MEDIA_INFO_BUFFERING_END"); break; case MediaPlayer.MEDIA_INFO_BAD_INTERLEAVING: Log.i(TAG, "onInfo: MEDIA_INFO_BAD_INTERLEAVING"); break; case MediaPlayer.MEDIA_INFO_NOT_SEEKABLE: Log.i(TAG, "onInfo: MEDIA_INFO_NOT_SEEKABLE"); break; case MediaPlayer.MEDIA_INFO_METADATA_UPDATE: Log.i(TAG, "onInfo: MediaPlayer.MEDIA_INFO_METADATA_UPDATE"); break; case MediaPlayer.MEDIA_INFO_UNSUPPORTED_SUBTITLE: Log.i(TAG, "onInfo: MediaPlayer.MEDIA_INFO_UNSUPPORTED_SUBTITLE"); break; case MediaPlayer.MEDIA_INFO_SUBTITLE_TIMED_OUT: Log.i(TAG, "onInfo: MediaPlayer.MEDIA_INFO_SUBTITLE_TIMED_OUT "); break; default: break; } return true; }
Example 2
Source File: PlaybackActivity.java From PLDroidShortVideo with Apache License 2.0 | 5 votes |
@Override public boolean onInfo(MediaPlayer mp, int what, int extra) { Log.i(TAG, "OnInfo, what = " + what + ", extra = " + extra); switch (what) { case MediaPlayer.MEDIA_INFO_UNKNOWN: break; case MediaPlayer.MEDIA_INFO_VIDEO_TRACK_LAGGING: break; case MediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START: Log.i(TAG, "video rendering start, ts = " + extra); break; case MediaPlayer.MEDIA_INFO_BUFFERING_START: Log.i(TAG, "onInfo: MediaPlayer.MEDIA_INFO_BUFFERING_START"); break; case MediaPlayer.MEDIA_INFO_BUFFERING_END: Log.i(TAG, "onInfo: MEDIA_INFO_BUFFERING_END"); break; case MediaPlayer.MEDIA_INFO_BAD_INTERLEAVING: Log.i(TAG, "onInfo: MEDIA_INFO_BAD_INTERLEAVING"); break; case MediaPlayer.MEDIA_INFO_NOT_SEEKABLE: Log.i(TAG, "onInfo: MEDIA_INFO_NOT_SEEKABLE"); break; case MediaPlayer.MEDIA_INFO_METADATA_UPDATE: Log.i(TAG, "onInfo: MediaPlayer.MEDIA_INFO_METADATA_UPDATE"); break; case MediaPlayer.MEDIA_INFO_UNSUPPORTED_SUBTITLE: Log.i(TAG, "onInfo: MediaPlayer.MEDIA_INFO_UNSUPPORTED_SUBTITLE"); break; case MediaPlayer.MEDIA_INFO_SUBTITLE_TIMED_OUT: Log.i(TAG, "onInfo: MediaPlayer.MEDIA_INFO_SUBTITLE_TIMED_OUT "); break; default: break; } return true; }
Example 3
Source File: VideoPlayerActivity.java From Simpler with Apache License 2.0 | 5 votes |
@Override public boolean onInfo(MediaPlayer mp, int what, int extra) { // 当一些特定信息出现或者警告时触发 Log.d(TAG, "INFO = " + what + "/" + extra); switch (what) { case MediaPlayer.MEDIA_INFO_BAD_INTERLEAVING: Log.d(TAG, "MEDIA_INFO_BAD_INTERLEAVING"); break; case MediaPlayer.MEDIA_INFO_METADATA_UPDATE: Log.d(TAG, "MEDIA_INFO_METADATA_UPDATE"); break; case MediaPlayer.MEDIA_INFO_VIDEO_TRACK_LAGGING: Log.d(TAG, "MEDIA_INFO_VIDEO_TRACK_LAGGING"); break; case MediaPlayer.MEDIA_INFO_NOT_SEEKABLE: Log.d(TAG, "MEDIA_INFO_NOT_SEEKABLE"); break; case MediaPlayer.MEDIA_INFO_BUFFERING_START: Log.d(TAG, "MEDIA_INFO_BUFFERING_START"); if (mVideoView.isPlaying()) { mVideoView.pause(); mLoadingView.setVisibility(View.VISIBLE); } break; case MediaPlayer.MEDIA_INFO_BUFFERING_END: Log.d(TAG, "MEDIA_INFO_BUFFERING_END"); mVideoView.start(); mLoadingView.setVisibility(View.GONE); break; case MediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START: Log.d(TAG, "MEDIA_INFO_VIDEO_RENDERING_START"); mLoadingView.setVisibility(View.GONE); break; } return true; }
Example 4
Source File: GPlayer.java From DroidDLNA with GNU General Public License v3.0 | 5 votes |
@Override public boolean onInfo(MediaPlayer mp, int whatInfo, int extra) { if (whatInfo == MediaPlayer.MEDIA_INFO_BAD_INTERLEAVING) { Log.v(LOGTAG, "Media Info, Media Info Bad Interleaving " + extra); } else if (whatInfo == MediaPlayer.MEDIA_INFO_NOT_SEEKABLE) { Log.v(LOGTAG, "Media Info, Media Info Not Seekable " + extra); } else if (whatInfo == MediaPlayer.MEDIA_INFO_UNKNOWN) { Log.v(LOGTAG, "Media Info, Media Info Unknown " + extra); } else if (whatInfo == MediaPlayer.MEDIA_INFO_VIDEO_TRACK_LAGGING) { Log.v(LOGTAG, "MediaInfo, Media Info Video Track Lagging " + extra); } else if (whatInfo == MediaPlayer.MEDIA_INFO_METADATA_UPDATE) { Log.v(LOGTAG, "MediaInfo, Media Info Metadata Update " + extra); } return false; }
Example 5
Source File: FullScreenVideoViewFragment.java From CameraV with GNU General Public License v3.0 | 5 votes |
@Override public boolean onError(MediaPlayer mp, int whatInfo, int extra) { Log.d(LOG, "onError called " + whatInfo + " (extra: " + extra + ")"); if (whatInfo == -38 || whatInfo == 1) { playPauseToggle.setImageDrawable(getActivity().getResources().getDrawable(R.drawable.ic_videol_play)); currentCue = mediaPlayer.getCurrentPosition(); mediaPlayer.reset(); if (whatInfo == MediaPlayer.MEDIA_INFO_BAD_INTERLEAVING) { Log.d(LOG, "Media Info, Media Info Bad Interleaving " + extra); } else if (whatInfo == MediaPlayer.MEDIA_INFO_NOT_SEEKABLE) { Log.d(LOG, "Media Info, Media Info Not Seekable " + extra); } else if (whatInfo == MediaPlayer.MEDIA_INFO_UNKNOWN) { Log.d(LOG, "Media Info, Media Info Unknown " + extra); } else if (whatInfo == MediaPlayer.MEDIA_INFO_VIDEO_TRACK_LAGGING) { Log.d(LOG, "MediaInfo, Media Info Video Track Lagging " + extra); } else if (whatInfo == MediaPlayer.MEDIA_INFO_METADATA_UPDATE) { Log.d(LOG, "MediaInfo, Media Info Metadata Update " + extra); } else if (whatInfo == MediaPlayer.MEDIA_ERROR_IO) { Log.d(LOG, "Media Info, Media Info IO error " + extra); } else if (whatInfo == -38) { Log.d(LOG, "i have no clue what error -38 is"); } } return true; }
Example 6
Source File: SysMediaPlayer.java From PlayerBase with Apache License 2.0 | 4 votes |
public boolean onInfo(MediaPlayer mp, int arg1, int arg2) { switch (arg1) { case MediaPlayer.MEDIA_INFO_VIDEO_TRACK_LAGGING: PLog.d(TAG, "MEDIA_INFO_VIDEO_TRACK_LAGGING:"); break; case MediaPlayer.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 MediaPlayer.MEDIA_INFO_BUFFERING_START: PLog.d(TAG, "MEDIA_INFO_BUFFERING_START:" + arg2); Bundle bundle = BundlePool.obtain(); bundle.putLong(EventKey.LONG_DATA, mBandWidth); submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_BUFFERING_START,bundle); break; case MediaPlayer.MEDIA_INFO_BUFFERING_END: PLog.d(TAG, "MEDIA_INFO_BUFFERING_END:" + arg2); Bundle bundle1 = BundlePool.obtain(); bundle1.putLong(EventKey.LONG_DATA, mBandWidth); submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_BUFFERING_END,bundle1); break; case MediaPlayer.MEDIA_INFO_BAD_INTERLEAVING: PLog.d(TAG, "MEDIA_INFO_BAD_INTERLEAVING:"); submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_BAD_INTERLEAVING,null); break; case MediaPlayer.MEDIA_INFO_NOT_SEEKABLE: PLog.d(TAG, "MEDIA_INFO_NOT_SEEKABLE:"); submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_NOT_SEEK_ABLE,null); break; case MediaPlayer.MEDIA_INFO_METADATA_UPDATE: PLog.d(TAG, "MEDIA_INFO_METADATA_UPDATE:"); submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_METADATA_UPDATE,null); break; case MediaPlayer.MEDIA_INFO_UNSUPPORTED_SUBTITLE: PLog.d(TAG, "MEDIA_INFO_UNSUPPORTED_SUBTITLE:"); submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_UNSUPPORTED_SUBTITLE,null); break; case MediaPlayer.MEDIA_INFO_SUBTITLE_TIMED_OUT: PLog.d(TAG, "MEDIA_INFO_SUBTITLE_TIMED_OUT:"); submitPlayerEvent(OnPlayerEventListener.PLAYER_EVENT_ON_SUBTITLE_TIMED_OUT,null); break; case MEDIA_INFO_NETWORK_BANDWIDTH: PLog.d(TAG,"band_width : " + arg2); mBandWidth = arg2 * 1000; break; } return true; }
Example 7
Source File: ErrorFactory.java From no-player with Apache License 2.0 | 4 votes |
@SuppressWarnings({"PMD.StdCyclomaticComplexity", "PMD.CyclomaticComplexity"}) public static NoPlayer.PlayerError createErrorFrom(int type, int extra) { String message = String.valueOf(extra); switch (type) { case MediaPlayer.MEDIA_ERROR_IO: return new NoPlayerError(PlayerErrorType.SOURCE, DetailErrorType.MEDIA_PLAYER_IO, message); case MediaPlayer.MEDIA_ERROR_MALFORMED: return new NoPlayerError(PlayerErrorType.SOURCE, DetailErrorType.MEDIA_PLAYER_MALFORMED, message); case MediaPlayer.MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK: return new NoPlayerError(PlayerErrorType.SOURCE, DetailErrorType.MEDIA_PLAYER_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK, message); case MediaPlayer.MEDIA_INFO_NOT_SEEKABLE: return new NoPlayerError(PlayerErrorType.SOURCE, DetailErrorType.MEDIA_PLAYER_INFO_NOT_SEEKABLE, message); case MediaPlayer.MEDIA_INFO_SUBTITLE_TIMED_OUT: return new NoPlayerError(PlayerErrorType.SOURCE, DetailErrorType.MEDIA_PLAYER_SUBTITLE_TIMED_OUT, message); case MediaPlayer.MEDIA_INFO_UNSUPPORTED_SUBTITLE: return new NoPlayerError(PlayerErrorType.SOURCE, DetailErrorType.MEDIA_PLAYER_UNSUPPORTED_SUBTITLE, message); case MediaPlayer.MEDIA_ERROR_SERVER_DIED: return new NoPlayerError(PlayerErrorType.DRM, DetailErrorType.MEDIA_PLAYER_SERVER_DIED, message); case MediaPlayer.PREPARE_DRM_STATUS_PREPARATION_ERROR: return new NoPlayerError(PlayerErrorType.DRM, DetailErrorType.MEDIA_PLAYER_PREPARE_DRM_STATUS_PREPARATION_ERROR, message); case MediaPlayer.PREPARE_DRM_STATUS_PROVISIONING_NETWORK_ERROR: return new NoPlayerError(PlayerErrorType.DRM, DetailErrorType.MEDIA_PLAYER_PREPARE_DRM_STATUS_PROVISIONING_NETWORK_ERROR, message); case MediaPlayer.PREPARE_DRM_STATUS_PROVISIONING_SERVER_ERROR: return new NoPlayerError(PlayerErrorType.DRM, DetailErrorType.MEDIA_PLAYER_PREPARE_DRM_STATUS_PROVISIONING_SERVER_ERROR, message); case MediaPlayer.MEDIA_ERROR_TIMED_OUT: return new NoPlayerError(PlayerErrorType.CONNECTIVITY, DetailErrorType.MEDIA_PLAYER_TIMED_OUT, message); case MediaPlayer.MEDIA_INFO_AUDIO_NOT_PLAYING: return new NoPlayerError(PlayerErrorType.RENDERER_DECODER, DetailErrorType.MEDIA_PLAYER_INFO_AUDIO_NOT_PLAYING, message); case MediaPlayer.MEDIA_INFO_BAD_INTERLEAVING: return new NoPlayerError(PlayerErrorType.RENDERER_DECODER, DetailErrorType.MEDIA_PLAYER_BAD_INTERLEAVING, message); case MediaPlayer.MEDIA_INFO_VIDEO_NOT_PLAYING: return new NoPlayerError(PlayerErrorType.RENDERER_DECODER, DetailErrorType.MEDIA_PLAYER_INFO_VIDEO_NOT_PLAYING, message); case MediaPlayer.MEDIA_INFO_VIDEO_TRACK_LAGGING: return new NoPlayerError(PlayerErrorType.RENDERER_DECODER, DetailErrorType.MEDIA_PLAYER_INFO_VIDEO_TRACK_LAGGING, message); default: return new NoPlayerError(PlayerErrorType.UNKNOWN, DetailErrorType.MEDIA_PLAYER_UNKNOWN, message); } }