DEV Community

Discussion on: The new Angular YouTube Player component!

Collapse
 
mehrus profile image
Patryk Góral • Edited

I could not find it but it is possible to get access to the player? I need to hide placeholder image and start the video by clicking on the placeholder. I need to trigger player.playVideo() somehow.

Edit: I achieved it by using @ViewChild

in ts:
@ViewChild('youtube') youtube?:YouTubePlayer;
public playVideo() {
this.youtube?.playVideo();
}