Skip to content
Permalink
Browse files
fix(audio): sanitize audio url (DSP-1819) (#513)
  • Loading branch information
kilchenmann committed Sep 2, 2021
1 parent 83d5874 commit 35871cdfd79e733d0692bf65e83141d1a09e0cbc
@@ -1,4 +1,4 @@
<audio controls >
<source [src]="src.fileValue.fileUrl" type="audio/mpeg">
<audio controls preload="auto">
<source [src]="audio" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
@@ -1,4 +1,6 @@
import { Component, Input, OnInit } from '@angular/core';
import { DomSanitizer, SafeUrl } from '@angular/platform-browser';

import { FileRepresentation } from '../file-representation';

@Component({
@@ -10,11 +12,14 @@ export class AudioComponent implements OnInit {

@Input() src: FileRepresentation;

audio: SafeUrl;

constructor() { }
constructor(
private _sanitizer: DomSanitizer
) { }

ngOnInit(): void {

this.audio = this._sanitizer.bypassSecurityTrustUrl(this.src.fileValue.fileUrl);
}

}

0 comments on commit 35871cd

Please sign in to comment.