mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update live stream generation
This commit is contained in:
parent
bf21a282da
commit
2afee2ab2b
1 changed files with 33 additions and 11 deletions
|
@ -690,6 +690,36 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getLiveStream(itemId, deviceProfile, startPosition, mediaSource, audioStreamIndex, subtitleStreamIndex) {
|
||||||
|
|
||||||
|
var postData = {
|
||||||
|
DeviceProfile: deviceProfile,
|
||||||
|
OpenToken: mediaSource.OpenToken
|
||||||
|
};
|
||||||
|
|
||||||
|
var query = {
|
||||||
|
UserId: Dashboard.getCurrentUserId(),
|
||||||
|
StartTimeTicks: startPosition || 0,
|
||||||
|
ItemId: itemId
|
||||||
|
};
|
||||||
|
|
||||||
|
if (audioStreamIndex != null) {
|
||||||
|
query.AudioStreamIndex = audioStreamIndex;
|
||||||
|
}
|
||||||
|
if (subtitleStreamIndex != null) {
|
||||||
|
query.SubtitleStreamIndex = subtitleStreamIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ApiClient.ajax({
|
||||||
|
url: ApiClient.getUrl('LiveStreams/Open', query),
|
||||||
|
type: 'POST',
|
||||||
|
data: JSON.stringify(postData),
|
||||||
|
contentType: "application/json",
|
||||||
|
dataType: "json"
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
self.createStreamInfo = function (type, item, mediaSource, startPosition) {
|
self.createStreamInfo = function (type, item, mediaSource, startPosition) {
|
||||||
|
|
||||||
var mediaUrl;
|
var mediaUrl;
|
||||||
|
@ -803,19 +833,11 @@
|
||||||
|
|
||||||
if (mediaSource) {
|
if (mediaSource) {
|
||||||
|
|
||||||
if (mediaSource.RequiresOpening1) {
|
if (mediaSource.RequiresOpening) {
|
||||||
|
|
||||||
ApiClient.ajax({
|
getLiveStream(item.Id, deviceProfile, startPosition, mediaSource, null, null).done(function (openLiveStreamResult) {
|
||||||
url: ApiClient.getUrl('MediaSources/Open', {
|
|
||||||
OpenToken: mediaSource.OpenToken
|
|
||||||
}),
|
|
||||||
type: 'POST',
|
|
||||||
dataType: "json"
|
|
||||||
|
|
||||||
}).done(function (openLiveStreamResult) {
|
playInternalPostMediaSourceSelection(item, openLiveStreamResult.MediaSource, startPosition, callback);
|
||||||
|
|
||||||
mediaSource = openLiveStreamResult;
|
|
||||||
playInternalPostMediaSourceSelection(item, mediaSource, startPosition, callback);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue