1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Add playlist forward and back controls to video player

This commit is contained in:
T. Adams 2015-03-13 01:58:50 -07:00
parent ad29857eae
commit c97609181a
4 changed files with 65 additions and 7 deletions

View file

@ -472,6 +472,14 @@
tooltip.remove();
});
$('.videoPreviousButton').on('click', function () {
self.previousTrack();
});
$('.videoNextButton').on('click', function () {
self.nextTrack();
});
$('.videoSubtitleButton').on('click', function () {
self.showSubtitleMenu();
@ -1329,6 +1337,35 @@
return video[0];
};
self.updatePlaylistUi = function () {
var index = self.currentPlaylistIndex(null),
length = self.playlist.length;
if (length < 2) {
$('.videoTrackControl').hide();
return;
}
console.log('Index: ' + index);
$('.currentPlaylistIndex').text(index + 1);
$('.currentPlaylistLength').text(length);
if (index === 0) {
$('.videoPreviousButton').attr('disabled', 'disabled');
} else {
$('.videoPreviousButton').removeAttr('disabled');
}
if ((index + 1) >= length) {
$('.videoNextButton').attr('disabled', 'disabled');
} else {
$('.videoNextButton').removeAttr('disabled');
}
$('.videoTrackControl').show();
};
}
createVideoPlayer(MediaPlayer);