6

I am trying to play apple test stream video (.m3u8) in Android.

This is the link: http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8

But I am not able to play it in Android 3.2.

This is the code I have used to play the video:

void playVideo(String url) 
{
    String  link=url;
    Log.e("url",link);
    MediaController mc = new MediaController(this); 
    mc.setMediaPlayer(videoview); 
    videoview.setMediaController(mc);
    videoview.setVideoURI(Uri.parse("http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8")); 
    videoview.requestFocus(); 
    videoview.start();    
}

Please, suggest me the way to play m3u8 file in different Android versions.

Roman C
  • 49,761
  • 33
  • 66
  • 176
Abhi
  • 8,935
  • 7
  • 37
  • 60
  • Please share your ideas if any body know the answer to play m3u8 with out 3rd party library – Abhi Jan 27 '12 at 08:28

1 Answers1

3

Have you tried vitamio? It's an extension framework that does everything (and then some) that MediaPlayer does, including m3u8 streams.

Chris Cashwell
  • 22,308
  • 13
  • 63
  • 94
  • 1
    Thank you for reply, Is there anyway to play with out using third party library? – Abhi Jan 27 '12 at 07:12
  • Not reliably in my experience. – Chris Cashwell Jan 27 '12 at 13:47
  • 1
    One more doubt please, Why some versions of 3.x not supporting Http live streaming, why should we go for another frame work? – Abhi Jan 27 '12 at 13:50
  • @Abhi it's not that those versions don't support live streaming, just that the method is different. I suppose you could always use one of two different methods based on the return of `Build.VERSION.SDK_INT`, but would you really rather code twice than use a superior media framework? – Chris Cashwell Jan 27 '12 at 13:57
  • no, but i am seeing for any other way with out using framework, AFAIK from 3.x HTTP LiveStreaming is supported in android, right? but when i give httplive:// instead of http:// playing in 2.3 version also why so? – Abhi Jan 27 '12 at 14:01
  • @Abhi that's a good question for the android issue tracker: http://code.google.com/p/android/issues/list – Chris Cashwell Jan 27 '12 at 14:04
  • then what about this issue http://code.google.com/p/android/issues/detail?id=16884 – Abhi Jan 27 '12 at 14:05
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/7099/discussion-between-abhi-and-chris-cashwell) – Abhi Jan 27 '12 at 14:13
  • The workaround is suggested here: http://code.google.com/p/android/issues/detail?id=17118 - the web browser can't play it, but you can using MediaPlayer. Again, I think it's more logical to just use a working framework. – Chris Cashwell Jan 27 '12 at 15:29