fix(subtitles): stabilize YouTube subtitle navigation and popup mounting#1345
fix(subtitles): stabilize YouTube subtitle navigation and popup mounting#1345
Conversation
π¦ Changeset detectedLatest commit: 0a21470 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor trust score73/100 β Trusted This score estimates contributor familiarity with Outcome
Score breakdown
Signals used
Policy
Updated automatically when the PR changes or when a maintainer reruns the workflow. |
There was a problem hiding this comment.
π‘ Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1b45d6c7aa
βΉοΈ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with π.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| export const youtubeConfig: PlatformConfig = { | ||
| selectors: { | ||
| video: "video.html5-main-video", | ||
| playerContainer: "#movie_player.html5-video-player", |
There was a problem hiding this comment.
Target the video selector to #movie_player
This change narrows playerContainer to #movie_player... but leaves video as the global video.html5-main-video, and initializeScheduler() relies on waitForElement() validation that only checks the first document.querySelector match. On pages where another YouTube player video appears earlier in DOM order (e.g., preview/miniplayer instances), validation against #movie_player keeps failing until timeout, so scheduler initialization never happens and subtitles cannot start. Please scope the video selector itself to the active player (or make element lookup iterate all matches) so the active watch player is always discovered.
Useful? React with πΒ / π.
Type of Changes
Description
#movie_playercontainer so the popup stays attached to the correct player.Related Issue
Closes #
How Has This Been Tested?
Screenshots
Checklist
Additional Information
Summary by cubic
Stabilizes YouTube subtitles across SPA navigation and ensures the popup mounts to the active player so it reliably opens after moving between videos or returning from Home.
yt-navigate-start(clear visible state) andyt-navigate-finish(re-init with delay) to prevent stale subtitles and stuck UI.#movie_player.#movie_playerfor the player and controls so the popup attaches to the correct video.navigateStart/navigateFinishand add constants for both events; reset schedulers/pipelines on start and rebuild after finish.Written for commit 1b45d6c. Summary will update on new commits.