Android MediaSession:如何选择锁定屏幕上显示的图标?

发布于 2025-01-26 11:08:05 字数 791 浏览 4 评论 0原文

我有一个通过MediaSessionCompat播放媒体的应用程序。

我使用notificationcompat为通知抽屉创建通知,然后使用notification managercompat.notify发布通知,看起来很棒。 (请参阅屏幕截图。)

我的问题是锁定屏幕。它仅显示播放,上一个曲目和下一个曲目图标。 我缺少在当前播放轨道中向后跳回去的控件。(请参阅屏幕截图。)

我正在使用mediaSession.setplaybackstate指定可用操作,我包括playbackStateCompat的所有适当的,用于倒带,快速前进,跳到上一个,然后跳到下一个。

锁定屏幕的配置与通知不同吗?还是开发人员对这里提供的控件的控制权较少?

先感谢您!

”在此处输入图像描述”

I have an app that plays media via MediaSessionCompat.

I create a notification for the Notification Drawer using NotificationCompat and post it using NotificationManagerCompat.notify, and it looks great. (See screenshot.)

My problem is with the lock screen. It only shows Play, Previous Track, and Next Track icons. I'm missing the controls to jump back and forward within the currently playing track. (See screenshot.)

I'm using MediaSession.setPlaybackState to specify the actions that are available, and I am including all the appropriate ones from PlaybackStateCompat for rewind, fast forward, skip to previous, and skip to next.

Is the lock screen configured differently than the notification? Or do developers simply have less control over the controls provided here?

Thank you in advance!

enter image description here

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文