Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(youtube-player): YT.Player is not a constructor #20616

Merged
merged 2 commits into from Sep 29, 2020

Conversation

Ronll
Copy link
Contributor

@Ronll Ronll commented Sep 21, 2020

fixes a race condition where window.YT would exist but window.YT.Player would not.

Fixes #20598

fixes a race condition where window.YT would be truthy
but window.YT.Player would not be ready.

Fixes angular#20598
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added the cla: no PR author must sign Google's Contributor License Agreement: https://opensource.google.com/docs/cla label Sep 21, 2020
@Ronll
Copy link
Contributor Author

Ronll commented Sep 21, 2020

@googlebot I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes PR author has agreed to Google's Contributor License Agreement and removed cla: no PR author must sign Google's Contributor License Agreement: https://opensource.google.com/docs/cla labels Sep 21, 2020
Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be captured in a unit test? Otherwise we may end up regressing in the future.

added a test to prevent reggression, the test mimics a possible state
of
the YT object when loading, when window.YT exists but window.YT.Player
does not.

Fixes angular#20598
@Ronll Ronll force-pushed the youtube-player-load-race-20598 branch from 9ea1924 to 40024bd Compare September 28, 2020 23:28
@Ronll
Copy link
Contributor Author

Ronll commented Sep 28, 2020

I modified the 'it waits until the api is ready before initializing' test to account for this case.

Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@crisbeto crisbeto added action: merge The PR is ready for merge by the caretaker merge safe target: patch This PR is targeted for the next patch release labels Sep 29, 2020
@mmalerba mmalerba merged commit b0d0388 into angular:master Sep 29, 2020
mmalerba pushed a commit that referenced this pull request Sep 29, 2020
* fix(youtube-player): YT.Player is not a constructor

fixes a race condition where window.YT would be truthy
but window.YT.Player would not be ready.

Fixes #20598

* fix(youtube-player): YT.Player is not a constructor test

added a test to prevent reggression, the test mimics a possible state
of
the YT object when loading, when window.YT exists but window.YT.Player
does not.

Fixes #20598

(cherry picked from commit b0d0388)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(youtube-player): YT.Player is not a constructor
4 participants