From 772f915b7424c98e37888db9312f94af15522445 Mon Sep 17 00:00:00 2001 From: dirtydishes Date: Mon, 25 May 2026 15:50:17 -0400 Subject: [PATCH] seek native skips by position --- Dreamio/VLCNativePlaybackBackend.swift | 8 +++--- ...05-25-add-native-playback-seek-buffer.html | 26 +++++++++++++++++++ 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/Dreamio/VLCNativePlaybackBackend.swift b/Dreamio/VLCNativePlaybackBackend.swift index 8ff8bc4..c246738 100644 --- a/Dreamio/VLCNativePlaybackBackend.swift +++ b/Dreamio/VLCNativePlaybackBackend.swift @@ -133,11 +133,11 @@ final class VLCNativePlaybackBackend: NSObject, NativePlaybackBackend { #if DEBUG print("[DreamioVLC] jump seconds=\(seconds) from=\(currentTime) to=\(nextTime) duration=\(duration) seekBufferMilliseconds=\(Self.seekBufferMilliseconds)") #endif - if seconds > 0 { - mediaPlayer.jumpForward(Int32(seconds.rounded())) - } else if seconds < 0 { - mediaPlayer.jumpBackward(Int32(abs(seconds).rounded())) + guard duration > 0 else { + return } + mediaPlayer.position = Float(nextTime / duration) + mediaPlayer.play() #endif } diff --git a/docs/turns/2026-05-25-add-native-playback-seek-buffer.html b/docs/turns/2026-05-25-add-native-playback-seek-buffer.html index 8c13700..3c21e53 100644 --- a/docs/turns/2026-05-25-add-native-playback-seek-buffer.html +++ b/docs/turns/2026-05-25-add-native-playback-seek-buffer.html @@ -323,6 +323,32 @@ index c3c2318..0fa779a 100644

Related issues or PRs

Related Beads issue: dreamio-3yb. This remains part of the same native seek-buffer tuning task.

+ +
+

New Changes as of 2026-05-25 15:50 EDT

+

Summary of changes

+

After testing still showed repeated VLC buffering with the native relative jump APIs, the 15-second skip path now uses the same normalized position seek mechanism as the scrubber, then calls play() to nudge VLC out of the paused or buffering state seen in device logs.

+ +

Why this change was made

+

The scrubber path is the remaining seek path that has not shown the same hanging behavior in the logs. Reusing it for fixed-size jumps keeps all native seeks on one mechanism while preserving the UI and protocol.

+ +

Code diffs

+
diff --git a/Dreamio/VLCNativePlaybackBackend.swift b/Dreamio/VLCNativePlaybackBackend.swift
+@@
+-        if seconds > 0 {
+-            mediaPlayer.jumpForward(Int32(seconds.rounded()))
+-        } else if seconds < 0 {
+-            mediaPlayer.jumpBackward(Int32(abs(seconds).rounded()))
+-        }
++        guard duration > 0 else {
++            return
++        }
++        mediaPlayer.position = Float(nextTime / duration)
++        mediaPlayer.play()
+ +

Related issues or PRs

+

Related Beads issue: dreamio-3yb. This update is still part of the same native playback seek-buffer branch.

+