DEV Community

Cover image for The new Angular YouTube Player component!

The new Angular YouTube Player component!

Craig ☠️💀👻 on November 02, 2019

Easily embed YouTube videos in your Angular applications! TL;DR; — There’s a cool new component in the Angular world 🌎! It ma...
Collapse
 
splaktar profile image
Michael Prentice

Thanks for the write up!

I just made some changes to show how you can have the video resize to fit its container space: github.com/angular/components/pull...

Here's that demo on StackBlitz: stackblitz.com/edit/youtube-player...

Collapse
 
wsadqe1234 profile image
WSADQE1234

Dude THANK YOU!!!! U are AWESOME!!!

Collapse
 
phenomnominal profile image
Craig ☠️💀👻

Awesome! Thank you!

Collapse
 
taylordwright44 profile image
taylordwright44

Hello. I was wonder, with the tag method, what's the best way to use youtube's javascript API? For example I want to change the video time with player.getCurrentTime() or something. How would I do this?

Collapse
 
arcticjuggernaut profile image
Chris Johnston

You bastard you had to use a baby shark video didn't you?!

Collapse
 
phenomnominal profile image
Craig ☠️💀👻

🦈🦈🦈🦈🦈

Collapse
 
lalish99 profile image
Eduardo Rojas • Edited

Great post!

One question, I've added a video correctly but I am wondering if I need to pay attention to the following warnings, apparently they start appearing after I use the Youtube Api directly or with this new component. Thanks in advance

Collapse
 
oleksandr profile image
Oleksandr

Cool

Collapse
 
lisacopeland profile image
Lisa Copeland

Thanks! That was super simple to use! I was also able to use breakpoint observer to make it responsive!

Collapse
 
cook_n_pop profile image
Cooknpop • Edited

You can use also use to make it responsive the bootstrap embed-responsive class

Collapse
 
toshminosh profile image
Toshminosh

Does startSeconds work yet?

I can't seem to get it working though height and width work fine.

Collapse
 
phenomnominal profile image
Craig ☠️💀👻

I've actually had the same issue! I started debugging it, but didn't get very far! You should raise an issue on the repo, or even make a PR!

Collapse
 
lautarojgarcia177 profile image
Lautaro Garcia

Does anyone know how yo hide the player's controls?

Collapse
 
layzee profile image
Lars Gyrup Brink Nielsen

Pass { controls: YT.Controls.Hide } to the playerVars input property.