Skip to content

fix(youtube-player): unable to bind to events after initialization#18996

Merged
jelbourn merged 1 commit into
angular:masterfrom
crisbeto:youtube-player-events
Apr 24, 2020
Merged

fix(youtube-player): unable to bind to events after initialization#18996
jelbourn merged 1 commit into
angular:masterfrom
crisbeto:youtube-player-events

Conversation

@crisbeto

@crisbeto crisbeto commented Apr 5, 2020

Copy link
Copy Markdown
Member

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.

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.
@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release labels Apr 5, 2020
@crisbeto crisbeto requested a review from jelbourn as a code owner April 5, 2020 10:52
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Apr 5, 2020
@@ -1,15 +1,15 @@
export declare class YouTubePlayer implements AfterViewInit, OnDestroy, OnInit {
apiChange: EventEmitter<YT.PlayerEvent>;
apiChange: Observable<YT.PlayerEvent>;

Copy link
Copy Markdown
Member Author

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.

@jelbourn jelbourn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@jelbourn jelbourn added lgtm action: merge The PR is ready for merge by the caretaker labels Apr 23, 2020
@jelbourn jelbourn merged commit bac6775 into angular:master Apr 24, 2020
jelbourn pushed a commit that referenced this pull request Apr 24, 2020
…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.
soro-google pushed a commit to soro-google/components that referenced this pull request Apr 24, 2020
…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.
@angular-automatic-lock-bot

Copy link
Copy Markdown

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 May 25, 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 P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants