Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Live Streaming Android (http or httplive)

IS there anybody have run http live Streaming(discovered by Apple) on android device. I have some of Streaming Url. like "" www.abc/iphone/france24/allegro/fr/f24_fr.m3u8 "" type. My task is to make a app for android 3.0 OS type mobile. Can anybody help me to make it.

The topic is new in android market.So that there is not much help on internet. I have got one of sample code to run livestreaming on android device.but it doesnt run urls that i have. these url are effectively working on IPAD or IPHONE. Thanks

like image 589
Rana.S Avatar asked Nov 05 '22 18:11

Rana.S


1 Answers

check out the issue in android bug report. replacing http with httplive worked for me. Here is the sample code below from the bug report

private void playVideo(Integer Media) {
    doCleanUp();
    try {
        switch (Media) {
            case Globals.TEST_HTTP:
                path = "http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8";
                break;
            case Globals.TEST_HTTPLIVE:
                path = "httplive://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8";
                break;
        }
        mMediaPlayer = new MediaPlayer();
        mMediaPlayer.setDataSource(path);
        mMediaPlayer.setDisplay(holder);
        mMediaPlayer.prepare();
        mMediaPlayer.setOnBufferingUpdateListener(this);
        mMediaPlayer.setOnCompletionListener(this);
        mMediaPlayer.setOnPreparedListener(this);
        mMediaPlayer.setOnVideoSizeChangedListener(this);
        mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
    } catch (Exception e) {
        Log.e(TAG, "error: " + e.getMessage(), e);
    }
}
like image 172
Mrid Avatar answered Nov 15 '22 04:11

Mrid