-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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): unable to bind to events after initialization #18996
Conversation
The `youtube-player` component is set up so that it won't bind any events if there aren't any listeners at the time the player is created. This makes it impossible to bind an event by getting a reference to the player using `ViewChild` and subscribing to it. These changes fix the issue using a lazy observable which binds any events once the user subscribes and transfers them between players.
@@ -1,15 +1,15 @@ | |||
export declare class YouTubePlayer implements AfterViewInit, OnDestroy, OnInit { | |||
apiChange: EventEmitter<YT.PlayerEvent>; | |||
apiChange: Observable<YT.PlayerEvent>; |
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.
This is technically a public API change, but Observable
and EventEmitter
have the same signature, aside from emit
which people shouldn't be accessing on our outputs anyway.
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.
LGTM
…18996) The `youtube-player` component is set up so that it won't bind any events if there aren't any listeners at the time the player is created. This makes it impossible to bind an event by getting a reference to the player using `ViewChild` and subscribing to it. These changes fix the issue using a lazy observable which binds any events once the user subscribes and transfers them between players.
…ngular#18996) The `youtube-player` component is set up so that it won't bind any events if there aren't any listeners at the time the player is created. This makes it impossible to bind an event by getting a reference to the player using `ViewChild` and subscribing to it. These changes fix the issue using a lazy observable which binds any events once the user subscribes and transfers them between players.
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. |
The
youtube-player
component is set up so that it won't bind any events if there aren't any listeners at the time the player is created. This makes it impossible to bind an event by getting a reference to the player usingViewChild
and subscribing to it. These changes fix the issue using a lazy observable which binds any events once the user subscribes and transfers them between players.