Sleep timer
This commit is contained in:
parent
e146239305
commit
e271291f92
3 changed files with 61 additions and 0 deletions
|
@ -141,6 +141,32 @@ SlidePage {
|
|||
onClicked: player.seekAndSync(player.position + 60 * 1000);
|
||||
}
|
||||
|
||||
IconMenuItem {
|
||||
text: player.sleepTimerRunning ? Util.formatDuration(player.sleepTimerRemaining) : 'Sleep'
|
||||
alwaysShowText: player.sleepTimerRunning
|
||||
color: Constants.colors.playback
|
||||
icon: Icons.sleep
|
||||
onClicked: {
|
||||
if (player.sleepTimerRunning) {
|
||||
player.stopSleepTimer();
|
||||
} else {
|
||||
var options = [];
|
||||
var durations_minutes = player.durationChoices;
|
||||
for (var i=0; i<durations_minutes.length; i++) {
|
||||
(function (minutes) {
|
||||
options.push({
|
||||
label: '' + minutes + ' minutes',
|
||||
callback: function () {
|
||||
player.startSleepTimer(60 * minutes);
|
||||
}
|
||||
});
|
||||
})(durations_minutes[i]);
|
||||
}
|
||||
pgst.showSelection(options, 'Sleep timer', undefined, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IconMenuItem {
|
||||
text: 'Chapters'
|
||||
color: Constants.colors.playback
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue