Skip to content

LB-1964: Fix youtube player cross tab sync issue#3661

Open
meekhumor wants to merge 1 commit intometabrainz:masterfrom
meekhumor:LB-1964
Open

LB-1964: Fix youtube player cross tab sync issue#3661
meekhumor wants to merge 1 commit intometabrainz:masterfrom
meekhumor:LB-1964

Conversation

@meekhumor
Copy link
Copy Markdown
Contributor

Problem

Ticket: LB-1964

When a user starts playback in a new tab, stopOtherBrainzPlayers() triggers a localstorage event that calls pauseCurrentPlayback() with dataSource.stop() on the previous tab.

Issue arises due to the stop() method in YoutubePlayer.tsx

Also I found this same issue with spotify player as well, soundcloud appears to sync correctly. I haven't tested other music services.

Solution

image

After going through this, fix was simply replacing stopVideo() with pauseVideo() in the stop() method.
Also removed the cueVideoById("") call since we no longer need to hard reset the player instead the video should stay loaded for potential resume.

  • I have run the code and manually tested the changes

AI usage

  • I did not use any AI

Action

No further actions needed beyond testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant