Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 837
Ram Avatar asked Aug 05 '26 23:08

Ram


1 Answers

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

like image 57
Ram Avatar answered Aug 08 '26 19:08

Ram



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!