I want to play streaming radio (.m3u format), but I donβt know how to do it.
In this example, as I try to reproduce:
final MediaPlayer mp = new MediaPlayer(); try { mp.setDataSource("url.m3u"); } catch (IllegalArgumentException 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(); } try { mp.prepare(); mp.start(); } catch (IllegalStateException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); }
this code does not work. help me please.
source share