Add changing seek mode during playback patch

This commit is contained in:
Rafostar
2020-11-09 11:42:19 +01:00
parent dd3ba11c0e
commit 8351066a8b

View File

@@ -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':
if(isSeekMode)
this.set_seek_mode(GstPlayer.PlayerSeekMode.FAST);
else
this.set_config_option('seek_fast', true);
break;
case 'accurate':
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:
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;