because in android,media player support midi,but cocos2d-x 3.2 code not support. now i found fixed it method:
modify cocos2d\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxMusic.java fn:public void playBackgroundMusic(final String pPath, final boolean isLoop) ln: 118
old:
this.mBackgroundMediaPlayer.stop();
this.mBackgroundMediaPlayer.setLooping(isLoop);
this.mBackgroundMediaPlayer.prepare();
this.mBackgroundMediaPlayer.seekTo(0);
=>
new:
if(this.mCurrentPath.indexOf(".mid")>0){
this.mBackgroundMediaPlayer.setLooping(isLoop);
// this.mBackgroundMediaPlayer.prepareAsync();
}else{
this.mBackgroundMediaPlayer.stop();
this.mBackgroundMediaPlayer.setLooping(isLoop);
this.mBackgroundMediaPlayer.prepare();
this.mBackgroundMediaPlayer.seekTo(0);
}
last:
thanks your read!
No comments:
Post a Comment