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

Update ApiClient instance used by SyncPlay manager

This commit is contained in:
Ionut Andrei Oanca 2021-09-07 01:00:23 +02:00
parent 7d880f07ce
commit f0d483dee3
2 changed files with 15 additions and 5 deletions

View file

@ -47,12 +47,8 @@ class Manager {
* @param {Object} apiClient The ApiClient.
*/
init(apiClient) {
if (!apiClient) {
throw new Error('ApiClient is null!');
}
// Set ApiClient.
this.apiClient = apiClient;
this.updateApiClient(apiClient);
// Get default player wrapper.
this.playerWrapper = this.playerFactory.getDefaultWrapper(this);
@ -73,6 +69,18 @@ class Manager {
});
}
/**
* Update active ApiClient.
* @param {Object} apiClient The ApiClient.
*/
updateApiClient(apiClient) {
if (!apiClient) {
throw new Error('ApiClient is null!');
}
this.apiClient = apiClient;
}
/**
* Gets the time sync core.
* @returns {TimeSyncCore} The time sync core.