mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update stream generation
This commit is contained in:
parent
c2800786fa
commit
bf21a282da
2 changed files with 37 additions and 16 deletions
|
@ -931,7 +931,7 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
self.playVideo = function (deviceProfile, playbackInfo, item, mediaSource, startPosition) {
|
self.playVideo = function (item, mediaSource, startPosition) {
|
||||||
|
|
||||||
var streamInfo = self.createStreamInfo('video', item, mediaSource, startPosition);
|
var streamInfo = self.createStreamInfo('video', item, mediaSource, startPosition);
|
||||||
|
|
||||||
|
|
|
@ -803,26 +803,24 @@
|
||||||
|
|
||||||
if (mediaSource) {
|
if (mediaSource) {
|
||||||
|
|
||||||
self.currentMediaSource = mediaSource;
|
if (mediaSource.RequiresOpening1) {
|
||||||
self.currentItem = item;
|
|
||||||
|
|
||||||
if (item.MediaType === "Video") {
|
ApiClient.ajax({
|
||||||
|
url: ApiClient.getUrl('MediaSources/Open', {
|
||||||
|
OpenToken: mediaSource.OpenToken
|
||||||
|
}),
|
||||||
|
type: 'POST',
|
||||||
|
dataType: "json"
|
||||||
|
|
||||||
self.currentMediaElement = self.playVideo(deviceProfile, result, item, self.currentMediaSource, startPosition);
|
}).done(function (openLiveStreamResult) {
|
||||||
self.currentDurationTicks = self.currentMediaSource.RunTimeTicks;
|
|
||||||
|
|
||||||
self.updateNowPlayingInfo(item);
|
mediaSource = openLiveStreamResult;
|
||||||
|
playInternalPostMediaSourceSelection(item, mediaSource, startPosition, callback);
|
||||||
|
});
|
||||||
|
|
||||||
} else if (item.MediaType === "Audio") {
|
} else {
|
||||||
|
playInternalPostMediaSourceSelection(item, mediaSource, startPosition, callback);
|
||||||
self.currentMediaElement = playAudio(item, self.currentMediaSource, startPosition);
|
|
||||||
self.currentDurationTicks = self.currentMediaSource.RunTimeTicks;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (callback) {
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
showPlaybackInfoErrorMessage('NoCompatibleStream');
|
showPlaybackInfoErrorMessage('NoCompatibleStream');
|
||||||
}
|
}
|
||||||
|
@ -831,6 +829,29 @@
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function playInternalPostMediaSourceSelection(item, mediaSource, startPosition, callback) {
|
||||||
|
|
||||||
|
self.currentMediaSource = mediaSource;
|
||||||
|
self.currentItem = item;
|
||||||
|
|
||||||
|
if (item.MediaType === "Video") {
|
||||||
|
|
||||||
|
self.currentMediaElement = self.playVideo(item, self.currentMediaSource, startPosition);
|
||||||
|
self.currentDurationTicks = self.currentMediaSource.RunTimeTicks;
|
||||||
|
|
||||||
|
self.updateNowPlayingInfo(item);
|
||||||
|
|
||||||
|
} else if (item.MediaType === "Audio") {
|
||||||
|
|
||||||
|
self.currentMediaElement = playAudio(item, self.currentMediaSource, startPosition);
|
||||||
|
self.currentDurationTicks = self.currentMediaSource.RunTimeTicks;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (callback) {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function validatePlaybackInfoResult(result) {
|
function validatePlaybackInfoResult(result) {
|
||||||
|
|
||||||
if (result.ErrorCode) {
|
if (result.ErrorCode) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue