Fix #1637: Apply forced volume in iframe/embed context on first load#3795
Open
tarai-dl wants to merge 1 commit intocode-charity:masterfrom
Open
Fix #1637: Apply forced volume in iframe/embed context on first load#3795tarai-dl wants to merge 1 commit intocode-charity:masterfrom
tarai-dl wants to merge 1 commit intocode-charity:masterfrom
Conversation
… first load When YouTube videos are embedded in iframes (e.g., on Google search results), the forced volume setting was not applied on first load or in incognito mode. The issue was that initPlayer() (which calls playerVolume()) was only called from init(), which might run before the player element is detected. In the main YouTube page, the yt-page-data-updated event re-triggers initPlayer(), but this event does not fire in embedded player contexts. The fix calls initPlayer() directly when the movie_player element is first detected in ytElementsHandler, ensuring forced volume is applied regardless of the initialization timing or context (main page vs iframe).
Member
|
hi and thanks @tarai-dl; please disclose LLM content and PR acceptance rate of your setup and avoid statement about tests which might not have happened. |
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.
Fix #1637: Apply forced volume in iframe/embed context on first load
Problem
When YouTube videos are embedded in iframes (e.g., on Google search results), the forced volume setting is not applied on first load or in incognito mode.
Root Cause
initPlayer()is only called frominit(). In embedded player contexts, theyt-page-data-updatedevent does not fire, soinitPlayer()is never called after the player element is detected.Fix
Added
initPlayer()call directly inytElementsHandlerwhenmovie_playeris first detected.Testing