mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Media: Restore seekRelative IPC call. Fix #709
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user