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

fixes #555 - Have clients report seek and queuing capabilities

This commit is contained in:
Luke Pulverenti 2013-09-24 11:08:51 -04:00
parent bc70b9ed6e
commit 086a032545
4 changed files with 35 additions and 20 deletions

View file

@ -3200,7 +3200,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
* @param {String} userId
* @param {String} itemId
*/
self.reportPlaybackStart = function (userId, itemId) {
self.reportPlaybackStart = function (userId, itemId, canSeek, queueableMediaTypes) {
if (!userId) {
throw new Error("null userId");
@ -3210,17 +3210,26 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
throw new Error("null itemId");
}
canSeek = canSeek || false;
queueableMediaTypes = queueableMediaTypes || '';
if (self.isWebSocketOpen()) {
var deferred = $.Deferred();
self.sendWebSocketMessage("PlaybackStart", itemId);
var msg = [itemId, canSeek, queueableMediaTypes];
self.sendWebSocketMessage("PlaybackStart", msg.join('|'));
deferred.resolveWith(null, []);
return deferred.promise();
}
var url = self.getUrl("Users/" + userId + "/PlayingItems/" + itemId);
var url = self.getUrl("Users/" + userId + "/PlayingItems/" + itemId, {
CanSeek: canSeek,
QueueableMediaTypes: queueableMediaTypes
});
return self.ajax({
type: "POST",