I am using MediaPlayer for Live steaming the Video using HLS medium.
The streaming file has extension .m3u8. The multimedia file is not able to provide streaming in Android OS versions MarshMallow and Lollipop in my case. Above OS version M the same file provides flawless streaming.
Questions that I am looking for the answers are below
Is it Hardware related issue?
Is it only OS related issue?
Why some of the m3u8 urls working fine on MediaPlayer implementation and some of not?
I am here sharing both the files the First one is working and the second one is not working.
1. Here is the First URL that working fine : https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8
One can find the internal details of the file here
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#EXTM3U
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="stereo",LANGUAGE="en",NAME="English",DEFAULT=YES,AUTOSELECT=YES,URI="audio/stereo/en/128kbit.m3u8"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="stereo",LANGUAGE="dubbing",NAME="Dubbing",DEFAULT=NO,AUTOSELECT=YES,URI="audio/stereo/none/128kbit.m3u8"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="surround",LANGUAGE="en",NAME="English",DEFAULT=YES,AUTOSELECT=YES,URI="audio/surround/en/320kbit.m3u8"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="surround",LANGUAGE="dubbing",NAME="Dubbing",DEFAULT=NO,AUTOSELECT=YES,URI="audio/stereo/none/128kbit.m3u8"
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="Deutsch",DEFAULT=NO,AUTOSELECT=YES,FORCED=NO,LANGUAGE="de",URI="subtitles_de.m3u8"
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="English",DEFAULT=YES,AUTOSELECT=YES,FORCED=NO,LANGUAGE="en",URI="subtitles_en.m3u8"
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="Espanol",DEFAULT=NO,AUTOSELECT=YES,FORCED=NO,LANGUAGE="es",URI="subtitles_es.m3u8"
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="Français",DEFAULT=NO,AUTOSELECT=YES,FORCED=NO,LANGUAGE="fr",URI="subtitles_fr.m3u8"
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=258157,CODECS="avc1.4d400d,mp4a.40.2",AUDIO="stereo",RESOLUTION=422x180,SUBTITLES="subs"
video/250kbit.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=520929,CODECS="avc1.4d4015,mp4a.40.2",AUDIO="stereo",RESOLUTION=638x272,SUBTITLES="subs"
video/500kbit.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=831270,CODECS="avc1.4d4015,mp4a.40.2",AUDIO="stereo",RESOLUTION=638x272,SUBTITLES="subs"
video/800kbit.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1144430,CODECS="avc1.4d401f,mp4a.40.2",AUDIO="surround",RESOLUTION=958x408,SUBTITLES="subs"
video/1100kbit.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1558322,CODECS="avc1.4d401f,mp4a.40.2",AUDIO="surround",RESOLUTION=1277x554,SUBTITLES="subs"
video/1500kbit.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=4149264,CODECS="avc1.4d4028,mp4a.40.2",AUDIO="surround",RESOLUTION=1921x818,SUBTITLES="subs"
video/4000kbit.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=6214307,CODECS="avc1.4d4028,mp4a.40.2",AUDIO="surround",RESOLUTION=1921x818,SUBTITLES="subs"
video/6000kbit.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=10285391,CODECS="avc1.4d4033,mp4a.40.2",AUDIO="surround",RESOLUTION=4096x1744,SUBTITLES="subs"
video/10000kbit.m3u8
++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++
2. The content of the NOT WORKING m3u8 file is here as I could not share the URL itself.
++++++++++++++++++++++++++++++++++++++++++++++++++
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-STREAM-INF:BANDWIDTH=1790800,AVERAGE-BANDWIDTH=1790800,CODECS="avc1.4d401f,mp4a.40.2",RESOLUTION=1024x576,FRAME-RATE=29.970,SUBTITLES="subs",CLOSED-CAPTIONS=NONE
XXXXXXX/1/XXXXXXX.m3u8
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="English",DEFAULT=YES,AUTOSELECT=YES,FORCED=NO,LANGUAGE="eng",URI="XXXXXXX/XXXXXXX/XXXXXXX.m3u8"
++++++++++++++++++++++++++++++++++++++++++++++++++
Any help, suggestions, feedbacks will be appreciated.
We want to play m3u8 with ts files stored locally on SD card in Android 4.0 and above devices.
I tried using video TAG inside HTML residing locally on the SD card and android native media player.
Both the codes are failing with the error. The same set of ts and m3u8 files are working fine when played from online when served from a webserver connected through http.
Can we play m3u8 using native support for files stored offline or do we need to use 3rd party libraries. I searched in internet and didn’t find article about not supporting the same.
Any help or recommendation would help my work.
Thanks a lot
Issue Solved
we used nano http server to serve m3u8 file to with all videos parts. Very simple and easy way to play m3u8 video file.
I have already integrated VLC player in my android app in Linux environment.But now the issue is when i try to play the YouTube link .It Unable to stream the YouTube URL and the concerned g-data ".3gp" URL.The error is mentioned below.
"http://www.youtube.com/watch?v=oq1gNicFkeM can not be played." in Toast.
Does anyone have any idea on the same?
I have found a temporary solution.I'm not an expert, but this did the trick for me:
Find a website which can download youtube video's (I suggest keepvid.com)
Paste the url of your youtube video into the designated bar and, although we are not downloading anything, hit the Download button.
Now the website gives you a list with different formats for you to choose from. RIGHT-click the one on top (mp4?) and copy the link's adress.
This link can be played in VLC Android and includes your youtube video.
VLC for Android does not support the lua plugins needed to parse the YT URL.
You need to parse the HTML layout yourself (and feed the resulting URL to VLC) or add support for lua plugins to VLC for Android to solve this issue.
Assume I have the id (The numbers and signs in the video's hyperlink after "http://www.youtube.com/watch?v=") of a Youtube video. How can I download the audio stream of the file to an sd-card as an mp3 with android code? (I wrote an application for 2.x but this part is missing).
Look at how some other YouTube scrapers do it, e.g. youtube-dl. Then recreate their algorithm in Java for Android. Then keep spending time trying to stay up-to-date with the capricious changes YouTube will make to their site every now and then.
I am looking to develop an application where I have to stream .m3u file, this is for ANDROID 3.0 only.
I want to stream this link
dl.dropbox.com/u/2377944/test/abr_test/index.m3u8
it must work in emulator too
I searched a lot, but nothing seems to be working too good.
Please help.
Thanks in advance.
m3u is a play list format, a text file, and not actually audio/video media itself. That means it references media that you would want to stream. The distinction is important.
The contents of the m3u file is important. (Your link is dead, btw.) Show that to use and we can help more. Each of the media files contained in the m3u must be valid and point to media that is compatible with Android.
What makes the media compatable? Check the Android Supported Media Formats page.