androidx.media2

Interfaces

MediaPlayer2.OnDrmConfigHelper Interface definition of a callback to be invoked when the app can do DRM configuration (get/set properties) before the session is opened. 
MediaSession2.OnDataSourceMissingHelper Interface definition of a callback to be invoked when a MediaItem2 in the playlist didn't have a DataSourceDesc2 but it's needed now for preparing or playing it. 

Classes

CallbackDataSource2 For supplying media data, implement this if your app has special requirements for the way media data is obtained. 
CallbackDataSourceDesc2 Structure for data source descriptor for CallbackDataSource2
CallbackDataSourceDesc2.Builder This Builder class simplifies the creation of a CallbackDataSourceDesc2 object. 
DataSourceDesc2 Structure for data source descriptor. 
DataSourceDesc2.Builder<T extends Builder> Builder class for DataSourceDesc2 objects. 
FileDataSourceDesc2 Structure for data source descriptor for a file. 
FileDataSourceDesc2.Builder This Builder class simplifies the creation of a FileDataSourceDesc2 object. 
MediaBrowser2 Browses media content offered by a MediaLibraryService2
MediaBrowser2.BrowserCallback Callback to listen events from MediaLibraryService2
MediaController2 Allows an app to interact with an active MediaSession2 or a MediaSessionService2 in any status. 
MediaController2.ControllerCallback Interface for listening to change in activeness of the MediaSession2
MediaController2.PlaybackInfo Holds information about the the way volume is handled for this session. 
MediaItem2 A class with information on a single media item with the metadata information. 
MediaItem2.Builder Builder for MediaItem2  
MediaLibraryService2 Base class for media library services. 
MediaLibraryService2.LibraryRoot Contains information that the library service needs to send to the client when MediaBrowser2.getLibraryRoot(Bundle) is called. 
MediaLibraryService2.MediaLibrarySession Session for the MediaLibraryService2
MediaLibraryService2.MediaLibrarySession.Builder Builder for MediaLibraryService2.MediaLibrarySession
MediaLibraryService2.MediaLibrarySession.MediaLibrarySessionCallback Callback for the MediaLibraryService2.MediaLibrarySession
MediaMetadata2 Contains metadata about an item, such as the title, artist, etc. 
MediaMetadata2.Builder Use to build MediaMetadata2x objects. 
MediaPlayer2 MediaPlayer2 class can be used to control playback of audio/video files and streams. 
MediaPlayer2.DrmEventCallback Interface definition for callbacks to be invoked when the player has the corresponding DRM events. 
MediaPlayer2.DrmInfo Encapsulates the DRM properties of the source. 
MediaPlayer2.EventCallback Interface definition for callbacks to be invoked when the player has the corresponding events. 
MediaPlayer2.MetricsConstants Definitions for the metrics that are reported via the MediaPlayer2.getMetrics() call. 
MediaPlayer2.TrackInfo Class for MediaPlayer2 to return each audio/video/subtitle track's metadata. 
MediaPlayerConnector Base interface for all media players that want media session. 
MediaPlayerConnector.PlayerEventCallback A callback class to receive notifications for events on the media player. 
MediaPlaylistAgent MediaPlaylistAgent is the abstract class an application needs to derive from to pass an object to a MediaSession2 that will override default playlist handling behaviors. 
MediaPlaylistAgent.PlaylistEventCallback A callback class to receive notifications for events on the media player. 
MediaSession2 Allows a media app to expose its transport controls and playback information in a process to other processes including the Android framework and other apps. 
MediaSession2.Builder Builder for MediaSession2
MediaSession2.CommandButton Button for a SessionCommand2 that will be shown by the controller. 
MediaSession2.CommandButton.Builder Builder for MediaSession2.CommandButton
MediaSession2.ControllerInfo Information of a controller. 
MediaSession2.SessionCallback Callback to be called for all incoming commands from MediaController2s. 
MediaSessionService2 Base class for media session services, which is the service version of the MediaSession2
MediaSessionService2.MediaNotification Returned by MediaSessionService2.onUpdateNotification() for making session service foreground service to keep playback running in the background. 
MediaTimestamp2 An immutable object that represents the linear correlation between the media time and the system time. 
PlaybackParams2 Structure for common playback params. 
PlaybackParams2.Builder The builder class that makes it easy to chain setters to create a PlaybackParams2 object. 
Rating2 A class to encapsulate rating information used as content metadata. 
SessionCommand2 Define a command that a MediaController2 can send to a MediaSession2
SessionCommandGroup2 A set of SessionCommand2 which represents a command group. 
SessionCommandGroup2.Builder Builds a SessionCommandGroup2 object. 
SessionToken2 Represents an ongoing MediaSession2 or a MediaSessionService2
SubtitleData2 Class encapsulating subtitle data, as received through the MediaPlayer2.EventCallback.onSubtitleData(MediaPlayer2, DataSourceDesc2, SubtitleData2) interface. 
TimedMetaData2 Class that embodies one timed metadata access unit, including
  • a time stamp, and
  • raw uninterpreted byte-array extracted directly from the container. 
UriDataSourceDesc2 Structure for data source descriptor for Uri
UriDataSourceDesc2.Builder This Builder class simplifies the creation of a UriDataSourceDesc2 object. 

Exceptions

MediaPlayer2.NoDrmSchemeException Thrown when a DRM method is called before preparing a DRM scheme through prepareDrm().