Android Support Library Media Compat Update log and version history
Android Support Library Media Compat is a support library of Android, which provides developers with the function of processing multimedia content.This article will introduce the update log and version history of Android Support Library Media Compat, and provide relevant Java code examples.
Update log:
v28.0.0
- initial version.Introduce MediaSessionCompat, MediaBrowsercompat, MediaDescriptcomCompat and other functions to achieve functions such as audio playback, media browsing, and media descriptions.
v28.0.1
-Phe some problems and improve stability and performance.
v28.0.2
-The fixes related to specific devices and Android versions.
-It some new features of the use of MediaSessionCompat.
v28.1.0
-Added support for MediaBrowServiceCompat to process media browsing and playback in the background.
-Added support for MediaControllerCompat.transportControls for control of media playback.
v28.1.1
-Pei some issues related to Android P (9.0).
-In improvement of media controller compatibility.
v28.2.0
-Added support for MediaBrowsercomPat.Mediatem to represent various items in the media library.
-Added support for MedialibraryServiceCompat to provide media browsing services used to provide customized users.
v28.2.1
-Phe some problems and improve performance and stability.
v28.3.0
-Che support for sessionCommand to handle custom media operation commands.
-Added support for MediaBrowsercompat.SubscriptionCallback to subscribe to the content changes in the media library.
Version history:
Android Support Library Media Compat has continuously added new functions and fixing known problems in each version.Developers can choose suitable versions according to their needs.
Here are some examples of Java code for Java code using Android Support Library Media Compat:
1. Create a MediaSessionCompat instance:
MediaSessionCompat mediaSession = new MediaSessionCompat(context, "MediaSession");
mediaSession.setFlags(MediaSessionCompat.FLAG_HANDLES_MEDIA_BUTTONS | MediaSessionCompat.FLAG_HANDLES_TRANSPORT_CONTROLS);
...
mediaSession.setActive(true);
2. Create a MediaBrowserCompat instance:
MediaBrowserCompat mediaBrowser = new MediaBrowserCompat(context,
new ComponentName(context, MediaPlaybackService.class),
new MediaBrowserCompat.ConnectionCallback() {
@Override
public void onConnected() {
// Processing logic after successful connection
}
@Override
public void onConnectionFailed() {
// The processing logic of the connection after the failure
}
...
},
null);
mediaBrowser.connect();
3. Use MediaControllerCompat to control the media playback:
MediaControllerCompat mediaController = mediaBrowser.getSessionToken();
mediaController.getTransportControls().play();
mediaController.getTransportControls().pause();
mediaController.getTransportControls().skipToNext();
...
The above is the update log and version history of Android Support Library Media Compat, as well as related Java code examples.Developers can choose suitable library versions according to their needs and use the code provided for development.