mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-31 08:21:59 +02:00
Go back to beginning after playback ends
This commit is contained in:
3
clapper_src/controls.js
vendored
3
clapper_src/controls.js
vendored
@@ -162,6 +162,9 @@ var Controls = GObject.registerClass({
|
|||||||
|
|
||||||
handleScaleIncrement(type, isUp)
|
handleScaleIncrement(type, isUp)
|
||||||
{
|
{
|
||||||
|
if(type === 'volume' && !this.volumeButton.visible)
|
||||||
|
return;
|
||||||
|
|
||||||
let value = this[`${type}Scale`].get_value();
|
let value = this[`${type}Scale`].get_value();
|
||||||
let maxValue = this[`${type}Adjustment`].get_upper();
|
let maxValue = this[`${type}Adjustment`].get_upper();
|
||||||
let increment = this[`${type}Adjustment`].get_page_increment();
|
let increment = this[`${type}Adjustment`].get_page_increment();
|
||||||
|
@@ -349,12 +349,14 @@ class ClapperInterface extends Gtk.Grid
|
|||||||
this.needsTracksUpdate = true;
|
this.needsTracksUpdate = true;
|
||||||
break;
|
break;
|
||||||
case GstPlayer.PlayerState.STOPPED:
|
case GstPlayer.PlayerState.STOPPED:
|
||||||
|
this.lastPositionValue = 0;
|
||||||
|
this.controls.positionAdjustment.set_value(0);
|
||||||
|
this.controls.togglePlayButton.setPrimaryIcon();
|
||||||
this.needsTracksUpdate = true;
|
this.needsTracksUpdate = true;
|
||||||
if(this.mediaInfoSignal) {
|
if(this.mediaInfoSignal) {
|
||||||
this._player.disconnect(this.mediaInfoSignal);
|
this._player.disconnect(this.mediaInfoSignal);
|
||||||
this.mediaInfoSignal = null;
|
this.mediaInfoSignal = null;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
case GstPlayer.PlayerState.PAUSED:
|
case GstPlayer.PlayerState.PAUSED:
|
||||||
this.controls.togglePlayButton.setPrimaryIcon();
|
this.controls.togglePlayButton.setPrimaryIcon();
|
||||||
break;
|
break;
|
||||||
@@ -443,6 +445,11 @@ class ClapperInterface extends Gtk.Grid
|
|||||||
|
|
||||||
this.lastPositionValue = positionSeconds;
|
this.lastPositionValue = positionSeconds;
|
||||||
this._player.seek_seconds(positionSeconds);
|
this._player.seek_seconds(positionSeconds);
|
||||||
|
debug(`player is seeking to position: ${positionSeconds}`);
|
||||||
|
|
||||||
|
/* Needed to enable preview after playback is stopped */
|
||||||
|
if(this._player.state === GstPlayer.PlayerState.STOPPED)
|
||||||
|
this._player.pause();
|
||||||
|
|
||||||
if(this.fullscreenMode)
|
if(this.fullscreenMode)
|
||||||
this.updateTime();
|
this.updateTime();
|
||||||
|
@@ -266,6 +266,8 @@ class ClapperPlayer extends GstPlayer.Player
|
|||||||
|
|
||||||
if(this._trackId < this._playlist.length)
|
if(this._trackId < this._playlist.length)
|
||||||
this.set_media(this._playlist[this._trackId]);
|
this.set_media(this._playlist[this._trackId]);
|
||||||
|
else
|
||||||
|
this.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
_onUriLoaded()
|
_onUriLoaded()
|
||||||
|
Reference in New Issue
Block a user