Repository navigation
Restore desktop Safari playback after autoplay is blocked - #523
Closed
spencer-hong wants to merge 2 commits into
Closed
spencer-hong wants to merge 2 commits into
spencer-hong wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Desktop Safari can connect to the live view and receive a healthy MediaStream while leaving the video black. I reproduced this with
readyState: 4, live audio/video tracks, and a paused, muted video whoseplay()rejects withNotAllowedError. Callingplay()from a real button click restored the image immediately.The initial autoplay watcher currently pauses the store after both playback attempts fail without setting
videoBlocked, so no recovery control appears. The existing resume handler also excludes desktop devices. This change exposes the existing recovery button when autoplay is refused and allows that button, keyboard input, and visibility recovery to resume video on desktop. The label becomes “Resume video” for both mouse and touch users.Validation:
Note
Low Risk
Localized live-view playback and recovery UX in the video component; no auth, data, or infrastructure changes.
Overview
Fixes black video on desktop Safari when the stream is healthy but
play()is rejected under autoplay policy.When both normal and muted autoplay attempts fail in
onPlayingChanged, the client now setsvideoBlockedso the existing recovery overlay appears (previously the store paused without flipping that flag).resumeVideono longer requires a touch device—desktop users can recover via the button, keyboard paths that call resume, and tab visibility. The control label is "Resume video" instead of touch-specific copy.Adds
video-autoplay.test.tsregression tests (muted/unmuted desktop refusal → blocked → user-gesture resume) and updatesvideo-input.test.tsso desktop resume/visibility behavior is expected.Reviewed by Cursor Bugbot for commit acd56a6. Bugbot is set up for automated code reviews on this repo. Configure here.