最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

typescript - Angular Youtube - onReady - Stack Overflow

programmeradmin7浏览0评论

I am trying to wrap Angular/Youtube component, described here.

This stackblitz is the result.

The problem here is that

<youtube-player
  #musicPlayer
  [videoId]="extractVideoId(videoId)"
  (ready)="onReadyInternal($event)">
</youtube-player>

is not firing at all the onReadyevent. I never have my console log.

  onReadyInternal(event: any): void {
    console.log(event, 'Is Ready');
    this.onReady.emit(event);
  }

I based my work on another question with a linked project. The onReady fires normally on this one, and the code looks very similar.

I am trying to wrap Angular/Youtube component, described here.

This stackblitz is the result.

The problem here is that

<youtube-player
  #musicPlayer
  [videoId]="extractVideoId(videoId)"
  (ready)="onReadyInternal($event)">
</youtube-player>

is not firing at all the onReadyevent. I never have my console log.

  onReadyInternal(event: any): void {
    console.log(event, 'Is Ready');
    this.onReady.emit(event);
  }

I based my work on another question with a linked project. The onReady fires normally on this one, and the code looks very similar.

Share Improve this question edited Mar 27 at 6:54 Naren Murali 60.1k5 gold badges44 silver badges77 bronze badges asked Mar 26 at 18:46 FoxhuntFoxhunt 9222 gold badges13 silver badges31 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

This is an issue on angular/components github.

bug(YouTubePlayer): startSeconds and ready not working #29874

The fix is provided in the PR:

Youtube player startSeconds and ready event not working #29986

You can upgrade angular and angular components to 18 to solve the problem.

I tried for a workaround but did not have luck.

发布评论

评论列表(0)

  1. 暂无评论