diff --git a/clapper_src/player.js b/clapper_src/player.js
index 4d0ce5b0..8cbf1581 100644
--- a/clapper_src/player.js
+++ b/clapper_src/player.js
@@ -345,12 +345,13 @@ class ClapperPlayer extends PlayerBase
_onStreamEnded(player)
{
+ debug('stream ended');
this._trackId++;
if(this._trackId < this._playlist.length)
this.set_media(this._playlist[this._trackId]);
- else
- this.stop();
+ else if(settings.get_boolean('close-auto'))
+ this._onCloseRequest(this.widget.get_root());
}
_onUriLoaded(player, uri)
diff --git a/clapper_src/prefs.js b/clapper_src/prefs.js
index 53545d2d..ea68ae71 100644
--- a/clapper_src/prefs.js
+++ b/clapper_src/prefs.js
@@ -13,6 +13,7 @@ class ClapperGeneralPage extends PrefsBase.Grid
this.addTitle('Startup');
this.addCheckButton('Auto enter fullscreen', 'fullscreen-auto');
+ this.addCheckButton('Close after playback', 'close-auto');
this.addTitle('Volume');
let comboBox = this.addComboBoxText('Initial value', [
diff --git a/clapper_src/widget.js b/clapper_src/widget.js
index 87ac218e..5faf942b 100644
--- a/clapper_src/widget.js
+++ b/clapper_src/widget.js
@@ -405,7 +405,6 @@ var Widget = GObject.registerClass({
player.disconnect(this.mediaInfoSignal);
this.mediaInfoSignal = null;
}
- this.controls.togglePlayButton.setPrimaryIcon();
break;
case GstPlayer.PlayerState.PAUSED:
debug('player state changed to: PAUSED');
diff --git a/data/com.github.rafostar.Clapper.gschema.xml b/data/com.github.rafostar.Clapper.gschema.xml
index 52ef1eaa..b4df13b3 100644
--- a/data/com.github.rafostar.Clapper.gschema.xml
+++ b/data/com.github.rafostar.Clapper.gschema.xml
@@ -6,6 +6,10 @@
false
Automatically enter fullscreen when first file is loaded
+
+ false
+ Automatically close the app after playback finishes
+
"restore"
Mode used for startup volume value