mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fixes #635 - FFmpeg not being stopped in safari
This commit is contained in:
parent
2aa7e92987
commit
4a439addcd
2 changed files with 26 additions and 4 deletions
15
ApiClient.js
15
ApiClient.js
|
@ -1036,7 +1036,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
|
|||
self.getScheduledTasks = function (options) {
|
||||
|
||||
options = options || {};
|
||||
|
||||
|
||||
var url = self.getUrl("ScheduledTasks", options);
|
||||
|
||||
return self.ajax({
|
||||
|
@ -1402,6 +1402,19 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
|
|||
});
|
||||
};
|
||||
|
||||
self.stopActiveEncodings = function () {
|
||||
|
||||
var url = self.getUrl("Videos/ActiveEncodings", {
|
||||
|
||||
deviceId: deviceId
|
||||
});
|
||||
|
||||
return self.ajax({
|
||||
type: "DELETE",
|
||||
url: url
|
||||
});
|
||||
};
|
||||
|
||||
self.updateItemImageIndex = function (itemId, itemType, itemName, imageType, imageIndex, newIndex) {
|
||||
|
||||
if (!imageType) {
|
||||
|
|
|
@ -108,6 +108,10 @@
|
|||
var position = Math.floor(10000000 * endTime) + startTimeTicksOffset;
|
||||
|
||||
ApiClient.reportPlaybackStopped(Dashboard.getCurrentUserId(), currentItem.Id, position);
|
||||
|
||||
if (currentItem.MediaType == "Video") {
|
||||
ApiClient.stopActiveEncodings();
|
||||
}
|
||||
}
|
||||
|
||||
function playNextAfterEnded() {
|
||||
|
@ -184,9 +188,13 @@
|
|||
sendProgressUpdate(currentItem.Id);
|
||||
|
||||
});
|
||||
startTimeTicksOffset = ticks;
|
||||
|
||||
element.src = currentSrc;
|
||||
ApiClient.stopActiveEncodings().done(function () {
|
||||
|
||||
startTimeTicksOffset = ticks;
|
||||
|
||||
element.src = currentSrc;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -479,7 +487,8 @@
|
|||
maxWidth: Math.min(screenWidth, 1280),
|
||||
StartTimeTicks: 0,
|
||||
SubtitleStreamIndex: getInitialSubtitleStreamIndex(item.MediaStreams, user),
|
||||
AudioStreamIndex: getInitialAudioStreamIndex(item.MediaStreams, user)
|
||||
AudioStreamIndex: getInitialAudioStreamIndex(item.MediaStreams, user),
|
||||
deviceId: ApiClient.deviceId()
|
||||
};
|
||||
|
||||
var videoStream = item.MediaStreams.filter(function (i) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue