neu-cs4530 / fall23-team-project-group-707

covey-town-project-boeing-707 created by GitHub Classroom
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

19 add a screen that displays the videolyrics of the song to everyone in the area #29

Closed VatsalMehta27 closed 9 months ago

VatsalMehta27 commented 9 months ago

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.