MediaPlayer prepare Failed Error(1,-17) when using recorded file .3gp

大城市里の小女人 提交于 2019-12-02 06:45:37

Implement the OnCompletionListener and register it with your MediaPlayer instance.

After the media has been played out it will call this callback method onCompletion

void onCompletion(MediaPlayer mp){
   //Here you stop it.
   mp.stop();
   //Reset the data source path to the new file
   mp.setDataSource(<uri>);
   mp.prepare(); // or mp.prepareAsync();
   // start the mediaplayer after the prepare has completed.
}

Release the mediaplayer instance once you are done playing all the files.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!