diff --git a/src/components/syncPlay/core/Controller.js b/src/components/syncPlay/core/Controller.js index f4a1753a71..cf4d1bf27e 100644 --- a/src/components/syncPlay/core/Controller.js +++ b/src/components/syncPlay/core/Controller.js @@ -72,7 +72,7 @@ class Controller { const sendPlayRequest = (items) => { const queue = items.map(item => item.Id); apiClient.requestSyncPlayPlay({ - PlayingQueue: queue.join(','), + PlayingQueue: queue, PlayingItemPosition: options.startIndex ? options.startIndex : 0, StartPositionTicks: options.startPositionTicks ? options.startPositionTicks : 0 }); @@ -135,7 +135,7 @@ class Controller { Helper.translateItemsForPlayback(apiClient, options.items, options).then((items) => { const itemIds = items.map(item => item.Id); apiClient.requestSyncPlayQueue({ - ItemIds: itemIds.join(','), + ItemIds: itemIds, Mode: mode }); }); @@ -146,7 +146,7 @@ class Controller { Helper.translateItemsForPlayback(apiClient, result.Items, options).then((items) => { const itemIds = items.map(item => item.Id); apiClient.requestSyncPlayQueue({ - ItemIds: itemIds.join(','), + ItemIds: itemIds, Mode: mode }); }); diff --git a/src/components/syncPlay/core/PlaybackCore.js b/src/components/syncPlay/core/PlaybackCore.js index b1bc6c106d..6916aebbe3 100644 --- a/src/components/syncPlay/core/PlaybackCore.js +++ b/src/components/syncPlay/core/PlaybackCore.js @@ -129,14 +129,19 @@ class PlaybackCore { const now = this.timeSyncCore.localDateToRemote(currentTime); const playlistItemId = this.manager.getQueueCore().getCurrentPlaylistItemId(); - const apiClient = this.manager.getApiClient(); - apiClient.requestSyncPlayBuffering({ + const options = { When: now.toISOString(), PositionTicks: currentPositionTicks, IsPlaying: isPlaying, - PlaylistItemId: playlistItemId, - BufferingDone: !isBuffering - }); + PlaylistItemId: playlistItemId + }; + + const apiClient = this.manager.getApiClient(); + if (isBuffering) { + apiClient.requestSyncPlayBuffering(options); + } else { + apiClient.requestSyncPlayReady(options); + } } /** diff --git a/src/components/syncPlay/core/QueueCore.js b/src/components/syncPlay/core/QueueCore.js index b9362b839e..25ef434873 100644 --- a/src/components/syncPlay/core/QueueCore.js +++ b/src/components/syncPlay/core/QueueCore.js @@ -176,12 +176,11 @@ class QueueCore { const currentPositionTicks = Math.round(currentPosition * Helper.TicksPerMillisecond); const isPlaying = playerWrapper.isPlaying(); - apiClient.requestSyncPlayBuffering({ + apiClient.requestSyncPlayReady({ When: now.toISOString(), PositionTicks: currentPositionTicks, IsPlaying: isPlaying, - PlaylistItemId: this.getCurrentPlaylistItemId(), - BufferingDone: true + PlaylistItemId: this.getCurrentPlaylistItemId() }); }).catch((error) => { console.error('Error while waiting for `playbackstart` event!', origin, error);