Stream an audio .pls in android

前端 未结 4 1408
刺人心
刺人心 2021-01-06 09:16

I\'m making an radio like application that uses streaming. Here i need to stream the audio from a link (http://somedomain/some.pls).

I have created

4条回答
  •  梦毁少年i
    2021-01-06 09:58

    Man, try this two things:

    1: the code

    mediaPlayer = MediaPlayer.create(this, Uri.parse("http://vprbbc.streamguys.net:80/vprbbc24.mp3"));
    mediaPlayer.start();
    

    2: the .pls file

    This URL is from BBC just as an example. It was an .pls file that on linux i downloaded with

    wget http://foo.bar/file.pls
    

    and then i opened with vim (use your favorite editor ;) and i've seen the real URLs inside this file. Unfortunately not all of the .pls are plain text like that.

    have fun!

提交回复
热议问题