Media: Restore seekRelative IPC call. Fix #709

This commit is contained in:
ItsLemmy
2025-11-10 19:37:23 -05:00
parent 40f182e98a
commit 8cb58ac144
2 changed files with 10 additions and 1 deletions
+1 -1
View File
@@ -341,7 +341,7 @@ Item {
}
function seekRelative(offset: string) {
var offsetVal = parseFloat(position)
var offsetVal = parseFloat(offset)
if (Number.isNaN(offsetVal)) {
Logger.w("Media", "Argument to ipc call 'media seekRelative' must be a number")
return
+9
View File
@@ -250,6 +250,15 @@ Singleton {
}
}
function seekRelative(offset) {
let target = currentPlayer ? (currentPlayer._controlTarget || currentPlayer) : null
if (target && target.canSeek && target.length > 0) {
let seekPosition = target.position + offset
target.position = seekPosition
currentPosition = seekPosition
}
}
// Seek to position based on ratio (0.0 to 1.0)
function seekByRatio(ratio) {
let target = currentPlayer ? (currentPlayer._controlTarget || currentPlayer) : null