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

update live stream handling

This commit is contained in:
Luke Pulverenti 2015-03-29 14:31:28 -04:00
parent 2afee2ab2b
commit b13ff1ba93
2 changed files with 10 additions and 10 deletions

View file

@ -397,12 +397,12 @@
var currentSrc = element.currentSrc; var currentSrc = element.currentSrc;
var currentStreamId = getParameterByName('StreamId', currentSrc); var playSessionId = getParameterByName('PlaySessionId', currentSrc);
if (params.AudioStreamIndex == null && params.SubtitleStreamIndex == null && params.Bitrate == null) { if (params.AudioStreamIndex == null && params.SubtitleStreamIndex == null && params.Bitrate == null) {
currentSrc = replaceQueryString(currentSrc, 'starttimeticks', ticks || 0); currentSrc = replaceQueryString(currentSrc, 'starttimeticks', ticks || 0);
changeStreamToUrl(element, currentStreamId, currentSrc, ticks); changeStreamToUrl(element, playSessionId, currentSrc, ticks);
return; return;
} }
@ -426,12 +426,12 @@
self.currentSubtitleStreamIndex = subtitleStreamIndex; self.currentSubtitleStreamIndex = subtitleStreamIndex;
currentSrc = ApiClient.getUrl(self.currentMediaSource.TranscodingUrl); currentSrc = ApiClient.getUrl(self.currentMediaSource.TranscodingUrl);
changeStreamToUrl(element, currentStreamId, currentSrc, ticks); changeStreamToUrl(element, playSessionId, currentSrc, ticks);
} }
}); });
}; };
function changeStreamToUrl(element, currentStreamId, url, newPositionTicks) { function changeStreamToUrl(element, playSessionId, url, newPositionTicks) {
clearProgressInterval(); clearProgressInterval();
@ -447,7 +447,7 @@
}); });
if (self.currentItem.MediaType == "Video") { if (self.currentItem.MediaType == "Video") {
ApiClient.stopActiveEncodings(currentStreamId).done(function () { ApiClient.stopActiveEncodings(playSessionId).done(function () {
self.startTimeTicksOffset = newPositionTicks; self.startTimeTicksOffset = newPositionTicks;
element.src = url; element.src = url;
@ -1513,7 +1513,7 @@
var playerElement = this; var playerElement = this;
var currentStreamId = getParameterByName('StreamId', playerElement.currentSrc); var playSessionId = getParameterByName('PlaySessionId', playerElement.currentSrc);
$(playerElement).off('.mediaplayerevent').off('ended.playbackstopped'); $(playerElement).off('.mediaplayerevent').off('ended.playbackstopped');
@ -1526,7 +1526,7 @@
if (item.MediaType == "Video") { if (item.MediaType == "Video") {
ApiClient.stopActiveEncodings(currentStreamId); ApiClient.stopActiveEncodings(playSessionId);
if (self.isFullScreen()) { if (self.isFullScreen()) {
self.exitFullScreen(); self.exitFullScreen();
} }

View file

@ -1887,14 +1887,14 @@
}); });
}; };
self.stopActiveEncodings = function (streamId) { self.stopActiveEncodings = function (playSessionId) {
var options = { var options = {
deviceId: deviceId deviceId: deviceId
}; };
if (streamId) { if (playSessionId) {
options.streamId = streamId; options.PlaySessionId = playSessionId;
} }
var url = self.getUrl("Videos/ActiveEncodings", options); var url = self.getUrl("Videos/ActiveEncodings", options);