From 734471475fcca8436dd4762535865dc6cdfefd96 Mon Sep 17 00:00:00 2001 From: Rafostar <40623528+Rafostar@users.noreply.github.com> Date: Sun, 30 Aug 2020 20:19:37 +0200 Subject: [PATCH] Add "seek_seconds" function Default "seek" function takes time in nanoseconds as argument which is not that useful, cause we will start playback from the nearest keyframe anyway. The new "seek_seconds" can take a double value for more precise seeking. --- src/player.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/player.js b/src/player.js index e9fc57a8..2716627f 100644 --- a/src/player.js +++ b/src/player.js @@ -28,6 +28,11 @@ class GtkPlayer extends GstPlayer.Player this.widget.connect('destroy', this._onWidgetDestroy.bind(this)); } + seek_seconds(position) + { + this.seek(position * 1000000000); + } + _onStateChanged(player, state) { this.state = state;