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
13
ApiClient.js
13
ApiClient.js
|
@ -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) {
|
self.updateItemImageIndex = function (itemId, itemType, itemName, imageType, imageIndex, newIndex) {
|
||||||
|
|
||||||
if (!imageType) {
|
if (!imageType) {
|
||||||
|
|
|
@ -108,6 +108,10 @@
|
||||||
var position = Math.floor(10000000 * endTime) + startTimeTicksOffset;
|
var position = Math.floor(10000000 * endTime) + startTimeTicksOffset;
|
||||||
|
|
||||||
ApiClient.reportPlaybackStopped(Dashboard.getCurrentUserId(), currentItem.Id, position);
|
ApiClient.reportPlaybackStopped(Dashboard.getCurrentUserId(), currentItem.Id, position);
|
||||||
|
|
||||||
|
if (currentItem.MediaType == "Video") {
|
||||||
|
ApiClient.stopActiveEncodings();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function playNextAfterEnded() {
|
function playNextAfterEnded() {
|
||||||
|
@ -184,9 +188,13 @@
|
||||||
sendProgressUpdate(currentItem.Id);
|
sendProgressUpdate(currentItem.Id);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
ApiClient.stopActiveEncodings().done(function () {
|
||||||
|
|
||||||
startTimeTicksOffset = ticks;
|
startTimeTicksOffset = ticks;
|
||||||
|
|
||||||
element.src = currentSrc;
|
element.src = currentSrc;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -479,7 +487,8 @@
|
||||||
maxWidth: Math.min(screenWidth, 1280),
|
maxWidth: Math.min(screenWidth, 1280),
|
||||||
StartTimeTicks: 0,
|
StartTimeTicks: 0,
|
||||||
SubtitleStreamIndex: getInitialSubtitleStreamIndex(item.MediaStreams, user),
|
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) {
|
var videoStream = item.MediaStreams.filter(function (i) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue