Android MediaPlayer Error and Info Constants
If you’re ever debugging Android MediaPlayer issues, logging the output from the onError and onWarning functions may not help as the log will only display the int value of the constant, not the constant itself.
You will have to look up the MediaPlayer API to find out the value’s constant definition which is annoying (and not always complete as I just found out) so I’m compiling a list here. It wouldn’t be hard to create an enum, HashMap or class to map the values in code.
These are the integer values for the “what” parameter in the public boolean onError(MediaPlayer mp, int what, int extra) or public boolean onInfo(MediaPlayer mp, int what, int extra)
- MEDIA_INFO_UNKNOWN: 1
- MEDIA_INFO_VIDEO_TRACK_LAGGING: 700
- MEDIA_INFO_NOT_SEEKABLE: 801
- MEDIA_INFO_METADATA_UPDATE: 802
- MEDIA_INFO_BUFFERING_START: 701
- MEDIA_INFO_BUFFERING_END: 702
- MEDIA_INFO_BAD_INTERLEAVING: 800
- MEDIA_INFO_NETWORK_BANDWIDTH : 703 (Undocumented – found through source code)
- MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK: 200
- MEDIA_ERROR_SERVER_DIED: 100
- MEDIA_ERROR_UNKNOWN: 1
Related Tweets
- @pickle_inc: ぐはー、かなり色々試したけど、どうもAndroidのMediaPlayerは、動画を同時にはprepare出来ないらしい。異なる動画のギャップレス再生は無理ってことか。 about 1 day ago
- @wpktwit: Iemand al ervaring met de Android 4.0 Full HD Projector SMRT-A023 http://t.co/YYXzkr8sBT @visiemotion misschien? about 1 day ago
- @darkowlzz: Android: mediaplayer create - Stack Overflow http://t.co/gaYVI2qZlp 2 days ago
- @darkowlzz: Android, how to use only one instance of MediaPlayer in Widget - Stack Overflow http://t.co/18lkaFkVsf 2 days ago
- @studioromeo: Pretty sure that the public doesn't like the media player https://t.co/XDJE2uQqie 5 days ago
