ExoPlayer v2 is Released by Google for Better Media Playback

ExoPlayer originally started out as an internal Google project for streaming video from YouTube. As the media player became more robust, it became open sourced and adopted by a number of other Android developers for their media apps.

Its modular system allowed for a number of video formats to be supported. However, this modular system was shoehorned in after the original project was complete. This has led to some complicated code and workarounds to get it to work. The developers at Google for this project have decided to redesign the project from the ground up and have now released ExoPlayer v2.

This has not just brought a better architecture, but a number of new features which are possible thanks to the redesign. The release notes are below.

r2.0.0

ExoPlayer 2.x is a major iteration of the library. It includes significant API and architectural changes, new features and many bug fixes. You can read about some of the motivations behind ExoPlayer 2.x here.

Root package name changed to com.google.android.exoplayer2. The library structure and class names have also been sanitized. Read more here.
Key architectural changes:
Late binding between rendering and media source components. Allows the same rendering components to be re-used from one playback to another. Enables features such as gapless playback through playlists and DASH multi-period support.
Improved track selection design. More details can be found here.
LoadControl now used to control buffering and loading across all playback types.
Media source components given additional structure. A new MediaSource class has been introduced. MediaSources expose Timelines that describe the media they expose, and can consist of multiple MediaPeriods. This enables features such as seeking in live playbacks and DASH multi-period support.
Responsibility for loading the initial DASH/SmoothStreaming/HLS manifest is promoted to the corresponding MediaSource components and is no longer the application’s responsibility.
Higher level abstractions such as SimpleExoPlayer have been added to the library. These make the library easier to use for common use cases. The demo app is halved in size as a result, whilst at the same time gaining more functionality. Read more here.
Enhanced library support for implementing audio extensions. Read more here.
Format and MediaFormat are replaced by a single Format class.
Key new features:
Playlist support. Includes support for gapless playback between playlist items and consistent application of LoadControl and TrackSelector policies when transitioning between items (#1270).
Seeking in live playbacks for DASH and SmoothStreaming (#291).
DASH multi-period support (#557).
MediaSource composition allows MediaSources to be concatenated into a playlist, merged and looped. Read more here.
Looping support (see above) (#490).
Ability to query information about all tracks in a piece of media (including those not supported by the device) (#1121).
Improved player controls.
Support for PSSH in fMP4 moof atoms (#1143).
Support for Opus in Ogg (#1447).
CacheDataSource support for standalone media file playbacks (mp3, mp4 etc).
FFMPEG extension (for audio only).
Key bug fixes:
Removed unnecessary secondary requests when playing standalone media files (#1041).
Fixed playback of video only (i.e. no audio) live streams (#758).
Fixed silent failure when media buffer is too small (#583).
Suppressed “Sending message to a Handler on a dead thread” warnings (#426).

As you can see, there’s new support for certain types of media and playback controls like looping.

For developers, as mentioned in the Medium article, there is no reason to switch immediately. They’ve even changed the package name so apps can be tested with the newer version without removing legacy support. However, when Android O is announced, any media changes will be implemented in v2 and won’t be backported to the older version. This still gives developers six months or so, which is enough time to be thorough.

The project is available on GitHub, including a sample app to explore all of the different features.

Nick Felker

Nick Felker

Nick Felker is a student Electrical & Computer Engineering student at Rowan University (C/O 2017) and the student IEEE webmaster. When he's not studying, he is a software developer for the web and Android (Felker Tech). He has several open source projects on GitHub (http://github.com/fleker)Devices: Moto G-2013 Moto G-2015, Moto 360, Google ADT-1, Nexus 7-2013 (x2), Lenovo Laptop, Custom Desktop.Although he was an intern at Google, the content of this blog is entirely independent and his own thoughts.

More Posts - Website

Follow Me:
TwitterLinkedInGoogle PlusReddit