feat: media card polish - per-index controls, cover jump, wrap, slide transition

This commit is contained in:
2026-08-16 20:13:47 +08:00
parent c82418f846
commit 8d10d9e5e9
4 changed files with 250 additions and 89 deletions
@@ -314,21 +314,29 @@ class JsBridge(
mediaSourceRef?.refresh()
}
// 媒体播放控制(作用于当前展示的会话
// Media transport controls (act on the currently shown session)
// 媒体播放控制(作用于指定索引的会话,对应 H5 当前滑到的卡片
// Media transport controls (act on the session at the given index, matching
// the card the H5 is currently showing)
@android.webkit.JavascriptInterface
fun mediaPrevious() {
mediaSourceRef?.previous()
fun mediaPrevious(index: Int) {
mediaSourceRef?.previous(index)
}
@android.webkit.JavascriptInterface
fun mediaPlayPause() {
mediaSourceRef?.playPause()
fun mediaPlayPause(index: Int) {
mediaSourceRef?.playPause(index)
}
@android.webkit.JavascriptInterface
fun mediaNext() {
mediaSourceRef?.next()
fun mediaNext(index: Int) {
mediaSourceRef?.next(index)
}
// 跳转到指定会话的播放界面(封面点击)
// Jump to the session's playback UI (cover tap)
@android.webkit.JavascriptInterface
fun openMediaApp(index: Int) {
mediaSourceRef?.openMediaApp(index)
}
private fun pushMedia(infos: List<MediaInfo>, webView: android.webkit.WebView) {