diff options
| author | Tim Hobbs <jesus.tesh@gmail.com> | 2014-03-24 05:22:11 -0700 |
|---|---|---|
| committer | Tim Hobbs <jesus.tesh@gmail.com> | 2014-03-24 05:22:11 -0700 |
| commit | 543ce24c1051d10b32c0dae5277ee37c27daceae (patch) | |
| tree | a45f20a51af3842097e1ca98ff7653a6a8523675 /MediaBrowser.WebDashboard/ApiClient.js | |
| parent | cf5e89d045c616db8a4e83beae0a38c94fcb3e42 (diff) | |
| parent | 9b294c8bc96b31f6c458cc47fa8d330be2df086a (diff) | |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'MediaBrowser.WebDashboard/ApiClient.js')
| -rw-r--r-- | MediaBrowser.WebDashboard/ApiClient.js | 59 |
1 files changed, 35 insertions, 24 deletions
diff --git a/MediaBrowser.WebDashboard/ApiClient.js b/MediaBrowser.WebDashboard/ApiClient.js index 97c26ec78..765cae612 100644 --- a/MediaBrowser.WebDashboard/ApiClient.js +++ b/MediaBrowser.WebDashboard/ApiClient.js @@ -2192,20 +2192,6 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi }; /** - * Gets a list of all available conrete BaseItem types from the server - */ - self.getItemTypes = function (options) { - - var url = self.getUrl("Library/ItemTypes", options); - - return self.ajax({ - type: "GET", - url: url, - dataType: "json" - }); - }; - - /** * Constructs a url for a user image * @param {String} userId * @param {Object} options @@ -3805,7 +3791,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi * @param {String} userId * @param {String} itemId */ - self.reportPlaybackStart = function (userId, itemId, canSeek, queueableMediaTypes) { + self.reportPlaybackStart = function (userId, itemId, mediaSourceId, canSeek, queueableMediaTypes) { if (!userId) { throw new Error("null userId"); @@ -3823,6 +3809,10 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi var deferred = $.Deferred(); var msg = [itemId, canSeek, queueableMediaTypes]; + + if (mediaSourceId) { + msg.push(mediaSourceId); + } self.sendWebSocketMessage("PlaybackStart", msg.join('|')); @@ -3830,10 +3820,16 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi return deferred.promise(); } - var url = self.getUrl("Users/" + userId + "/PlayingItems/" + itemId, { + var params = { CanSeek: canSeek, QueueableMediaTypes: queueableMediaTypes - }); + }; + + if (mediaSourceId) { + params.mediaSourceId = mediaSourceId; + } + + var url = self.getUrl("Users/" + userId + "/PlayingItems/" + itemId, params); return self.ajax({ type: "POST", @@ -3846,7 +3842,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi * @param {String} userId * @param {String} itemId */ - self.reportPlaybackProgress = function (userId, itemId, positionTicks, isPaused, isMuted) { + self.reportPlaybackProgress = function (userId, itemId, mediaSourceId, positionTicks, isPaused, isMuted) { if (!userId) { throw new Error("null userId"); @@ -3860,7 +3856,12 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi var deferred = $.Deferred(); - var msgData = itemId + "|" + (positionTicks == null ? "" : positionTicks) + "|" + (isPaused == null ? "" : isPaused) + "|" + (isMuted == null ? "" : isMuted); + var msgData = itemId; + + msgData += "|" + (positionTicks == null ? "" : positionTicks); + msgData += "|" + (isPaused == null ? "" : isPaused); + msgData += "|" + (isMuted == null ? "" : isMuted); + msgData += "|" + (mediaSourceId == null ? "" : mediaSourceId); self.sendWebSocketMessage("PlaybackProgress", msgData); @@ -3877,6 +3878,10 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi params.positionTicks = positionTicks; } + if (mediaSourceId) { + params.mediaSourceId = mediaSourceId; + } + var url = self.getUrl("Users/" + userId + "/PlayingItems/" + itemId + "/Progress", params); return self.ajax({ @@ -3890,7 +3895,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi * @param {String} userId * @param {String} itemId */ - self.reportPlaybackStopped = function (userId, itemId, positionTicks) { + self.reportPlaybackStopped = function (userId, itemId, mediaSourceId, positionTicks) { if (!userId) { throw new Error("null userId"); @@ -3904,20 +3909,26 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi var deferred = $.Deferred(); - self.sendWebSocketMessage("PlaybackStopped", itemId + "|" + (positionTicks == null ? "" : positionTicks)); + var msg = itemId; + msg += "|" + (positionTicks == null ? "" : positionTicks); + msg += "|" + (mediaSourceId == null ? "" : mediaSourceId); + + self.sendWebSocketMessage("PlaybackStopped", msg); deferred.resolveWith(null, []); return deferred.promise(); } - var params = { - - }; + var params = {}; if (positionTicks) { params.positionTicks = positionTicks; } + if (mediaSourceId) { + params.mediaSourceId = mediaSourceId; + } + var url = self.getUrl("Users/" + userId + "/PlayingItems/" + itemId, params); return self.ajax({ |
