Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Http Live Streaming on Android 4 (Ice Cream Sandwich)

I would like to play a http live steaming link(.m3u8) on android. Can you please let me know how to write code for that (snippet)?

I tried the following(on Activity's onCreate event) but it wouldnt work (says Cant play video) :

VideoView vv = new VideoView(this);
Uri uri =Uri.parse("http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8");
vv.setVideoURI(uri);
setContentView(vv);

note: using emulator for testing thanks for the help

like image 211
Jay Avatar asked Nov 02 '11 09:11

Jay


2 Answers

Try the following :

    String httpLiveUrl = "http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8";
    videoView.setVideoURI(Uri.parse(httpLiveUrl));
    videoView.setMediaController(new MediaController(this));
    videoView.requestFocus();
    videoView.start();

OR

Try using the VitaMio media player

HTTP live streaming (M3U8), for Android 2.1+

edit: The VitaMio player is dead


I think this will work just fine in the actual device, since it works in HoneyComb, the emulator can be broken sometimes

like image 60
Reno Avatar answered Nov 10 '22 05:11

Reno


Looks like this might not be fully supported in the emulator. This runs fine on a ICS device

like image 39
Rajdeep Dua Avatar answered Nov 10 '22 04:11

Rajdeep Dua