From 8351066a8b8c5190b04609018e6af055b6c63fac Mon Sep 17 00:00:00 2001 From: Rafostar <40623528+Rafostar@users.noreply.github.com> Date: Mon, 9 Nov 2020 11:42:19 +0100 Subject: [PATCH] Add changing seek mode during playback patch --- clapper_src/playerBase.js | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/clapper_src/playerBase.js b/clapper_src/playerBase.js index c74474fc..fac6e123 100644 --- a/clapper_src/playerBase.js +++ b/clapper_src/playerBase.js @@ -161,18 +161,30 @@ class ClapperPlayerBase extends GstPlayer.Player { switch(key) { case 'seeking-mode': + let isSeekMode = (typeof this.set_seek_mode !== 'undefined'); this.seekingMode = settings.get_string('seeking-mode'); switch(this.seekingMode) { case 'fast': - this.set_config_option('seek_fast', true); + if(isSeekMode) + this.set_seek_mode(GstPlayer.PlayerSeekMode.FAST); + else + this.set_config_option('seek_fast', true); break; case 'accurate': - this.set_config_option('seek_fast', false); - this.set_config_option('seek_accurate', true); + if(isSeekMode) + this.set_seek_mode(GstPlayer.PlayerSeekMode.ACCURATE); + else { + this.set_config_option('seek_fast', false); + this.set_config_option('seek_accurate', true); + } break; default: - this.set_config_option('seek_fast', false); - this.set_config_option('seek_accurate', false); + if(isSeekMode) + this.set_seek_mode(GstPlayer.PlayerSeekMode.DEFAULT); + else { + this.set_config_option('seek_fast', false); + this.set_config_option('seek_accurate', false); + } break; } break;