After trying multiple ways of playing m3u8 files using videoview and mediaplayer I decided to give up. Everytime i play the m3u8 file I only hear the voice.(please dont write urls from stack overflow answering my question. I' ve red them all ) Been asking around ,finally got to know that exoplayer maybe is the one I'm looking for. However exoplayer seems to be a newbie and I can'n find any proper tutorial. That been said Im myself a newbie and all talks about tracker and blabla seem just too complicated for me. I only want to be able to open all my m3u8 files from different urls in my app without passing them to vlc or any external intents.
For the record I use KitKat and above. So exoplayer should be implementable.
So what Im desperatly asking for is a simple tutorial in how I can play my m3u8 files using exoplayer or anyother way that shows the video and play the audio and NOT just one of them. Please dont link me to the exoplayer page on google dev. Ive been there too.
Thanks in advance :)
On Android 4.1+, you can use this library https://github.com/brianwernick/ExoMedia/ . The example mentioned on the Read-me page should be sufficient to get you started. I have reproduced that code snippet with a few additions/modifications.
I have worked with m3u8 with following code
There are no tutorials on
ExoPlayer
right now.ExoPlayer
is a the best alternative toMediaPlayer
but is not very newbie friendly at the moment.What you have to do is go to the github page and take a look at the
DemoPlayer
class in thedemo
app.This app can open a lot of different formats including
hls
.I Have created one demo app to play m3u8 media file
First add gradle dependencies to your file
Create a simple layout file with storage master.m3u8 path as input and SimpleExoPlayerView view to play downloaded files.
Create a simple ExoPlayer Activity to play Files.
This is the simplest way to stream m3u8 files using ExoPlayer Lib hope to help https://github.com/karim23/SimpleStreamPlayer/tree/master