我正在尝试播放网络广播,示例下载自
http://www.4shared.com/zip/OTcJZZft/StreamingRadio.html
它的工作原理与示例Online radio streaming app for Android中给出的类似,但问题是我的logcat不断抛出这个错误:
11-07 17:20:39.207: E/MediaPlayer(335): error (1, -1002)
11-07 17:20:39.237: E/MediaPlayer(335): Error (1,-1002)
11-07 17:20:48.882: W/KeyCharacterMap(335): No keyboard for id 0
11-07 17:20:48.886: W/KeyCharacterMap(335): Using default keymap: /system/usr/keychars/qwerty.kcm.bin我不明白这是什么意思。谁能解释一下这是什么意思,如果有人可以引导我到一个新鲜的网络广播流媒体教程,这将是很大的帮助。
谢谢。
发布于 2015-07-27 10:37:33
MediaPlayer将抛出该错误(1,-1002),以响应您在setDataSource(String)方法中传递的URL。为MediaPlayer对象设置onErrorListener()并捕获播放器抛出的错误。(快速查看文档- http://developer.android.com/reference/android/media/MediaPlayer.OnErrorListener.html)您可以通过检查通过logcat或Toast对象抛出的代码来评估错误,并在此基础上采取适当的操作。
In my experience with playing internet radio I've found that most often, that or similiar errors thrown by the MediaPlayer are caused by the stream being invalid from the server or the station is no longer viable through that URL. Try to gather several other links and try them to see which ones work and which do not.https://stackoverflow.com/questions/13269745
复制相似问题