Open In App

How to Use Media Control Access in Android 13?

Last Updated : 07 Feb, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

The quick settings, notifications, the Settings app, and other features all seem to undergo changes with each major update to Android. The buttons for media playback have likewise seen numerous adjustments, most recently in Android 11, and have now undergone another overhaul for Android 13. Now, again in Android 13, we see various new changes to Media Control, which we will be discussing in this article. Action buttons and remote playback have been updated in Android 13’s media controls’ System UI. These modifications allow smooth media transfers between devices and support a more refined media control experience on phones and tablets.

Control of the media implementation

This change in default behavior affects how media controls for apps are generated, thus OEMs need to be aware of it. OEMs must additionally make sure that their output switcher features are compatible with the new system API.

What’s new with Media Control Access in Android 13

Android 13, has numerous new features and API updates, including new media controls. The controls are still situated between the quick settings menu and notification panel, but the widget is considerably bigger now that the timeline bar, complete title, and other info are constantly visible. This reduces the number of taps needed to advance or reverse through a song, but it also leaves less space for notifications. 

The album image is now stretched to fill the player’s entire background, and the colors of the buttons are now determined by the album art rather than the dynamic Material You colors of the system, which is another change to the visual design. The media controls on the lock screen have the same layout.

GeekTip #1: For apps that don’t upgrade to target Android 13 or that don’t provide PlaybackState information, System UI continues to offer a different layout that employs notification actions for backward compatibility.

We will now look at how each aspect changes in Android 13

Action Button Changes:

Action buttons on media controls for Android 13 are descended from the PlaybackState action states to guarantee that users may access a comprehensive set of media controls for apps streaming media. Now, using the PlaybackState action state, the MediaDataManager#createActionsFromState function generates action button information. This is consistent with the presentation of media controls on other Android platforms like Auto, Assistant, and Wear.

Remote Play Service:

Starting with Android 13, a new system API called Notification_setRemotePlaybackInfo is provided to indicate media notifications on the media control System UI for remote playback. This is done to deliver a consistent media experience across a range of surfaces. The system programs that post the notifications can do the following thanks to this API: Give the default output switcher on the media control information and capability for media coming from a remote device.

Output Determining Support:

Applications running on the system that use this notification require the MEDIA_CONTENT_CONTROL permission.

Features of Remote Playback Service

The following features are additionally added by the Notification_setRemotePlaybackInfo API to learn the name, icon, and purpose of the remote playback device:

  1. Notification#EXTRA MEDIA REMOTE DEVICE
  2. Notification#EXTRA MEDIA REMOTE ICON
  3. Notification#EXTRA MEDIA REMOTE INTENT

The ability to modify remote playback

If the OEM has a system app that posts alerts for remote media playing, the app may, if it has been given the MEDIA_CONTENT_CONTROL permission, call setRemotePlaybackInfo for notification. 

GeekTip #2: This is not necessary, though, and the partner is free to forego customization.

Verifying the newer Media Control

You can do the below steps to ensure that the content is now being played with using the normal Media Control, to do so, you can:

  1. The buttons work as expected while an app is playing media.
  2. Run a manual test to confirm the following to test media control in the System UI:
  3. The output switcher accurately displays device data.

Conclusion

Hope this article helped you learn something new, understood how to use the new Media Access Control, and optimize the content to be presented in the newer format. Know that swiping the card will remove it from the notifications list due to the redesign’s removal of the X-to-close button, but playback will continue in the background.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads