Today, I recorded a pit. When I used MediaPlayer to play the video, the screen went black. Then, I saw that the system log output by the console contained a “MediaPlayer Error (1, -2147483648)”.
Then I went to the source code and found this
Then I went to the source code and found this
public interface OnErrorListener
{
/**
* Called to indicate an error.
*
* @param mp the MediaPlayer the error pertains to
* @param what the type of error that has occurred:
* <ul>
* <li>{@link #MEDIA_ERROR_UNKNOWN}
* <li>{@link #MEDIA_ERROR_SERVER_DIED}
* </ul>
* @param extra an extra code, specific to the error. Typically
* implementation dependent.
* <ul>
* <li>{@link #MEDIA_ERROR_IO}
* <li>{@link #MEDIA_ERROR_MALFORMED}
* <li>{@link #MEDIA_ERROR_UNSUPPORTED}
* <li>{@link #MEDIA_ERROR_TIMED_OUT}
* <li><code>MEDIA_ERROR_SYSTEM (-2147483648)</code> - low-level system error.
* </ul>
* @return True if the method handled the error, false if it didn't.
* Returning false, or not having an OnErrorListener at all, will
* cause the OnCompletionListener to be called.
*/
boolean onError(MediaPlayer mp, int what, int extra);
}
So the problem I have is the error “MEDIA_ERROR_SYSTEM”, the reason is “system version is too low error”… Then I looked it up on the Internet and found that video files are usually in MP4, AVI, etc., but even if they are in the same file format, they may have different encoding formats. For example, common coding formats are: H.264, H.263 and so on. However, many Andorid devices can only support partial encoding, which results in some videos that cannot be played on Andorid devices. If you have to play these videos, it involves the complicated operation of video transcoding… I haven’t learned this skill yet, so I’ll dig a hole and fill it up later
Read More:
- Android learning notes 03: some problems and solutions in the learning process
- The problem of mobile hybrid development RN Android deployment appears Unsupported class file major version xx
- Flutter development: prompt error parsing localfile when running the project: ‘/ users / xxx / Android / APP / SRC / main / androidmanifest. XML’… Solution
- Error: Error parsing D:\new_android\Android SDK\system-images\android-25\android-wear\armeabi-v7a\de
- Request window feature for Android Development( Window.FEATURE_ NO_ Title) does not take effect
- Android Studio | Failed to find target with hash string ‘android-26’ in: D:\Android\sdk
- R language notes – sample() function
- Notes: Windows Python installation and removal error 2203 / 2502 / 2503
- Notes on Java IO streaming
- Notes on @ pathvariable annotation in springcloud openfeign
- Notes on flex RSL application
- R-common errors and their possible causes — Notes
- OpenGL learning notes: Problems and Solutions
- Miscellaneous Notes (2)
- Notes on using Reaver in Kali 2.0
- R learning notes (1) — ARIMA model
- Learning notes of OpenGL — blending
- Learning notes — opengl01
- ISLR reading notes (3) classification
- The solution of notes floating red error in IntelliJ idea