媒体控件 #134

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