Http Live streaming(HLS) allows applications to stream the media content of servers. If you would like to follow HLS standards, the content type of the media should be in the format of m3u8. m3u8 file is a meta data container for the media information to play. As m3u8 is supported by Android 3.1 and above, if we provide m3u8 URL's the streaming will be automatically done by the Media Player or VideoView object.
Some of the working urls include
http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8
http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8
To support Android versions 2.1 and above use third party vitamo player.
VideoView videoView = (VideoView) findViewById(R.id.videoView); String httpLiveUrl = "http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8"; videoView.setVideoURI(Uri.parse(httpLiveUrl)); videoView.setMediaController(new MediaController(this)); videoView.requestFocus(); videoView.start();
Some of the working urls include
http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8
http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8
To support Android versions 2.1 and above use third party vitamo player.
I am attempting to learn about streaming to android devices. It is immensely overwhelming at this point. As it stands I am able to stream to iOS devices fairly easily.
ReplyDeleteIf I were to utilize the code you have above, how do I implement it? Would it be added to a page as is and then the Android players will take over? As much as I know about streaming media, coding for Android has me at a loss.
Big......Thank you Sree. :)
ReplyDeleteGreat Harsha
ReplyDeleteI am integrate your code in my new android project . It's not play the video. It shows "Cant Play this video " in my android emulator .
ReplyDeleteCan you please try it your real device?
DeleteIt displays the same message "Can't play this video" in my real device?
DeleteThis comment has been removed by the author.
DeleteHave you set the right internet accessing right in your manifest?
Deletelike the below
uses-permission android:name="android.permission.INTERNET"
Is there and option to change the segment for HLS using mediaplayer?
ReplyDeleteI used 2 seconds and it didnt look well. Only the 10 second standard is good.
Hi Sree,
ReplyDeletesome m3u8 videos are playing and some are not. Dont know why. do you have any answer?
Heartly thanks to Harsha.
ReplyDeletewas running between many players for HLS streaming now got it as simple. Thank you
ReplyDelete