媒体通道通知栏图标过大 #129

This commit is contained in:
HapeLee
2025-10-24 00:30:08 +08:00
parent 3074f5a2cc
commit a1cfbbe8de
2 changed files with 31 additions and 31 deletions
@@ -443,23 +443,23 @@ class AudioPlayService : BaseService(),
* 更新媒体状态
*/
private fun upMediaSessionPlaybackState(state: Int) {
mediaSessionCompat?.setPlaybackState(
PlaybackStateCompat.Builder()
.setActions(MEDIA_SESSION_ACTIONS)
.setState(state, exoPlayer.currentPosition, 1f)
.setBufferedPosition(exoPlayer.bufferedPosition)
.addCustomAction(
APP_ACTION_STOP,
getString(R.string.stop),
R.drawable.ic_stop_black_24dp
)
.addCustomAction(
APP_ACTION_TIMER,
getString(R.string.set_timer),
R.drawable.ic_time_add_24dp
)
.build()
)
// mediaSessionCompat?.setPlaybackState(
// PlaybackStateCompat.Builder()
// .setActions(MEDIA_SESSION_ACTIONS)
// .setState(state, exoPlayer.currentPosition, 1f)
// .setBufferedPosition(exoPlayer.bufferedPosition)
// .addCustomAction(
// APP_ACTION_STOP,
// getString(R.string.stop),
// R.drawable.ic_stop_black_24dp
// )
// .addCustomAction(
// APP_ACTION_TIMER,
// getString(R.string.set_timer),
// R.drawable.ic_time_add_24dp
// )
// .build()
// )
}
/**
@@ -442,20 +442,20 @@ abstract class BaseReadAloudService : BaseService(),
* 更新媒体状态
*/
private fun upMediaSessionPlaybackState(state: Int) {
mediaSessionCompat.setPlaybackState(
PlaybackStateCompat.Builder()
.setActions(MediaHelp.MEDIA_SESSION_ACTIONS)
.setState(state, nowSpeak.toLong(), 1f)
// 为系统媒体控件添加定时按钮
.addCustomAction(
PlaybackStateCompat.CustomAction.Builder(
"ACTION_ADD_TIMER",
getString(R.string.set_timer),
R.drawable.ic_time_add_24dp
).build()
)
.build()
)
// mediaSessionCompat.setPlaybackState(
// PlaybackStateCompat.Builder()
// .setActions(MediaHelp.MEDIA_SESSION_ACTIONS)
// .setState(state, nowSpeak.toLong(), 1f)
// // 为系统媒体控件添加定时按钮
// .addCustomAction(
// PlaybackStateCompat.CustomAction.Builder(
// "ACTION_ADD_TIMER",
// getString(R.string.set_timer),
// R.drawable.ic_time_add_24dp
// ).build()
// )
// .build()
// )
}
/**