Embed Youtube Videos Problem

In a list item,

This embed thumbnail code works:

<img src='http://img.youtube.com/vi/{{video.Id}}/0.jpg' style='height:70px;width:70px'>

but the actual embed code doesn’t:

<iframe width="300" height="240" src="http://www.youtube.com/embed/{{video.Id}}" frameborder="0" allowfullscreen></iframe>

Why is that? Having lots of problems with this

You need to tell angular that url is a safe and trusted url.

Check out this.

I’ve managed to solve it with your pointers. Earlier, i did not take into account the need to whitelist specific urls. Appreciate your help very much. Thanks

1 Like