mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 07:42:23 +02:00
Add option to close player after playback
This commit is contained in:
@@ -345,12 +345,13 @@ class ClapperPlayer extends PlayerBase
|
|||||||
|
|
||||||
_onStreamEnded(player)
|
_onStreamEnded(player)
|
||||||
{
|
{
|
||||||
|
debug('stream ended');
|
||||||
this._trackId++;
|
this._trackId++;
|
||||||
|
|
||||||
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
|
else if(settings.get_boolean('close-auto'))
|
||||||
this.stop();
|
this._onCloseRequest(this.widget.get_root());
|
||||||
}
|
}
|
||||||
|
|
||||||
_onUriLoaded(player, uri)
|
_onUriLoaded(player, uri)
|
||||||
|
@@ -13,6 +13,7 @@ class ClapperGeneralPage extends PrefsBase.Grid
|
|||||||
|
|
||||||
this.addTitle('Startup');
|
this.addTitle('Startup');
|
||||||
this.addCheckButton('Auto enter fullscreen', 'fullscreen-auto');
|
this.addCheckButton('Auto enter fullscreen', 'fullscreen-auto');
|
||||||
|
this.addCheckButton('Close after playback', 'close-auto');
|
||||||
|
|
||||||
this.addTitle('Volume');
|
this.addTitle('Volume');
|
||||||
let comboBox = this.addComboBoxText('Initial value', [
|
let comboBox = this.addComboBoxText('Initial value', [
|
||||||
|
@@ -405,7 +405,6 @@ var Widget = GObject.registerClass({
|
|||||||
player.disconnect(this.mediaInfoSignal);
|
player.disconnect(this.mediaInfoSignal);
|
||||||
this.mediaInfoSignal = null;
|
this.mediaInfoSignal = null;
|
||||||
}
|
}
|
||||||
this.controls.togglePlayButton.setPrimaryIcon();
|
|
||||||
break;
|
break;
|
||||||
case GstPlayer.PlayerState.PAUSED:
|
case GstPlayer.PlayerState.PAUSED:
|
||||||
debug('player state changed to: PAUSED');
|
debug('player state changed to: PAUSED');
|
||||||
|
@@ -6,6 +6,10 @@
|
|||||||
<default>false</default>
|
<default>false</default>
|
||||||
<summary>Automatically enter fullscreen when first file is loaded</summary>
|
<summary>Automatically enter fullscreen when first file is loaded</summary>
|
||||||
</key>
|
</key>
|
||||||
|
<key name="close-auto" type="b">
|
||||||
|
<default>false</default>
|
||||||
|
<summary>Automatically close the app after playback finishes</summary>
|
||||||
|
</key>
|
||||||
<key name="volume-initial" type="s">
|
<key name="volume-initial" type="s">
|
||||||
<default>"restore"</default>
|
<default>"restore"</default>
|
||||||
<summary>Mode used for startup volume value</summary>
|
<summary>Mode used for startup volume value</summary>
|
||||||
|
Reference in New Issue
Block a user