2

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.

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

5 Comments

I am unsure of your links :^)
@Foxhunt sorry plz try now
Ok it seems to works, though it does not fire ready unless the player has actually started, which is not really what i would like : stackblitz.com/edit/angular-tly1p6bn I suppose I can auto play and stop immediatly
@Foxhunt just check once if the latest version has the same issue, I think the player gets provisioned only when the play button is pressed, nice workaround, I didn't think about inheritance.
If you're fine using 3rd party libraries, you can try this one - demo

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.