When I pass a remote url through DomSanitizer, http://localhost:4200 is being prefixed to the url and I get a 404 as a consequence.
GET http://localhost:4200/.cs.uic.edu/~i101/SoundFiles/Fanfare60.wav 404 (Not Found)
The original URL: https://www2.cs.uic.edu/~i101/SoundFiles/Fanfare60.wav
My code:
constructor(private sanitizer: DomSanitizer) {}
public getSantizeUrl(url: string) {
return this.sanitizer.bypassSecurityTrustResourceUrl(url);
}
And my template:
<audio #player style="width: 100%" controls="controls" [src]="getSantizeUrl(chunk.value)" >
</audio>
Is there something I'm missing? Why the prefix? FWIW bypassSecurityTrustUrl(url) has the same effect.
Thanks