Playback fix
🏗️ Build and Test JellyTau / Run Tests (push) Successful in 4m28s
Traceability Validation / Check Requirement Traces (push) Successful in 22s
🏗️ Build and Test JellyTau / Build Android APK (push) Successful in 18m37s
Build & Release / Run Tests (push) Successful in 4m12s
Build & Release / Build Linux (push) Successful in 16m20s
Build & Release / Build Android (push) Successful in 18m57s
Build & Release / Create Release (push) Successful in 13s

This commit is contained in:
2026-07-02 18:13:55 +02:00
parent 6af7f7dcca
commit 1f6977cd01
16 changed files with 653 additions and 101 deletions
+10
View File
@@ -21,6 +21,7 @@
reportPlaybackStopped,
} from "$lib/services/playbackReporting";
import { cleanup as cleanupNextEpisode } from "$lib/services/nextEpisodeService";
import * as html5Adapter from "$lib/player/html5Adapter";
const itemId = $derived($page.params.id);
const queueParam = $derived($page.url.searchParams.get("queue"));
@@ -514,6 +515,11 @@
if (id) {
reportPlaybackStart(id, positionSeconds, context.type, context.id);
}
// Mirror HTML5 <video> state into the Rust PlayerController so it is the
// single source of truth for video playback (see html5Adapter.ts). The
// element lives in the webview and Rust cannot observe it directly.
html5Adapter.reportState("playing", id ?? null);
html5Adapter.reportPosition(positionSeconds, get(playbackDuration), { force: true });
}
function handleReportProgress(positionSeconds: number, isPaused: boolean, reportId?: string) {
@@ -521,6 +527,9 @@
if (id) {
reportPlaybackProgress(id, positionSeconds, isPaused);
}
// Feed the Rust controller the current position and play/pause state.
html5Adapter.reportState(isPaused ? "paused" : "playing", id ?? null);
html5Adapter.reportPosition(positionSeconds, get(playbackDuration), { force: true });
}
function handleReportStop(positionSeconds: number, reportId?: string) {
@@ -528,6 +537,7 @@
if (id) {
reportPlaybackStopped(id, positionSeconds);
}
html5Adapter.reportState("stopped", id ?? null);
}
async function handleVideoEnded() {