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

playlist fixes

This commit is contained in:
Luke Pulverenti 2013-06-07 13:23:23 -04:00
parent 6446cf2020
commit 356217a9b6
3 changed files with 27 additions and 21 deletions

View file

@ -6,10 +6,10 @@
<body>
<div id="playlistPage" data-role="page" class="page libraryPage" data-theme="a">
<div class="ui-bar-c parentName">Now Playing</div>
<div data-role="content">
<div id="playlist" class="detailTableContainer">
</div>
</div>
</div>

View file

@ -19,7 +19,6 @@
var curentDurationTicks;
var isStaticStream;
var culturesPromise;
var isStopping;
self.playlist = [];
var currentPlaylistIndex = 0;
@ -77,7 +76,7 @@
function onPlaybackStopped() {
isStopping = true;
$(this).off('ended.playbackstopped');
currentTimeElement.empty();
@ -90,8 +89,11 @@
var position = Math.floor(10000000 * endTime) + startTimeTicksOffset;
ApiClient.reportPlaybackStopped(Dashboard.getCurrentUserId(), currentItem.Id, position);
}
isStopping = false;
function playNextAfterEnded() {
$(this).off('ended.playnext');
self.queuePlayNext();
}
@ -155,9 +157,10 @@
clearProgressInterval();
$(element).off('ended.playbackstopped').on("play.onceafterseek", function () {
$(element).off('ended.playbackstopped').off('ended.playnext').on("play.onceafterseek", function () {
$(this).off('play.onceafterseek').on('ended.playbackstopped', onPlaybackStopped).on('ended.playnext', playNextAfterEnded);
$(this).off('play.onceafterseek').on('ended.playbackstopped', onPlaybackStopped);
startProgressInterval(currentItem.Id);
sendProgressUpdate(currentItem.Id);
@ -443,7 +446,7 @@
setCurrentTime(getCurrentTicks(this), item, true);
}
}).on("ended.playbackstopped", onPlaybackStopped);
}).on("ended.playbackstopped", onPlaybackStopped).on('ended.playnext', playNextAfterEnded);
currentItem = item;
curentDurationTicks = item.RunTimeTicks;
@ -623,7 +626,7 @@
setCurrentTime(getCurrentTicks(this), item, true);
}
}).on("ended.playbackstopped", onPlaybackStopped);
}).on("ended.playbackstopped", onPlaybackStopped).on('ended.playnext', playNextAfterEnded);
currentItem = item;
curentDurationTicks = item.RunTimeTicks;
@ -810,7 +813,7 @@
self.playInternal = function (item, startPosition, user) {
if (self.isPlaying() && !isStopping) {
if (self.isPlaying()) {
self.stop();
}
@ -954,7 +957,7 @@
Dashboard.getCurrentUser().done(function (user) {
self.playInternal(newItem, 0, user);
self.currentPlaylistIndex = i;
currentPlaylistIndex = i;
});
};
@ -966,7 +969,7 @@
Dashboard.getCurrentUser().done(function (user) {
self.playInternal(newItem, 0, user);
self.currentPlaylistIndex = newIndex;
currentPlaylistIndex = newIndex;
});
};
@ -1027,14 +1030,16 @@
elem.pause();
var jelem = $(elem).trigger('ended');
elem.src = "";
$(elem).off('ended.playnext').on('ended', function () {
jelem.remove();
$(this).remove();
elem.src = "";
currentMediaElement = null;
}).trigger('ended');
$('#nowPlayingBar').hide();
currentMediaElement = null;
};
self.isPlaying = function () {

View file

@ -44,6 +44,7 @@
var index = parseInt(this.getAttribute('data-index'));
MediaPlayer.currentPlaylistIndex(index);
reloadPlaylist(page);
}).on('click', '.lnkRemove', function () {