我想通过查看链接玩无线电Shoutcast的,但它的一个PLS文件格式: http://yp.shoutcast.com/sbin/tunein-station.pls ?ID = 13361 它不会在此刻发挥,
I want to play a radio shoutcast but its a pls file format by looking at the link: http://yp.shoutcast.com/sbin/tunein-station.pls?id=13361 It doesn't play at the moment,
我有:
初始化:
player = new MediaPlayer();
try {
player.setDataSource("http://yp.shoutcast.com/sbin/tunein-station.pls?id=13361");
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SecurityException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
当pressed播放按钮:
When play button is pressed:
player.setOnPreparedListener(new OnPreparedListener() {
public void onPrepared(MediaPlayer mp) {
player.start();
}
});
我有code与具有类似www.example.com:8080或类似的东西端口结束的另一Shoutcast的链接进行测试,它正在pretty的很好,但是当链接改为PLS ?ID =不读的链接,所以我不能听收音机......有人请帮我看看这个: - /
I have the code tested with another shoutcast link that ends with a port like www.example.com:8080 or something like that, it was working pretty fine, but when the link changed to a pls?id= it doesn't read the link and hence I can't hear the radio... Someone please help me with this :-/
推荐答案
A .PLS
文件只是一个播放列表。没有媒体那里。您将有自己的分析文件,以获得实际的流网址。打开它在文本编辑器明白我的意思。
A .pls
file is just a playlist. There is no media there. You will have the parse the file yourself to get the actual stream URLs. Open it up in a text editor to see what I mean.
相关推荐
最新文章