feat: draggable progress bar (seek) and settings sliders
This commit is contained in:
@@ -154,6 +154,13 @@ class MediaSessionSource(context: Context) {
|
||||
Log.d(TAG, "playPause: index=$index playing=$playing")
|
||||
}
|
||||
|
||||
// 拖动进度条 seek 到指定位置(毫秒)
|
||||
// Seek to the given position (ms) when dragging the progress bar
|
||||
fun seekTo(index: Int, position: Long) {
|
||||
controllers.getOrNull(index)?.transportControls?.seekTo(position)
|
||||
Log.d(TAG, "seekTo: index=$index position=$position")
|
||||
}
|
||||
|
||||
// 跳转到指定会话的播放界面:优先 sessionActivity(PendingIntent),
|
||||
// 失败则回退到启动该 App
|
||||
// Jump to the session's playback UI: prefer sessionActivity (PendingIntent),
|
||||
|
||||
@@ -355,6 +355,13 @@ class JsBridge(
|
||||
mediaSourceRef?.next(index)
|
||||
}
|
||||
|
||||
// 拖动进度条 seek 到指定位置(毫秒)
|
||||
// Seek to the given position (ms) when dragging the progress bar
|
||||
@android.webkit.JavascriptInterface
|
||||
fun mediaSeekTo(index: Int, position: Long) {
|
||||
mediaSourceRef?.seekTo(index, position)
|
||||
}
|
||||
|
||||
// 跳转到指定会话的播放界面(封面点击)
|
||||
// Jump to the session's playback UI (cover tap)
|
||||
@android.webkit.JavascriptInterface
|
||||
|
||||
Reference in New Issue
Block a user