Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
course-content.component.ts
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