'How to fix error on iframe load in Angular?

I have this iframe in my angular mini project.

<div class="playerWrap">

    <div id="background-video" class="bg-image" [style.background]="'url(' + serverApiUrl + thumbnail + ')'">

        <iframe id="iframe-id" [ngClass]="isShow ? 'd-none' : 'd-block'" width="295" height="222" [src]="currentUrl | safeUrl" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen>
        </iframe>
        <a class="play-btn" *ngIf="isShow" (click)="loadIframe()">Play Button</a>

    </div>
</div>

    loadIframe() {
        this.isShow = false;
        this.currentUrl = this.iframeUrl + '?autoplay=1'
        console.log(this.currentUrl);

    }

but on load iframe I get this error



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source