mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-06-07 04:15:26 +00:00
replace seek with seekRelative
This commit is contained in:
@@ -189,13 +189,13 @@ Item {
|
||||
MediaService.previous()
|
||||
}
|
||||
|
||||
function seek(position: string) {
|
||||
var positionVal = parseFloat(position)
|
||||
if (Number.isNaN(positionVal)) {
|
||||
Logger.warn("Media", "Argument to ipc call 'media seek' must be a number")
|
||||
function seekRelative(offset: string) {
|
||||
var offsetVal = parseFloat(position)
|
||||
if (Number.isNaN(offsetVal)) {
|
||||
Logger.warn("Media", "Argument to ipc call 'media seekRelative' must be a number")
|
||||
return
|
||||
}
|
||||
MediaService.seek(positionVal)
|
||||
MediaService.seekRelative(offsetVal)
|
||||
}
|
||||
|
||||
function seekByRatio(position: string) {
|
||||
|
||||
@@ -143,6 +143,14 @@ Singleton {
|
||||
}
|
||||
}
|
||||
|
||||
function seekRelative(offset) {
|
||||
if (currentPlayer && currentPlayer.canSeek) {
|
||||
var newPosition = currentPlayer.position + offset;
|
||||
currentPlayer.position = newPosition;
|
||||
currentPosition = newPosition;
|
||||
}
|
||||
}
|
||||
|
||||
// Seek to position based on ratio (0.0 to 1.0)
|
||||
function seekByRatio(ratio) {
|
||||
if (currentPlayer && currentPlayer.canSeek && currentPlayer.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user