I am creating a demo where I want a functionality to show subtitles/captions of the audio playing from the same application. It is like youtube when the video is playing and we are able to see the subtitles/captions but I want it for audio. I have checked many things but have not been able to find anything useful.
I want to play a .m3u8 streaming video with different audio tracks and different subtitles.
Here I have a question like which video player is better to play the .m3u8 streaming videos, with better performance.
I am Trying to solve this by using Native player, that is VideoView but at the time of working with audio-tracks and sub-Titles, I am facing problem with videoView.Here in the videoView I have to handle every thing through by coding ,there is no support form VideoView.
Can I achieve this with Exo player.
Can any body please suggest a best solution for audio tracks and subtitles support in the video player .
ExoPlayer is an application level media player for Android. It
provides an alternative to Android’s MediaPlayer API for playing audio
and video both locally and over the Internet. ExoPlayer supports
features not currently supported by Android’s MediaPlayer API,
including DASH and SmoothStreaming adaptive playbacks. Unlike the
MediaPlayer API, ExoPlayer is easy to customize and extend, and can be
updated through Play Store application updates.
From the documentation.
Exoplayer is super easy to use and it supports SmoothStreaming, in case your link provides multiple tracks, it'll adapt to the user connection, if the user has a poor connection it'll select the lower quality track, if the user has a good internet it'll select the high-quality track.
If playing audio or video is an important feature of your app, you should definetly use Exoplayer.
If you are not convinced yet, Exoplayer is used in Youtube, Google Music, Google Movies, Facebook, Whatsapp, Spotify, Twitter and 140,000 more. You can check in this I/O lecture.
If you want to check a simple audio exoplayer sample you can see it here. And read this article.
as someone who has coped with same problem i think simplicity is more important than other factors. VideoView is so easy to use so go with it.
tip: if you wanna make something like youtube style of playing you can use a Frame Layout on top of that and put buttons and imageviews and other stuff like that on it
I want to stream an audio mp3 file and then play it through android media player plus I also want to cache this file, so that mediaplayer don't have to stream for recently played tracks.
I have tried using prepareAsync method but it doesn't give me access to buffer content, so I have decided to stream the audio file myself and then pass it to the media player for playing. I have achieved this by following this article here but this approach has a problem i.e. while transferring the file to media player it goes into error mode which causes my player to behave inconsistently.
When media player enters its error mode it doesn't come out of it automatically so I am forced to create a new media player and then re-provide it the downloaded file, this workaround causes the user to experience an undesired pause in the song playing.
So, does any one have improved an version of code given in above link? or do they know a better solution to this problem or is there is actually a library for streaming an audio file in android?
Thanks
The link you provided looks like a less than ideal solution (not to mention outdated). What you probably want is a local proxy server that gives you access to byte data before the MediaPlayer gets it. See my answer here for a little more explanation.
I'd like to add some functionality inside of default media player for honeycomb without making any other class that using mediaPlayer package from Android, such as showing the information for particular video by swiping the screen, etc. Is that possible? if not, there's no other way to make my own class for the media player :(
No, that is not possible: the default media player on Android can not be modified by third party code. If you want to build your own media player you can start by looking at this and in the platform samples, but you will need to do significantly more work to get a fully functional media player.
I am just wondering if you can make your own Media Player for videos. I want to make some video player just like the one they use on Vevo app. I notice it buffers faster than the normal Media Player.