mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
playlist fixes
This commit is contained in:
parent
6446cf2020
commit
356217a9b6
3 changed files with 27 additions and 21 deletions
|
@ -6,10 +6,10 @@
|
||||||
<body>
|
<body>
|
||||||
<div id="playlistPage" data-role="page" class="page libraryPage" data-theme="a">
|
<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 data-role="content">
|
||||||
|
|
||||||
<div id="playlist" class="detailTableContainer">
|
<div id="playlist" class="detailTableContainer">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
var curentDurationTicks;
|
var curentDurationTicks;
|
||||||
var isStaticStream;
|
var isStaticStream;
|
||||||
var culturesPromise;
|
var culturesPromise;
|
||||||
var isStopping;
|
|
||||||
|
|
||||||
self.playlist = [];
|
self.playlist = [];
|
||||||
var currentPlaylistIndex = 0;
|
var currentPlaylistIndex = 0;
|
||||||
|
@ -77,7 +76,7 @@
|
||||||
|
|
||||||
function onPlaybackStopped() {
|
function onPlaybackStopped() {
|
||||||
|
|
||||||
isStopping = true;
|
$(this).off('ended.playbackstopped');
|
||||||
|
|
||||||
currentTimeElement.empty();
|
currentTimeElement.empty();
|
||||||
|
|
||||||
|
@ -90,8 +89,11 @@
|
||||||
var position = Math.floor(10000000 * endTime) + startTimeTicksOffset;
|
var position = Math.floor(10000000 * endTime) + startTimeTicksOffset;
|
||||||
|
|
||||||
ApiClient.reportPlaybackStopped(Dashboard.getCurrentUserId(), currentItem.Id, position);
|
ApiClient.reportPlaybackStopped(Dashboard.getCurrentUserId(), currentItem.Id, position);
|
||||||
|
}
|
||||||
|
|
||||||
isStopping = false;
|
function playNextAfterEnded() {
|
||||||
|
|
||||||
|
$(this).off('ended.playnext');
|
||||||
|
|
||||||
self.queuePlayNext();
|
self.queuePlayNext();
|
||||||
}
|
}
|
||||||
|
@ -155,9 +157,10 @@
|
||||||
|
|
||||||
clearProgressInterval();
|
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);
|
startProgressInterval(currentItem.Id);
|
||||||
sendProgressUpdate(currentItem.Id);
|
sendProgressUpdate(currentItem.Id);
|
||||||
|
|
||||||
|
@ -443,7 +446,7 @@
|
||||||
setCurrentTime(getCurrentTicks(this), item, true);
|
setCurrentTime(getCurrentTicks(this), item, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}).on("ended.playbackstopped", onPlaybackStopped);
|
}).on("ended.playbackstopped", onPlaybackStopped).on('ended.playnext', playNextAfterEnded);
|
||||||
|
|
||||||
currentItem = item;
|
currentItem = item;
|
||||||
curentDurationTicks = item.RunTimeTicks;
|
curentDurationTicks = item.RunTimeTicks;
|
||||||
|
@ -623,7 +626,7 @@
|
||||||
setCurrentTime(getCurrentTicks(this), item, true);
|
setCurrentTime(getCurrentTicks(this), item, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}).on("ended.playbackstopped", onPlaybackStopped);
|
}).on("ended.playbackstopped", onPlaybackStopped).on('ended.playnext', playNextAfterEnded);
|
||||||
|
|
||||||
currentItem = item;
|
currentItem = item;
|
||||||
curentDurationTicks = item.RunTimeTicks;
|
curentDurationTicks = item.RunTimeTicks;
|
||||||
|
@ -810,7 +813,7 @@
|
||||||
|
|
||||||
self.playInternal = function (item, startPosition, user) {
|
self.playInternal = function (item, startPosition, user) {
|
||||||
|
|
||||||
if (self.isPlaying() && !isStopping) {
|
if (self.isPlaying()) {
|
||||||
self.stop();
|
self.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -954,7 +957,7 @@
|
||||||
Dashboard.getCurrentUser().done(function (user) {
|
Dashboard.getCurrentUser().done(function (user) {
|
||||||
|
|
||||||
self.playInternal(newItem, 0, user);
|
self.playInternal(newItem, 0, user);
|
||||||
self.currentPlaylistIndex = i;
|
currentPlaylistIndex = i;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -966,7 +969,7 @@
|
||||||
Dashboard.getCurrentUser().done(function (user) {
|
Dashboard.getCurrentUser().done(function (user) {
|
||||||
|
|
||||||
self.playInternal(newItem, 0, user);
|
self.playInternal(newItem, 0, user);
|
||||||
self.currentPlaylistIndex = newIndex;
|
currentPlaylistIndex = newIndex;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1027,14 +1030,16 @@
|
||||||
|
|
||||||
elem.pause();
|
elem.pause();
|
||||||
|
|
||||||
var jelem = $(elem).trigger('ended');
|
$(elem).off('ended.playnext').on('ended', function () {
|
||||||
elem.src = "";
|
|
||||||
|
|
||||||
jelem.remove();
|
$(this).remove();
|
||||||
|
elem.src = "";
|
||||||
|
currentMediaElement = null;
|
||||||
|
|
||||||
|
}).trigger('ended');
|
||||||
|
|
||||||
$('#nowPlayingBar').hide();
|
$('#nowPlayingBar').hide();
|
||||||
|
|
||||||
currentMediaElement = null;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
self.isPlaying = function () {
|
self.isPlaying = function () {
|
||||||
|
|
|
@ -44,6 +44,7 @@
|
||||||
var index = parseInt(this.getAttribute('data-index'));
|
var index = parseInt(this.getAttribute('data-index'));
|
||||||
|
|
||||||
MediaPlayer.currentPlaylistIndex(index);
|
MediaPlayer.currentPlaylistIndex(index);
|
||||||
|
reloadPlaylist(page);
|
||||||
|
|
||||||
}).on('click', '.lnkRemove', function () {
|
}).on('click', '.lnkRemove', function () {
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue