fix: sync YouTube live panel mute state with native player controls#298
Closed
fix: sync YouTube live panel mute state with native player controls#298
Conversation
Request changes: The mute-sync fix is correct, but the PR bundles unrelated regressions (ACLED shared cache deletion, TTL reversals, AIS visibility guard removal, optional channels removal, test deletion, User-Agent stripping) that need separate PRs and justification. https://claude.ai/code/session_01JCZAToYxRZs6dg7Wi2yH37
…eNewsPanel.ts only) Approve with minor suggestions: the mute-sync fix is clean and well-scoped. Suggestions around embed interval cleanup, origin validation on postMessage, and a static constant nit. https://claude.ai/code/session_01JCZAToYxRZs6dg7Wi2yH37
- Add stopMuteSync() in embed.js and call it on player error to prevent polling a dead player - Make MUTE_SYNC_POLL_MS static readonly (class-level constant) https://claude.ai/code/session_01JCZAToYxRZs6dg7Wi2yH37
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Summary
Fixes mute state synchronization between the LiveNewsPanel's mute button and YouTube's native player controls. Previously, toggling mute via the player's native UI would not update the panel's mute icon, causing the UI to drift out of sync with the actual player state.
Implements dual sync paths:
api/youtube/embed.js): Polls player mute state and postsyt-mute-statemessages to parent on changesrc/components/LiveNewsPanel.ts): Polls player mute state directly when not using the embed proxyBoth paths use 500ms polling intervals with change-only updates to minimize overhead, and properly clean up intervals on player destruction.
Type of change
Affected areas
/api/*)Changes
getVolume?(): numbertoYouTubePlayertype definitionOPTIONAL_LIVE_CHANNELSandOPTIONAL_CHANNEL_REGIONSexports (cleanup)LiveNewsPanel:startMuteSyncPolling()/stopMuteSyncPolling()lifecycle methodssyncMuteStateFromPlayer()polls native player mute stateyt-mute-stateevents from embed proxyapi/youtube/embed.js:readMuted()helper checksisMuted()withgetVolume() === 0fallbackstartMuteSync()/stopMuteSync()polling functionsyt-mute-statemessages only on state changesChecklist
Test Plan
Manual testing:
https://claude.ai/code/session_01JCZAToYxRZs6dg7Wi2yH37