
The dokka javadoc generation tool complains when parameter names don't match between a method and its override. This change updates occurrences where there is currently a mismatch. Notable renamings that might be controversial: - `onPlaybackStateChanged(int state)` to `onPlaybackStateChanged(int playbackState)` affected a lot of lines but seems more consistent with other '-Changed' methods. - `handleMessage(int messageType, Object payload)` to `handleMessage(int messageType, Object message)` - `ExtractorInput` and `DataSource` inherit `DataReader` which had `read(byte[] target, ...`, while data sources normally called the first parameter `buffer`. I have standardized these all to use `buffer` even though it looks out of place in the `ExtractorInput` interface (which has more `read` methods with `target`). PiperOrigin-RevId: 387290360
ExoPlayer Media2 extension
The Media2 extension provides builders for SessionPlayer and MediaSession.SessionCallback in the Media2 library.
Compared to MediaSessionConnector that uses MediaSessionCompat, this provides finer grained control for incoming calls, so you can selectively allow/reject commands per controller.
Getting the extension
The easiest way to use the extension is to add it as a gradle dependency:
implementation 'com.google.android.exoplayer:extension-media2:2.X.X'
where 2.X.X
is the version, which must match the version of the ExoPlayer
library being used.
Alternatively, you can clone the ExoPlayer repository and depend on the module locally. Instructions for doing this can be found in ExoPlayer's top level README.
Using the extension
Using SessionPlayerConnector
SessionPlayerConnector
is a SessionPlayer implementation wrapping a given Player
.
You can use a SessionPlayer instance to build a MediaSession, or to set the player
associated with a VideoView or MediaControlView
Using SessionCallbackBuilder
SessionCallbackBuilder
lets you build a MediaSession.SessionCallback instance given its
collaborators. You can use a MediaSession.SessionCallback to build a MediaSession.
Links
- Javadoc: Classes matching
com.google.android.exoplayer2.ext.media2.*
belong to this module.