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
|
@ -46,7 +46,7 @@
|
|||
Dashboard.getCurrentUser().done(function (user) {
|
||||
|
||||
renderImage(page, item, user);
|
||||
|
||||
|
||||
setInitialCollapsibleState(page, item, context, user);
|
||||
renderDetails(page, item, context);
|
||||
LibraryBrowser.renderDetailPageBackdrop(page, item);
|
||||
|
@ -138,9 +138,9 @@
|
|||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
|
||||
function renderImage(page, item, user) {
|
||||
|
||||
|
||||
var imageHref = user.Configuration.IsAdministrator ? "edititemimages.html?id=" + item.Id : "";
|
||||
|
||||
$('#itemImage', page).html(LibraryBrowser.getDetailImageHtml(item, imageHref));
|
||||
|
@ -655,7 +655,7 @@
|
|||
}
|
||||
|
||||
if (item.Studios.length) {
|
||||
html += ' on <a class="textlink" href="itembynamedetails.html?context=' + context + '&studio=' + ApiClient.encodeName(item.Studios[0].Name) + '">' + item.Studios[0].Name + '</a>';
|
||||
html += ' on <a class="textlink" href="itembynamedetails.html?context=' + context + '&id=' + item.Studios[0].Id + '">' + item.Studios[0].Name + '</a>';
|
||||
}
|
||||
|
||||
if (html) {
|
||||
|
@ -890,7 +890,7 @@
|
|||
}
|
||||
|
||||
function renderUserDataIcons(page, item) {
|
||||
|
||||
|
||||
$('.userDataIcons', page).html(LibraryBrowser.getUserDataIconsHtml(item));
|
||||
}
|
||||
|
||||
|
@ -1193,7 +1193,7 @@
|
|||
if (stream.IsAnamorphic != null) {
|
||||
attributes.push(createAttribute("Anamorphic", (stream.IsAnamorphic ? 'Yes' : 'No')));
|
||||
}
|
||||
|
||||
|
||||
attributes.push(createAttribute("Interlaced", (stream.IsInterlaced ? 'Yes' : 'No')));
|
||||
}
|
||||
|
||||
|
|
|
@ -1781,7 +1781,7 @@
|
|||
html += ' / ';
|
||||
}
|
||||
|
||||
html += '<a class="textlink" href="itembynamedetails.html?context=' + context + '&studio=' + ApiClient.encodeName(item.Studios[i].Name) + '">' + item.Studios[i].Name + '</a>';
|
||||
html += '<a class="textlink" href="itembynamedetails.html?context=' + context + '&id=' + item.Studios[i].Id + '">' + item.Studios[i].Name + '</a>';
|
||||
}
|
||||
|
||||
elem.show().html(html).trigger('create');
|
||||
|
|
|
@ -1007,36 +1007,17 @@
|
|||
EnableAutoStreamCopy: false
|
||||
}));
|
||||
|
||||
if (isStatic) webmVideoUrl += seekParam;
|
||||
var hlsVideoUrl = ApiClient.getUrl('Videos/' + item.Id + '/master.m3u8', $.extend({}, baseParams, {
|
||||
maxWidth: m3U8Quality.maxWidth,
|
||||
videoBitrate: m3U8Quality.videoBitrate,
|
||||
audioBitrate: m3U8Quality.audioBitrate,
|
||||
VideoCodec: m3U8Quality.videoCodec,
|
||||
AudioCodec: m3U8Quality.audioCodec,
|
||||
profile: 'baseline',
|
||||
level: '3',
|
||||
StartTimeTicks: 0
|
||||
|
||||
var hlsVideoUrl;
|
||||
|
||||
if (item.RunTimeTicks) {
|
||||
hlsVideoUrl = ApiClient.getUrl('Videos/' + item.Id + '/master.m3u8', $.extend({}, baseParams, {
|
||||
timeStampOffsetMs: 0,
|
||||
maxWidth: m3U8Quality.maxWidth,
|
||||
videoBitrate: m3U8Quality.videoBitrate,
|
||||
audioBitrate: m3U8Quality.audioBitrate,
|
||||
VideoCodec: m3U8Quality.videoCodec,
|
||||
AudioCodec: m3U8Quality.audioCodec,
|
||||
profile: 'baseline',
|
||||
level: '3',
|
||||
StartTimeTicks: 0
|
||||
|
||||
})) + seekParam;
|
||||
|
||||
} else {
|
||||
hlsVideoUrl = ApiClient.getUrl('Videos/' + item.Id + '/stream.m3u8', $.extend({}, baseParams, {
|
||||
timeStampOffsetMs: 0,
|
||||
maxWidth: m3U8Quality.maxWidth,
|
||||
videoBitrate: m3U8Quality.videoBitrate,
|
||||
audioBitrate: m3U8Quality.audioBitrate,
|
||||
VideoCodec: m3U8Quality.videoCodec,
|
||||
AudioCodec: m3U8Quality.audioCodec,
|
||||
profile: 'baseline',
|
||||
level: '3'
|
||||
})) + seekParam;
|
||||
}
|
||||
})) + seekParam;
|
||||
|
||||
//======================================================================================>
|
||||
|
||||
|
@ -1199,9 +1180,7 @@
|
|||
|
||||
}).on("error.mediaplayerevent", function () {
|
||||
|
||||
self.clearPauseStop();
|
||||
|
||||
self.resetEnhancements();
|
||||
self.stop();
|
||||
|
||||
var errorCode = this.error ? this.error.code : '';
|
||||
console.log('Html5 Video error code: ' + errorCode);
|
||||
|
@ -1212,11 +1191,16 @@
|
|||
errorMsg += " Please ensure there is an open tuner availalble.";
|
||||
}
|
||||
|
||||
if (errorCode) {
|
||||
errorMsg += " Error code: " + errorCode;
|
||||
}
|
||||
|
||||
Dashboard.alert({
|
||||
title: 'Video Error',
|
||||
message: errorMsg
|
||||
});
|
||||
|
||||
|
||||
}).on("click.mediaplayerevent", function (e) {
|
||||
|
||||
if (this.paused) {
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
{},
|
||||
{ name: 'Series', sortField: 'SeriesSortName,SortName' },
|
||||
{ name: 'Season', sortField: 'SortName' },
|
||||
{ name: 'Season Number', sortField: 'IndexNumber' },
|
||||
{ name: 'Date Added', sortField: 'DateCreated,SortName' }
|
||||
];
|
||||
}
|
||||
|
@ -260,6 +261,7 @@
|
|||
html += item.ParentIndexNumber == null ? '' : item.ParentIndexNumber;
|
||||
break;
|
||||
}
|
||||
case 'Season Number':
|
||||
case 'Track':
|
||||
{
|
||||
html += item.IndexNumber == null ? '' : item.IndexNumber;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue