Modified the code so that we can play the current song of the JukeboxArea synchronously to all of the players in the area. The user needs to press space to open the video player, if there's a song playing.
To this, we made use of the existing Viewing Area code, as well as the YouTube player component. A JukeboxArea model contains a viewing area model, and this change is reflecting in the controller and townService model - they respectively contain the ViewingAreaController or TownService ViewingArea Interactable model within the JukeboxAreas.
There was a bug where the updates from the video playing caused the occupants of the JukeboxArea to be set to [] (empty). To fix this, we've decided to use the occupants stored in the JukeboxArea model as the source of truth for this (the viewing area is to prevent code/functionality duplication, and is not registered with the town). The occupants are never reset using the ViewingArea's occupants.
Modified the code so that we can play the current song of the JukeboxArea synchronously to all of the players in the area. The user needs to press space to open the video player, if there's a song playing.
To this, we made use of the existing Viewing Area code, as well as the YouTube player component. A JukeboxArea model contains a viewing area model, and this change is reflecting in the controller and townService model - they respectively contain the ViewingAreaController or TownService ViewingArea Interactable model within the JukeboxAreas.
There was a bug where the updates from the video playing caused the occupants of the JukeboxArea to be set to [] (empty). To fix this, we've decided to use the occupants stored in the JukeboxArea model as the source of truth for this (the viewing area is to prevent code/functionality duplication, and is not registered with the town). The occupants are never reset using the ViewingArea's occupants.