ExoPlayer has a number of advantages over Android's built-in MediaPlayer:
- Fewer device-specific issues and less variation in behavior across different devices and versions of Android.
- The ability to update the player along with your app. Because ExoPlayer is a library that you include in your app's APK, you have control over which version you use and you can easily update to a newer version as part of a regular app update.
- The ability to customize and extend the player to suit your use case. ExoPlayer is designed specifically with this in mind, and allows many components to be replaced with custom implementations.
- Support for playlists.
- Support for DASH and SmoothStreaming, neither of which are supported by MediaPlayer. Many other formats are also supported. See the Supported formats page for details.
- Support for advanced HLS features, such as correct handling of
- Support for Widevine common encryption on Android 4.4 (API level 19) and higher.
- The ability to quickly integrate with a number of additional libraries using official extensions. For example the ExoPlayer IMA library makes it easy to monetize your content using the Interactive Media Ads SDK.
It's important to note that there are also some disadvantages:
- For audio-only playback on some devices, ExoPlayer may consume significantly more battery than MediaPlayer. See the Battery consumption page for details.
- Including ExoPlayer in your app adds a few hundred kilobytes to the APK size. This is likely only a concern for extremely lightweight apps. Guidance for shrinking ExoPlayer can be found on the APK shrinking page.