Fix update media end time

This commit is contained in:
Rafostar
2020-10-23 10:26:11 +02:00
parent e7a39d6af8
commit 576440faff
4 changed files with 21 additions and 17 deletions

View File

@@ -344,6 +344,9 @@ class ClapperPlayer extends GstPlayer.Player
let clapperWidget = this.widget.get_ancestor(Gtk.Grid);
let nextUpdate = clapperWidget.updateTime();
if(nextUpdate === null)
return;
this._updateTimeTimeout = GLib.timeout_add(GLib.PRIORITY_DEFAULT, nextUpdate, () => {
this._updateTimeTimeout = null;
@@ -370,14 +373,15 @@ class ClapperPlayer extends GstPlayer.Player
{
this.state = state;
let clapperWidget = this.widget.get_ancestor(Gtk.Grid);
if(!clapperWidget) return;
if(!this.seek_done && this.state !== GstPlayer.PlayerState.BUFFERING) {
clapperWidget.updateTime();
this.seek_done = true;
debug('seeking finished');
}
let clapperWidget = this.widget.get_ancestor(Gtk.Grid);
if(!clapperWidget) return;
clapperWidget._onPlayerStateChanged(player, state);
}
@@ -468,7 +472,9 @@ class ClapperPlayer extends GstPlayer.Player
break;
case Gdk.KEY_Right:
case Gdk.KEY_Left:
value = clapperWidget.controls.positionScale.get_value();
value = Math.round(
clapperWidget.controls.positionScale.get_value()
);
this.seek_seconds(value);
this._setHideControlsTimeout();
clapperWidget.controls.isPositionSeeking = false;