From 93aefafdee644e7839b8eb6dd49274706e881ddd Mon Sep 17 00:00:00 2001 From: Ian Walton Date: Sat, 10 Apr 2021 21:52:32 -0400 Subject: [PATCH] Allow setting a desired SyncPlay wrapper. --- src/components/syncPlay/core/players/PlayerFactory.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/syncPlay/core/players/PlayerFactory.js b/src/components/syncPlay/core/players/PlayerFactory.js index 709680cf63..1de9aa5126 100644 --- a/src/components/syncPlay/core/players/PlayerFactory.js +++ b/src/components/syncPlay/core/players/PlayerFactory.js @@ -44,13 +44,15 @@ class PlayerFactory { return this.getDefaultWrapper(syncPlayManager); } - console.debug('SyncPlay WrapperFactory getWrapper:', player.id); - const Wrapper = this.wrappers[player.id]; + const playerId = player.syncPlayWrapAs || player.id; + + console.debug('SyncPlay WrapperFactory getWrapper:', playerId); + const Wrapper = this.wrappers[playerId]; if (Wrapper) { return new Wrapper(player, syncPlayManager); } - console.debug(`SyncPlay WrapperFactory getWrapper: unknown player ${player.id}, using default wrapper.`); + console.debug(`SyncPlay WrapperFactory getWrapper: unknown player ${playerId}, using default wrapper.`); return this.getDefaultWrapper(syncPlayManager); }