bluesky-social / social-app

The Bluesky Social application for Web, iOS, and Android
https://bsky.app
MIT License
7.98k stars 1.04k forks source link

Embedded player stops playing when scrolled out of view #3463

Open mackuba opened 5 months ago

mackuba commented 5 months ago

Describe the bug

When you play a YouTube video in the embed player, it stops playing and reloads when you scroll the page.

To Reproduce

Steps to reproduce the behavior:

  1. Make a post with an embedded link to a YouTube video.
  2. Start playing the video.
  3. While it's playing, scroll the page up or down so that the post with the video moves out of view.
  4. Result: video stops playing, when you scroll back to the video, it's switched back to the initial state with a play button.

Expected behavior

Video keeps playing, you can hear the music, it's visible when you scroll back.

Details

Additional context

https://bsky.app/profile/mackuba.eu/post/3kpqmf4ikag2l

surfdude29 commented 5 months ago

From what I can gather in PRs such as #2217 and #2424 this is the intended behaviour for embedded videos such as YouTube (but not for GIFs which are less resource-intensive).

I agree it's annoying that you can't play a video and at least hear it still playing if you scroll on, but tbh I think the best way to solve this would probably be what Twitter does and have a floating video player that appears when you scroll away from the embed. I'm guessing that might be rather complex to implement though.