Android MediaPlayer error code

Source: Internet
Author: User

Android MediaPlayer error code

  1. Public static final int MEDIA_ERROR_IO
  2. Added in API level 17 File or network related operation errors.
  3. Constant Value:-1004 (0xfffffc14)
  4. Public static final int MEDIA_ERROR_MALFORMED
  5. Added in API level 17 Bitstream is not conforming to the related coding standard or file spec.
  6. Constant Value:-1007 (0xfffffc11)
  7. Public static final int MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK
  8. Added in API level 3 The video is streamed and its container is not valid for progressive playback I. e the video's index (e. g moov atom) is not at the start of the file.
  9. See Also
  10. MediaPlayer. OnErrorListener
  11. Constant Value: 200 (0x000000c8)
  12. Public static final int MEDIA_ERROR_SERVER_DIED
  13. Added in API level 1 Media server died. In this case, the application must release the MediaPlayer object and instantiate a new one.
  14. See Also
  15. MediaPlayer. OnErrorListener
  16. Constant Value: 100 (0x00000064)
  17. Public static final int MEDIA_ERROR_TIMED_OUT
  18. Added in API level 17 Some operation takes too long to complete, usually more than 3-5 seconds.
  19. Constant Value:-110 (0xffffff92)
  20. Public static final int MEDIA_ERROR_UNKNOWN
  21. Added in API level 1 Unspecified media player error.
  22. See Also
  23. MediaPlayer. OnErrorListener
  24. Constant Value: 1 (0x00000001)
  25. Public static final int MEDIA_ERROR_UNSUPPORTED
  26. Added in API level 17 Bitstream is conforming to the related coding standard or file spec, but the media framework does not support the feature.
  27. Constant Value:-1010 (0xfffffc0e)
  28. Public static final int MEDIA_INFO_BAD_INTERLEAVING
  29. Added in API level 3 Bad interleaving means that a media has been improperly interleaved or not interleaved at all, e. g has all the video samples first then all the audio ones. video is playing but a lot of disk seeks may be happening.
  30. See Also
  31. MediaPlayer. OnInfoListener
  32. Constant Value: 800 (0x00000320)
  33. Public static final int MEDIA_INFO_BUFFERING_END
  34. Added in API level 9 MediaPlayer is resuming playback after filling buffers.
  35. See Also
  36. MediaPlayer. OnInfoListener
  37. Constant Value: 702 (0x000002be)
  38. Public static final int MEDIA_INFO_BUFFERING_START
  39. Added in API level 9 MediaPlayer is temporarily pausing playback internally in order to buffer more data.
  40. See Also
  41. MediaPlayer. OnInfoListener
  42. Constant Value: 701 (0x000002bd)
  43. Public static final int MEDIA_INFO_METADATA_UPDATE
  44. Added in API level 5 A new set of metadata is available.
  45. See Also
  46. MediaPlayer. OnInfoListener
  47. Constant Value: 802 (0x00000322)
  48. Public static final int MEDIA_INFO_NOT_SEEKABLE
  49. Added in API level 3 The media cannot be seeked (e. g live stream)
  50. See Also
  51. MediaPlayer. OnInfoListener
  52. Constant Value: 801 (0x00000321)
  53. Public static final int MEDIA_INFO_UNKNOWN
  54. Added in API level 3 Unspecified media player info.
  55. See Also
  56. MediaPlayer. OnInfoListener
  57. Constant Value: 1 (0x00000001)
  58. Public static final int MEDIA_INFO_VIDEO_RENDERING_START
  59. Added in API level 17 The player just pushed the very first video frame for rendering.
  60. See Also
  61. MediaPlayer. OnInfoListener
  62. Constant Value: 3 (0x00000003)
  63. Public static final int MEDIA_INFO_VIDEO_TRACK_LAGGING
  64. Added in API level 3 The video is too complex for the decoder: it can't decode frames fast enough. Possibly only the audio plays fine at this stage.
  65. See Also
  66. MediaPlayer. OnInfoListener
  67. Constant Value: 700 (0x000002bc)

 

MediaPlayer. setOnErrorListener (new OnErrorListener (){
@ Override
Public boolean onError (MediaPlayer mp, int what, int extra ){
Log. d (TAG, "OnError-Error code:" + what + "Extra code:" + extra );
Switch (what ){
Cases-1004:
Log. d (TAG, "MEDIA_ERROR_IO ");
Break;
Cases-1007:
Log. d (TAG, "MEDIA_ERROR_MALFORMED ");
Break;
Case 200:
Log. d (TAG, "MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK ");
Break;
Case 100:
Log. d (TAG, "MEDIA_ERROR_SERVER_DIED ");
Break;
Cases-110:
Log. d (TAG, "MEDIA_ERROR_TIMED_OUT ");
Break;
Case 1:
Log. d (TAG, "MEDIA_ERROR_UNKNOWN ");
Break;
Cases-1010:
Log. d (TAG, "MEDIA_ERROR_UNSUPPORTED ");
Break;
}
Switch (extra ){
Case 800:
Log. d (TAG, "MEDIA_INFO_BAD_INTERLEAVING ");
Break;
Case 702:
Log. d (TAG, "MEDIA_INFO_BUFFERING_END ");
Break;
Case 701:
Log. d (TAG, "MEDIA_INFO_METADATA_UPDATE ");
Break;
Case 802:
Log. d (TAG, "MEDIA_INFO_METADATA_UPDATE ");
Break;
Case 801:
Log. d (TAG, "MEDIA_INFO_NOT_SEEKABLE ");
Break;
Case 1:
Log. d (TAG, "MEDIA_INFO_UNKNOWN ");
Break;
Case 3:
Log. d (TAG, "MEDIA_INFO_VIDEO_RENDERING_START ");
Break;
Case 700:
Log. d (TAG, "MEDIA_INFO_VIDEO_TRACK_LAGGING ");
Break;
}
Return false;
}
});

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.