fix: stop background playback and disable autoplay #1000
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Description
Fixes an issue where video responses could continue playing audio in the background, especially after window resize or when multiple response views were rendered. Videos are now paused by default and only play after explicit user interaction, with a guarantee that only one video can play at a time.
Problem
When a video response was displayed and the application window was resized to fullscreen, the responsive layout caused the same response body to be rendered in multiple places (for example, in both Requests and History views).
both views remained mounted. which resulted in:
VideoPreviewerinstances being createdPausing the video in one view only affected that specific instance, while another hidden instance continued playing audio.
Root Cause
Each
VideoPreviewerinstance managed playback independently and autoplayed on initialization. There was no coordination between instances, allowing multiple videos to play simultaneously when multiple response bodies were rendered due to responsive layout changes.Related Issues
Before & After Result
Before
video.player.bug.mp4
After
video.player.working.mp4
Checklist
mainbranch before making this PRAdded/updated tests?
OS on which you have developed and tested the feature?