ExoPlayer 2 : Playing Audio and Video
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.
We have been using ExoPlayer 1.x.x for our some tv and radio projects. We are thinking about using ExoPlayer 2.x.x. I developed basic audio and video player for test. I think its performance is impressive. A lot of things changed from ExoPlayer 1.x.x. There is a post for beginners about changes, classes. Also you are considering what is ExoPlayer and why use, you can check this post.
ExoPlayer supports many audio types, you can see all supported type from ExoPlayer’s website.
You need to set up a specific chain structure between classes, but you can play audio files in this way simply to show it.
If you want to play audio you can use
ExoPlayer supports many video and stream formats. You can check with same url, which I share for audio formats.
When we are playing videos, we need to be careful about video formats. Because we need different MediaSource classes for different types.
HLS -> HlsMediaSource
DASH -> DashMediaSource
SS -> SsMediaSource
MP4 and others -> ExtractorMediaSource
Also you can play audio files with ExtractorMediaSource.
I created a repo for how to play audio and video basic way. I am still exploring and learning ExoPlayer 2. If you have some feedbacks for me, please share.
ExoPlayerSample - You can play videos and musics with ExoPlayer 2.github.com
ExoPlayer is an extensible, application level media player for Android apps. It’s an alternative to the high level…medium.com