Tuesday, February 18, 2014
Use MediaPlayer play mp3 files encounter strange problems
When I use MediaPlayer play mp3 files, the system reports an error log Prepare failed:. Status = 0xFFFFFF8E, but music playback is normal, there is no exception. And according to my observation, it seems that only in relatively high rom version will have this error occurs, such as 4.0, 2.3 version without error. What is the reason, how to solve?<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Some features used in high version may have not the same place.
So the library may have to change the underlying use.
The MediaPlaer each function you use are tested again, should be able to find out which methods have changed.
Reply:
Can put your code to me?
Reply:
Code is as follows
private MediaPlayer mpBack = null;
/ **
* From the resource file is read into the background sound
* @ Param resId
* /
public void MediaPlay (int resId) {
if (! isPlaying ()) {
mpBack = MediaPlayer.create (ctMedia, resId);
/ ** Set the volume * /
mpBack.setVolume (0.8f, 0.8f);
/ ** The default background music infinite loop * /
mpBack.setLooping (true);
mpBack.start ();
}
}
When you call a method, LogCat error, but running normally. In the 2.3 version of the rom the following error message
Found
12-12 21:51:57.380: E / MediaPlayer (31457): mOnVideoSizeChangedListener is null Failed to send MEDIA_SET_VIDEO_SIZE message
..
12-12 21:51:57.380: E / MediaPlayer (31457): mOnPreparedListener is null Failed to send MEDIA_PREPARED message
..
Reply:
Encountered the same problem, find a solution.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment