-1

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.

Wagm
  • 309
  • 5
  • 12

1 Answers1

1

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

and your constructor to

this.url = this.sanitizer.bypassSecurityTrustResourceUrl("https://player.vimeo.com/video/276885072");
  }
DrNio
  • 1,936
  • 1
  • 19
  • 25