Ram
Ram

Reputation: 51

Angular 5 bypassSecurityTrustUrl is not working

I am trying to have a video with the url being from other site on my Angular 5 application. The video is not being played.

var myUrl = "example.com/myvideo.mp4";
var safeUrl = this._sanitizer.bypassSecurityTrustUrl(myUrl);

this.videoUrl = safeUrl;

In the view I am trying to add the src to videoUrl.

Upvotes: 3

Views: 1204

Answers (1)

Ram
Ram

Reputation: 51

My bad, I had used value binding instead of property binding which solved the issue.

Upvotes: 1

Related Questions