angular4与jwplayer集成不起作用,但在Chrome,Firefox,Edge上

时间:2018-05-30 09:03:33

标签: javascript angular

当项目单击它时将调用showvideo function:

showVideo(vidSrc, vidWidth, jwSrc, itemId) {
    console.log(jwSrc);
    this.hideVideo = false;
    this.show_backdrop();
    document.getElementById("video_wrapper").style.marginLeft = (-1 * vidWidth / 2) + "px";
    if (this.isIE) {
        if (this.player) {
            this.player.remove();
        }
        this.player = jwplayer("video_wrapper").setup({
             file: jwSrc,
             width: vidWidth,
             aspectratio: '16:9',
             type: 'mp4'
        });
    } else {
        console.log("not ie show video");
        let vid = <HTMLVideoElement>document.getElementById("video");
        this.videoSrc = vidSrc;
        this.videoWidth = vidWidth;
        vid.load();
        setTimeout(function () {
            vid.play();
        }, 1000);
    }
}

下面的html代码:

enter image description here

0 个答案:

没有答案