LightBlog

mercredi 10 juin 2020

Android 11’s new Media Controls can remember up to 5 previous media sessions

Earlier today, Google unloaded a host of new videos and developer documentation for the new Android 11 beta release. While we’ve already documented a lot of the new features and APIs in previous articles, there are always tidbits of information that Google reveals with newly published documentation. One of the newest features is dubbed “Media Controls,” and it’s actually a far more interesting feature than what Google initially revealed in the Android 11 beta announcement.

But first, let’s recap what the new Media Controls feature does in Android 11. In Android 5.0 Lollipop (API level 21), Google introduced a Notification type called “MediaStyle.” This notification style is intended for media playback notifications and supports up to 5 actions in the expanded form, showing a large icon usually containing album artwork, and more. Most developers of media streaming applications implemented this notification style, but the problem is that there are a ton of media streaming apps that can each show their own media playback notifications.

Google is now consolidating media playback notifications by creating a dedicated persistent space for media players in the Quick Settings panel in Android 11. This gives users easy access to media controls regardless of what app is showing or what other notifications are pending. Media controls can also show up on the lock screen, too. What’s more, Google has added a new button in the top right that launches an output picker dialog so users can quickly choose what device they want to play their media on.

Perhaps the best part of the new Media Controls feature is that media playback notifications can now be persistent across media playback sessions or device reboots. If an app implements the MediaBrowserService and MediaSession, then the SystemUI can show up to 5 previous sessions in the Media Controls part of the Quick Settings panel/lock screen.

If multiple media sessions are available, Android 11 will arrange them in a swipeable carousel. The carousel lists media sessions in order from streams playing locally on the phone to remote streams (such as for cast sessions) to previous resumable sessions (in the order in which they were last played).

Android 11 media controls sessions

That means that if you recently ended a media session in Spotify, Pandora, YouTube Music, or other media streaming applications, meaning their media playback notifications are no longer visible, you won’t have to open up those apps again just to resume playback.

In Android 11 Beta 1, this feature is currently not enabled by default. Users will have to go to Settings > Developer Options and then toggle “Media Resumption” for the new Media Controls to show up. Take note that the screenshots that Google shared in their official Android 11 announcement are from a slightly newer build than Beta 1, but the functionality is still there, so Google encourages developers of media applications to play around with this new feature.

For more information on how the new Media Controls work, check out Google’s developer documentation or watch the video below from Dan Sandler on the SystemUI team (time-stamped to 7:30).

The post Android 11’s new Media Controls can remember up to 5 previous media sessions appeared first on xda-developers.



from xda-developers https://ift.tt/2Yowpog
via IFTTT

Aucun commentaire:

Enregistrer un commentaire