流式网络广播错误android [英] Streaming internet radio error android

查看:94
本文介绍了流式网络广播错误android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试播放Internet广播,并提供了一个示例,该示例是从以下位置下载的
http://www.4shared.com/zip/OTcJZZft/StreamingRadio. html
的工作原理类似于本示例中给出的 Android的在线广播流应用程序,但是问题是我的logcat不断抛出此错误:

I am trying out to play internet radio with an example downloaded from
http://www.4shared.com/zip/OTcJZZft/StreamingRadio.html
which works kinda like given in this example Online radio streaming app for Android, but the problem is my logcat keeps throwing this error:

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

我无法理解这意味着什么.有人可以解释一下这是什么意思吗?如果有人可以引导我阅读有关互联网广播流媒体的全新教程,那将是很大的帮助.

I am unable to understand what this means. Can someone please explain what it means and also if someone can guide me to a fresh tutorial for internet radio streaming it would be great help.

谢谢.

推荐答案

MediaPlayer响应您在setDataSource(String)方法中传递的URL抛出该错误(1,-1002).为您的MediaPlayer对象设置一个onErrorListener()并捕获播放器抛出的错误. (快速查看文档- http://developer.android.com/reference/android/media/MediaPlayer.OnErrorListener.html ),您可以通过检查通过logcat或Toast对象抛出的代码并据此采取适当的措施来评估错误.
根据我玩网络广播的经验,我经常发现MediaPlayer引发的错误或类似错误是由于服务器中的流无效或该站无法通过该URL导致的.尝试收集其他几个链接,然后尝试查看哪些链接有效,哪些无效.

MediaPlayer is throwing that error (1, -1002) in response to the URL you passed it in the setDataSource(String) method. Set up an onErrorListener() for your MediaPlayer object and catch the error thrown by the player. (Quick look at the documentation - http://developer.android.com/reference/android/media/MediaPlayer.OnErrorListener.html) You can evaluate the error by checking the code thrown via the logcat or a Toast object and take appropriate action based on that.
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.

这篇关于流式网络广播错误android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆