Skip to content

bug(@angular/youtube-player): "ready" event isn't fired #28834

Closed
@Eraldo

Description

@Eraldo

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

don't know

Description

Similar issue from the past: #20462
#20462 (comment) claims the problem was solved.
It seems to be there again.

After migrating from the NgModule version to using the YouTubePlayer component, I don't get a ready event fired anymore. Meaning I don't have access to the player object anymore. 😢

I am getting the following error, that might or might not be related.

Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://www.youtube.com') does not match the recipient window's origin ('https://example.com').

Similar to: #22835
I mention this here because similarly it could be that the error prevents the event from being emitted now that the code has been refactored (regression bug).

Reproduction

StackBlitz link: https://stackblitz.com/edit/angular-youtube-player-responsive-issue?file=src%2Fmain.ts
Steps to reproduce:

  1. Open the console.
  2. Verify that the console does not show the log message which according to the code would get written when the ready event is dispatched.

Expected Behavior

The ready event fires when the youtube player (video) loads.

Actual Behavior

The component event does not fire at all.

Environment

  • Angular: 17.3.3
  • Browser(s): Stackblitz

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageThis issue needs to be triaged by the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions