Android MediaPlayer error: MediaPlayer error(1, -2147483648) on Stream from internet

泄露秘密 提交于 2019-11-29 07:54:10
Bo.

If you are testing on devices earlier than Android 3.1 you might not be able to play AACP (as seen on the info page for your stream (AAC+) streams.

Info page for your stream:

In order to find out what streams you can play on your targeted device check official docs: http://developer.android.com/reference/android/media/AudioManager.html

If you are looking how to handle aacp checkout following:
https://stackoverflow.com/a/8833346/200272

I was also getting the same error on Froyo & Gingerbread. In higher Androids the same video played well. Finally after a lot of research, tried changing the Https Url to Http Url & Bingo. It resolved my issue. I was using amazon S3 server so that simply replacing the "https" in url with "http" was sufficient.

  videoUrl= videoUrl.replaceFirst("https", "http"); 

PS: For supporting older versions if you are using H.264 make sure videos are Baseline encoded.

As I can see, this stream is not supported by mediaPlayer. Android supports AAC LC/LTP but your stream is aacp. I think this may be the root cause of your problem.

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