Add support for chapters in episodes

This commit is contained in:
Thomas Perl 2014-04-30 18:49:37 +02:00
parent bb20181a77
commit 69c803ab5c
7 changed files with 160 additions and 0 deletions

View file

@ -135,6 +135,29 @@ Dialog {
icon: Icons.last
onClicked: player.seekAndSync(player.position + 60 * 1000);
}
IconMenuItem {
text: 'Chapters'
color: Constants.colors.playback
icon: Icons.tag_fill
visible: player.episode_chapters.length > 0
onClicked: {
var items = [];
for (var i in player.episode_chapters) {
(function (items, chapter) {
items.push({
label: chapter.title + ' (' + Util.formatDuration(chapter.start) + ')',
callback: function () {
player.seekAndSync(chapter.start * 1000);
}
});
})(items, player.episode_chapters[i]);
}
pgst.showSelection(items, 'Chapters');
}
}
}
}
}