mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
#514 - Support HLS seeking
This commit is contained in:
parent
83ada41f7e
commit
683e6f472c
5 changed files with 45 additions and 53 deletions
|
@ -20,7 +20,7 @@
|
|||
|
||||
self.isLocalPlayer = true;
|
||||
self.isDefaultPlayer = true;
|
||||
|
||||
|
||||
self.name = 'Html5 Player';
|
||||
|
||||
self.getTargets = function () {
|
||||
|
@ -47,7 +47,7 @@
|
|||
var playerTime = Math.floor(10000000 * (mediaElement || self.currentMediaElement).currentTime);
|
||||
|
||||
//if (!self.isCopyingTimestamps) {
|
||||
playerTime += self.startTimeTicksOffset;
|
||||
playerTime += self.startTimeTicksOffset;
|
||||
//}
|
||||
|
||||
return playerTime;
|
||||
|
@ -487,7 +487,7 @@
|
|||
|
||||
self.currentItem = item;
|
||||
self.currentMediaSource = getOptimalMediaSource(item.MediaType, item.MediaSources);
|
||||
|
||||
|
||||
mediaElement = playAudio(item, self.currentMediaSource, startPosition);
|
||||
|
||||
self.currentDurationTicks = self.currentMediaSource.RunTimeTicks;
|
||||
|
@ -879,26 +879,32 @@
|
|||
|
||||
var elem = self.currentMediaElement;
|
||||
|
||||
elem.pause();
|
||||
if (elem) {
|
||||
|
||||
var isVideo = self.currentItem.MediaType == "Video";
|
||||
elem.pause();
|
||||
|
||||
$(elem).off("ended.playnext").one("ended", function () {
|
||||
$(elem).off("ended.playnext").one("ended", function () {
|
||||
|
||||
$(this).off();
|
||||
$(this).off();
|
||||
|
||||
if (this.tagName.toLowerCase() != 'audio') {
|
||||
$(this).remove();
|
||||
}
|
||||
if (this.tagName.toLowerCase() != 'audio') {
|
||||
$(this).remove();
|
||||
}
|
||||
|
||||
elem.src = "";
|
||||
elem.src = "";
|
||||
self.currentMediaElement = null;
|
||||
self.currentItem = null;
|
||||
self.currentMediaSource = null;
|
||||
|
||||
}).trigger("ended");
|
||||
|
||||
} else {
|
||||
self.currentMediaElement = null;
|
||||
self.currentItem = null;
|
||||
self.currentMediaSource = null;
|
||||
}
|
||||
|
||||
}).trigger("ended");
|
||||
|
||||
if (isVideo) {
|
||||
if (self.currentItem && self.currentItem.MediaType == "Video") {
|
||||
if (self.isFullScreen()) {
|
||||
self.exitFullScreen();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue