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

Merge pull request #1534 from MrTimscampi/syncplay-better-api

Use new SyncPlay API client
This commit is contained in:
dkanada 2020-07-10 05:28:42 +09:00 committed by GitHub
commit c0d8b903c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 12 deletions

View file

@ -37,7 +37,7 @@ function showNewJoinGroupSelection (button, user, apiClient) {
console.debug('No item is currently playing.');
}
apiClient.sendSyncPlayCommand('ListGroups').then(function (response) {
apiClient.getSyncPlayGroups().then(function (response) {
response.json().then(function (groups) {
var menuItems = groups.map(function (group) {
return {
@ -83,9 +83,9 @@ function showNewJoinGroupSelection (button, user, apiClient) {
actionsheet.show(menuOptions).then(function (id) {
if (id == 'new-group') {
apiClient.sendSyncPlayCommand('NewGroup');
apiClient.createSyncPlayGroup();
} else {
apiClient.sendSyncPlayCommand('JoinGroup', {
apiClient.joinSyncPlayGroup({
GroupId: id,
PlayingItemId: playingItemId
});
@ -140,7 +140,7 @@ function showLeaveGroupSelection (button, user, apiClient) {
actionsheet.show(menuOptions).then(function (id) {
if (id == 'leave-group') {
apiClient.sendSyncPlayCommand('LeaveGroup');
apiClient.leaveSyncPlayGroup();
}
}).catch((error) => {
console.error('SyncPlay: unexpected error showing group menu:', error);

View file

@ -139,7 +139,7 @@ class SyncPlayManager {
return;
}
apiClient.sendSyncPlayCommand('UpdatePing', {
apiClient.sendSyncPlayPing({
Ping: ping
});
}
@ -447,7 +447,7 @@ class SyncPlayManager {
if (!success) {
console.warning('Error reporting playback state to server. Joining group will fail.');
}
apiClient.sendSyncPlayCommand('JoinGroup', {
apiClient.joinSyncPlayGroup({
GroupId: groupId,
PlayingItemId: playingItemId
});
@ -658,7 +658,7 @@ class SyncPlayManager {
*/
playRequest (player) {
var apiClient = connectionManager.currentApiClient();
apiClient.sendSyncPlayCommand('PlayRequest');
apiClient.requestSyncPlayStart();
}
/**
@ -666,7 +666,7 @@ class SyncPlayManager {
*/
pauseRequest (player) {
var apiClient = connectionManager.currentApiClient();
apiClient.sendSyncPlayCommand('PauseRequest');
apiClient.requestSyncPlayPause();
// Pause locally as well, to give the user some little control
playbackManager._localUnpause(player);
}
@ -676,7 +676,7 @@ class SyncPlayManager {
*/
seekRequest (PositionTicks, player) {
var apiClient = connectionManager.currentApiClient();
apiClient.sendSyncPlayCommand('SeekRequest', {
apiClient.requestSyncPlaySeek({
PositionTicks: PositionTicks
});
}

View file

@ -6309,9 +6309,9 @@ isurl@^1.0.0-alpha5:
is-object "^1.0.1"
jellyfin-apiclient@^1.3.0:
version "1.3.1"
resolved "https://registry.yarnpkg.com/jellyfin-apiclient/-/jellyfin-apiclient-1.3.1.tgz#7ecaa986dbb6e36cce9d8f94dd66619419afa32d"
integrity sha512-PQUKFDcQOy4hJ43Jc3Lm3571zONlTjr2qmr6pEVcfLZs7Lvwa4oUu/yonH6MMxpjZOvTbcirjer+XXgF2RwXyA==
version "1.4.0"
resolved "https://registry.yarnpkg.com/jellyfin-apiclient/-/jellyfin-apiclient-1.4.0.tgz#d8fedc88cc177597290687be31e38de3cd0d035a"
integrity sha512-v2lcSZwcbKh3YSrZkBwNM7tisxvUJHZawz0xpxIobEI6MHrQLo4oDdm1zHXN6Mku9uzbuBpbAV1tA6XJwVVTyA==
"jellyfin-noto@https://github.com/jellyfin/jellyfin-noto":
version "1.0.3"