Skip to content

feat(youtube-player): support passing in the playerVars parameter #19746

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

Merged
merged 1 commit into from
Jun 26, 2020

Conversation

crisbeto
Copy link
Member

We tried doing this before in #17672, but we never managed to wrap it up. These changes add support for passing in the playerVars parameter to the YouTube API which has some settings like autoplay and hiding the video controls.

Note: I'm setting it to P2, because it's something that we should've supported from the beginning and it comes up in issues once in a while.

Fixes #19267.

We tried doing this before in angular#17672, but we never managed to wrap it up. These changes add support for passing in the `playerVars` parameter to the YouTube API which has some settings like autoplay and hiding the video controls.

Fixes angular#19267.
@crisbeto crisbeto added P2 The issue is important to a large percentage of users, with a workaround target: minor This PR is targeted for the next minor release labels Jun 24, 2020
@crisbeto crisbeto requested a review from jelbourn as a code owner June 24, 2020 19:39
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jun 24, 2020
*/
@Input()
get playerVars(): YT.PlayerVars | undefined { return this._playerVars.value; }
set playerVars(playerVars: YT.PlayerVars | undefined) {
Copy link
Member Author

@crisbeto crisbeto Jun 24, 2020

Choose a reason for hiding this comment

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

@jelbourn In #17672 (comment) I was advocating against passing in the playerVars object to the input. I changed my mind, because the object has many properties that we'd have to proxy and which will increase the API surface a lot. I'm open to changing it if you think otherwise.

Copy link
Member

Choose a reason for hiding this comment

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

That's fair. It's a little less Angular-y, but adding all those APIs will be bad for payload size.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think the internals of the player are due for a rework anyway since this reliance on an observable + getter + setter for every single input isn't scalable.

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

*/
@Input()
get playerVars(): YT.PlayerVars | undefined { return this._playerVars.value; }
set playerVars(playerVars: YT.PlayerVars | undefined) {
Copy link
Member

Choose a reason for hiding this comment

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

That's fair. It's a little less Angular-y, but adding all those APIs will be bad for payload size.

@jelbourn jelbourn added lgtm action: merge The PR is ready for merge by the caretaker labels Jun 24, 2020
@jelbourn jelbourn merged commit cc36af7 into angular:master Jun 26, 2020
@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 Jul 27, 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 P2 The issue is important to a large percentage of users, with a workaround target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

youtube-player: Support PlayerVars
3 participants