0
votes

I am trying to use iframe vimeo video in my website, but I keep getting:

unsafe value used in a resource URL context (see http://g.co/ng/security#xss)

I know this question been asked before by people and I looked in the official documentation and using DomSanitizer, but I still get an error.

I have created simple stackblitz to illustrate the problem.

1

1 Answers

1
votes

change your iframe src to [src]="url"

and your constructor to

this.url = this.sanitizer.bypassSecurityTrustResourceUrl("https://player.vimeo.com/video/276885072");
  }