-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(youtube-player): Add playerVars input and tweak readme. #17672
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
Conversation
533b788
to
4c7e23f
Compare
4c7e23f
to
2d28731
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like there are some merge conflicts as well.
@@ -153,8 +165,7 @@ export class YouTubePlayer implements AfterViewInit, OnDestroy, OnInit { | |||
@Output() playbackRateChange = new EventEmitter<YT.OnPlaybackRateChangeEvent>(); | |||
|
|||
/** The element that will be replaced by the iframe. */ | |||
@ViewChild('youtubeContainer') | |||
youtubeContainer: ElementRef<HTMLElement>; | |||
@ViewChild('youtubeContainer', {static: true}) youtubeContainer: ElementRef<HTMLElement>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I can tell we don't need the query to be static
. Am I missing something?
@@ -119,6 +119,18 @@ export class YouTubePlayer implements AfterViewInit, OnDestroy, OnInit { | |||
private _width = DEFAULT_PLAYER_WIDTH; | |||
private _widthObs = new EventEmitter<number>(); | |||
|
|||
/** PlayerVars for the YouTube player */ | |||
@Input() | |||
get playerVars(): YT.PlayerVars | undefined { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be better to have individual inputs for the different playerVars
properties, rather than the entire object. We've been avoiding adding inputs where you pass in a configuration object, because change detection won't pick up changes to individual properties. What do you think @jelbourn?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also lean in that direction; it's the path we took for the google-maps component, since it makes the settings align more with Angular's framework idioms
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about using the same api and within ngOnChanges
=> detecting "special" options and updating change detection settings accordingly?
Either way, I am looking forward to making use of this soon.
Also: Is there any workaround right now to customise the player?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also: Is there any workaround right now to customise the player?
I take the silence as a no. ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I've been pretty busy with everything at work, I should be able to begin work on this again next week.
What is the status here? |
@YourDeveloperFriend if you don't have time wrap this one up, I wouldn't mind taking it over. |
@kristiyan that would be great. I have a lot going on, and this keeps
getting punted. Thanks!
…On Tue, Jun 23, 2020 at 4:43 AM Kristiyan Kostadinov < ***@***.***> wrote:
@YourDeveloperFriend <https://github.com/YourDeveloperFriend> if you
don't have time wrap this one up, I wouldn't mind taking it over.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#17672 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANZPHXV6H2CTWICGDLX2OLRYCIPHANCNFSM4JL2UF5A>
.
|
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.
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Fixes #17368. Closes #19267