android - streaming .m3u audio -



android - streaming .m3u audio -

i want play streaming radio( .m3u format ), not know how it.

this illustration how seek playing:

final mediaplayer mp = new mediaplayer(); seek { mp.setdatasource("url.m3u"); } grab (illegalargumentexception e) { // todo auto-generated grab block e.printstacktrace(); } grab (illegalstateexception e) { // todo auto-generated grab block e.printstacktrace(); } grab (ioexception e) { // todo auto-generated grab block e.printstacktrace(); } seek { mp.prepare(); mp.start(); } grab (illegalstateexception e) { // todo auto-generated grab block e.printstacktrace(); } grab (ioexception e) { // todo auto-generated grab block e.printstacktrace(); }

this code not work. help please.

you have download m3u file first. it's text file, read line line. each line have link can read in media player.

use this,

public arraylist<string> readurls(string url) { if(url == null) homecoming false; arraylist<string> allurls = new arraylist<string>(); seek { url urls = new url(url); bufferedreader in = new bufferedreader(new inputstreamreader(urls .openstream())); string str; while ((str = in.readline()) != null) { allurls.add(str); } in.close(); homecoming allurls ; } grab (exception e) { e.printstacktrace(); homecoming null; } }

android audio streaming

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -