Showing ERR_CERT_AUTHORITY_INVALID error while attaching youtube video URL in Angular

Viewed 182

I am working on an Angular 8 project. I have a requirement that I need to show 6 youtube videos in modal popup. For implementing this requirement I have used this code

This is my Html file code

<iframe [src]="safeSrc1" width="560" height="315" frameborder="0"
                    webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
                <iframe [src]="safeSrc2" width="560" height="315" frameborder="0"
                    webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>

This is my ts file code

this.safeSrc1 =  this.sanitizer.bypassSecurityTrustResourceUrl("http://www.youtube.com/embed/njTXQKbStoY");
this.safeSrc2 =  this.sanitizer.bypassSecurityTrustResourceUrl("http://www.youtube.com/embed/jrZAmrE720A");

After adding this, I can able to show the video in modal popup as the requirement. But I am facing one issue because of this and the issue screenshot is given below.

enter image description here

If I add more youtube video URLs then this kind of more error will occur and this makes my site perform slow.

1 Answers

Finally I got the solution. I researched about the issue and I found that the issue was related to the antivirus installed in my PC. I have seen same issues which uses the iFrame for showing the YouTube videos, thus I understood that it is a common issue. And finally I came in a conclusion that something in my PC is blocking the YouTube URL. I tried remove the antivirus firewall blocking and this worked for me.

Related