https://stackoverflow.com/questions/38593515/warning-sanitizing-unsafe-style-value-url
https://github.com/angular/angular/issues/13849
https://github.com/ionic-team/ionic/issues/7552
import { Pipe, PipeTransform } from '@angular/core';
import {DomSanitizer} from '@angular/platform-browser';
@Pipe({
name: 'trustAsResourceUrl'
})
export class TrustAsResourceUrlPipe implements PipeTransform {
constructor(private sanitizer:DomSanitizer){}
transform(url:string) {
//let sanitizedUrl = this.sanitizer.bypassSecurityTrustUrl(url);
//
let sanitizedUrl = this.sanitizer.bypassSecurityTrustResourceUrl(url);
return sanitizedUrl;
}
}
<video id="videoPlay" width="100%" height="auto" webkit-playsinline=""
playsinline=""
preload="none" controls="controls" #player [src]="resourceUrl" poster='{{resourceInfo.coverPath || "http://appdownload.allcam.com.cn/cover/no_picture.png" }}'&></video&>
Similar Posts:
- Ffmpeg scaling — the solution of “width / height not divisible by 2”
- Easyplayer player displays the cause and solution of compileerror: webassembly. Instance()
- [Solved] echart Error: Can’t get dom width or height
- Uncaught ReferenceError: process is not defined [How to Solve]
- UICollectionView must be initialized with a non-nil layout parameter [Solved]
- NPM err installation dependency package error [How to Solve]
- A problem with 0 document. Documentelement. Clientwidth
- [Solved] The cause of the wrong prompt instruction [ng: areq] in angular
- Git Error: The requested URL returned error: 403 Forbidden while accessing
- [How to Solve] Uncaught ReferenceError: app is not defined