sugar-cat7 / vspo-portal

WIP γ™γ½γ˜γ‚…γƒΌγ‚‹
https://vspo-schedule-sugar-cat7-s-team.vercel.app
MIT License
12 stars 4 forks source link

πŸ› BUG: Video audio continues to play after opening related video #203

Closed sruenwg closed 6 months ago

sruenwg commented 8 months ago

What operating system are you using?

Mac

Describe the Bug

The LivestreamDetailsModal continues to play audio from the previous video even after the user opens a new video via the related videos tab.

Steps to reproduce:

  1. Open and play any stream or clip with audio.
  2. Without pausing the video, click on a related video from the related videos tab.

I expect the audio from the previous video to be inaudible once the modal opens the next video.

More specifically, I believe a fix for this problem should take into account the user flow where a user opens and plays a video, opens a related video, then clicks ζˆ»γ‚‹ to return to the first video. In this flow, I expect either of the two following behaviors:

  1. Video v1 pauses but its state is stored when the user opens a related video v2. If the user opens v2 when v1 has a timestamp of 01:23:45, then when the user returns from v2 to v1, v1 is shown to the user paused at the same timestamp 01:23:45.
  2. The state of v1 is simply lost when the user opens v2. Regardless of the timestamp v1 has when the user opens v2, when the user returns from v2 to v1, v1 is reloaded from 00:00:00.

My preference as a user is definitely option 1 as long as there is no big hit to performance.

Please provide any relevant error logs

No response

sugar-cat7 commented 8 months ago

I think 1 is good too.

sruenwg commented 7 months ago

I noticed this might be a bit hard to implement since Twitch clips do not seem to support programmatic controls. I believe Twitcasting and Nicovideo streams also do not support these controls.

It seems then that the only way to pause playback for these videos is to unload the iframe, and there is no way for us to restore the previous state when the user reopens the video. This means we have to go with option 2 (resetting playback state).

On the other hand, we do have access to playback controls for YouTube streams & clips and Twitch streams, meaning we can pause these videos programmatically.

Would you say we should go with option 1 where possible? or would you rather we provide a more consistent experience by going with option 2 everywhere? (I personally prefer the latter due to it being simpler)