이번 글에선 간단하게 ExoPlayer의 공식문서를 훑어보면서 알아봐야겠다.
ExoPlayer 공식 문서의 설명부터 보자.
ExoPlayer가 MediaPlayer API의 대안으로 나온 만큼 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 application.
Because ExoPlayer is a library that you include in your application apk, you have control over which version you use and you can easily update to a newer version as part of a regular application 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 #EXT-X-DISCONTINUITY tags.
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 IMA extension makes it easy to monetize your content using the Interactive Media Ads SDK.
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.
장단점이 명확하다. MediaPlayer API에서 제공하지 않는 기능을 풍부하게 제공하는 대신, 배터리 소모 및 apk 사이즈가 헤비해질 수 있음을 우려한다.
다양한 형식을 제공하는 ExoPlayer이기에 많은 곳에서 사용된다고 생각한다.
유튜브가 ExoPlayer로 만들어진 건 많이 들어본 이야기다.
다양한 형식과 관련된 이야기는 다른 글로 자세하게 알아보려 한다.
ExoPlayer 공식문서는 너무 친절하다.
관련 용어 설명도 제공해준다.🤩