fix(Remote playback): kludge to scrub after stream move
This commit is contained in:
@@ -73,7 +73,10 @@ function createPlaybackModeStore() {
|
||||
* - Polls remote session until track loads
|
||||
* - Stops local playback
|
||||
*/
|
||||
async function transferToRemote(sessionId: string | null | undefined): Promise<void> {
|
||||
async function transferToRemote(
|
||||
sessionId: string | null | undefined,
|
||||
currentPosition?: number,
|
||||
): Promise<void> {
|
||||
console.log("[PlaybackMode] Transferring to remote session:", sessionId);
|
||||
update((s) => ({ ...s, isTransferring: true, transferError: null }));
|
||||
|
||||
@@ -88,10 +91,17 @@ function createPlaybackModeStore() {
|
||||
};
|
||||
|
||||
try {
|
||||
// Pass the caller's current local position so the remote resumes where we
|
||||
// are. The backend can't reliably read this itself: on Linux video plays in
|
||||
// the HTML5 <video> element and the MPV backend reports 0. A null override
|
||||
// falls back to the backend position (correct for Linux audio via MPV).
|
||||
const positionOverride =
|
||||
currentPosition !== undefined && currentPosition > 0 ? currentPosition : null;
|
||||
|
||||
// Rust handles everything - just wait for it to complete
|
||||
// It includes its own 5-second timeout for track loading
|
||||
console.log("[PlaybackMode] About to invoke playback_mode_transfer_to_remote with sessionId:", sessionId);
|
||||
await commands.playbackModeTransferToRemote(sessionId ?? "");
|
||||
console.log("[PlaybackMode] About to invoke playback_mode_transfer_to_remote with sessionId:", sessionId, "position:", positionOverride);
|
||||
await commands.playbackModeTransferToRemote(sessionId ?? "", positionOverride);
|
||||
console.log("[PlaybackMode] Invoke completed successfully");
|
||||
|
||||
if (aborted) {
|
||||
|
||||
Reference in New Issue
Block a user