Created
February 23, 2021 17:12
-
-
Save lydemann/dae9f656ba0d64e184cc43d9ddda4fcf to your computer and use it in GitHub Desktop.
course-content.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private getTrustedVideoUrl(url: string): SafeResourceUrl { | |
// Url domains are whitelisted using CSP header | |
// Content-Security-Policy: frame-src <source> <source>; | |
const sanitizedUrl = this.sanitizer.sanitize( | |
SecurityContext.URL, | |
url | |
); | |
return this.sanitizer.bypassSecurityTrustResourceUrl(sanitizedUrl); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment