androidx / media

Jetpack Media3 support libraries for media use cases, including ExoPlayer, an extensible media player for Android
https://developer.android.com/media/media3
Apache License 2.0
1.68k stars 399 forks source link

Media-Service Notification Seekbar Style #1453

Closed syslogic closed 1 month ago

syslogic commented 4 months ago

Version

Media3 1.3.1

More version details

The media-service notification seekbar drag-handle changes it's size, when clicking next.

The Intent is being constructed alike this:

PendingIntent intent = MediaButtonReceiver.buildMediaButtonPendingIntent(this, PlaybackState.ACTION_SKIP_TO_NEXT);
new NotificationCompat.Action(androidx.media3.session.R.drawable.media3_notification_seek_to_next, "Next", intent);

Which subsequently runs this code on Intent.ACTION_MEDIA_BUTTON:

if (mExoPlayer.hasNextMediaItem()) {mExoPlayer.seekToNext();}

It also happens, when clicking the "next" button in the ExoPlayer control view.

Devices that reproduce the issue

Motorola G100, Huawei Matepad Pro

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Not tested

Reproduction steps

Start audio playback with a notification, open the notification panel, then click "next". This happens when clicking media-action "next" in the notification. But not when the player continues with the next track.

Expected result

The seekbar drag-handle should maintain it's size, just alike it does when progressing to the next track.

Actual result

The seekbar drag-handle changes it's size, for some unknown reason. It's unclear, what the drag-handle size means (if there is a cause). Once it's large, it stays large, when progressing to the next track.

Media

screenshot_01 screenshot_02

Bug Report

oceanjules commented 2 months ago

1) The fact that you are using MediaButtonReceiver.buildMediaButtonPendingIntent tells me that your receiver is from media1 library (MediaButtonReceiver) instead of media3 (MediaButtonReceiver). Although you mention using Media3 1.3.1?

Have you taken a look at: https://developer.android.com/media/legacy/media-buttons?

2) Unfortunately, it is SystemUI that is responsible for rendering that seekbar. You can see the Media3 side of things in DefaultMediaNotificationProvider -- which can be customized or replaced by an app. There are no properties for us to send to manipulate the layout of the notification. Also, above API 31, the notification is ignored completely and SystemUI renders the UMO notification based on the Session properties.

google-oss-bot commented 2 months ago

Hey @syslogic. We need more information to resolve this issue but there hasn't been an update in 14 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot commented 1 month ago

Since there haven't been any recent updates here, I am going to close this issue.

@syslogic if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.