Skip to content

【功能建议】适配在 ColorOS17 系统的锁屏界面显示大屏歌词的需求 #2263

Open

Description

@Again1996-bit

在反馈此问题前请注意 Please note before reporting this issue

  • 已经查看相关帮助内容 Read more about the Salt Player help content
  • 已经在本仓库搜索相关内容(避免重复反馈)Already searched for related content in this repository (to avoid duplicate feedback)
  • 确认仅将提交一个问题(多个问题或者备注提及另外的问题请重新提交新的,如建议 1、2、3 请分开提交。即便是针对某个功能的不太相关的点也应该分开提交,如歌词建议支持大小和颜色调节,应该分开提交大小、颜色的建议)Confirm to submit only one issue (if multiple issues or notes mention other issues, please submit a new one separately)

平台 Platform

  • Android
  • Windows
  • HarmonyOS

描述 Describe

一、问题描述

Salt Music 目前无法在 ColorOS17 系统的锁屏界面显示大屏歌词。
用户在锁屏时无法看到当前播放歌曲的歌词,体验不完整。

二、问题原因

通过 ADB 分析发现以下问题:

  1. 通知渠道锁定

    • Salt Player Channel Id 的 LockscreenVisibility=-1000
    • 导致通知在锁屏上完全隐藏
  2. 未实现 MediaStyle 通知

    • 未使用 Notification.MediaStyle()
    • 未设置 MediaSession Token
    • 未注册 MediaSession.Callback
  3. 未实现自定义 RemoteViews

    • 没有创建歌词铺满的大视图 (BigContentView)
    • 没有自定义锁屏歌词布局

三、竞品对比

APP 锁屏歌词 说明
QQ音乐 ✅ 支持 使用 MediaStyle + RemoteViews
网易云 ✅ 支持 使用 MediaStyle + RemoteViews
Salt Music ❌ 不支持 缺少以上实现

目前Salt Music只有这种
Image
但是其他播放器可以实现这种情况
Image
Image

四、建议实现方案

  1. 通知渠道设置
    NotificationChannel 应设置为:

    • importance = IMPORTANCE_LOW 或 IMPORTANCE_DEFAULT
    • LockscreenVisibility = VISIBILITY_PUBLIC (1)
  2. MediaSession 服务

    • 创建 MediaSession 并注册 Callback
    • 在播放状态变化时更新 PlaybackState
    • 设置 MediaMetadata(包含歌词)
  3. Notification.MediaStyle
    Notification.Builder builder = new Notification.Builder(context, channel)
    .setStyle(new Notification.MediaStyle()
    .setMediaSession(session.getSessionToken())
    .setShowActionsInCompactView(0, 1, 2)
    .setBigContentView(lyricsRemoteViews))
    .setCustomBigContentView(lyricsRemoteViews);

  4. RemoteViews 歌词布局

    • 创建自定义布局文件
    • 支持播放控制按钮(上一首/播放暂停/下一首)
    • 支持歌词逐行/逐字显示
    • 点击歌词可展开铺满屏幕

五、技术接口参考

  • android.media.session.MediaSession
  • android.media.session.PlaybackState
  • android.media.MediaMetadata
  • android.app.Notification.MediaStyle
  • android.widget.RemoteViews
  • android.app.PendingIntent

六、ColorOS 特殊说明

ColorOS/OPlus 系统有额外的锁屏歌词渲染支持:

  • com.android.systemui 的 KeyguardMediaController
  • com.heytap.colorfulengine 的 KeyguardStyleService

如需深度集成,可考虑:

  • 注册 MediaSession 并设置 lyricInfo
  • 适配 ColorOS 的歌词 API

Activity

  1. changed the title [-]【功能建议】无法在 ColorOS17 系统的锁屏界面显示大屏歌词[/-] [+]【功能建议】适配在 ColorOS17 系统的锁屏界面显示大屏歌词的需求[/+] on Oct 21, 2026
  2. Moriafly commented on Oct 21, 2026

    @Moriafly
    Owner

    你好,和这个分析关系不大,可能并不是这种情况。还是需要 OPPO 的特殊适配接口,已和 OPPO 团队在沟通。

  3. Again1996-bit commented on Oct 22, 2026

    @Again1996-bit
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions