UNPKG

ng-cw-v12

Version:

Angular UI component library

765 lines 56 kB
import * as i0 from '@angular/core';
import { Injectable, EventEmitter, Component, Input, Output, NgModule } from '@angular/core';
import * as i2 from '@angular/common';
import { CommonModule } from '@angular/common';
import { __awaiter } from 'tslib';
import Hls from 'hls.js';

class LocalService {
    constructor() {
    }
    //格式化时间
    durationFormatSubVal(val) {
        let valStr = val.toString();
        if (valStr.length < 2) {
            return '0' + valStr;
        }
        return valStr;
    }
    //格式化时间
    durationText(duration) {
        if (duration < 0) {
            return "Play";
        }
        let durationSecInt = Math.round(duration);
        return this.durationFormatSubVal(Math.floor(durationSecInt / 3600))
            + ":" + this.durationFormatSubVal(Math.floor((durationSecInt % 3600) / 60))
            + ":" + this.durationFormatSubVal(Math.floor(durationSecInt % 60));
    }
    //加载js
    loadScript(scriptUrl) {
        const script = document.createElement('script');
        script.type = 'text/javascript';
        script.src = scriptUrl;
        document.body.appendChild(script);
    }
    // 检查流地址是否可访问
    checkStreamUrl(url) {
        return new Promise((resolve, reject) => {
            fetch(url, {
                method: 'get',
                mode: 'cors'
            }).then(res => {
                resolve(res.ok);
            }).catch(err => {
                reject(false);
            });
        });
    }
    /**
     * 获取文件后缀
     * @param filename string 文件名
     * @returns extension
     */
    getFileExtension(filename) {
        if (!filename) {
            return '';
        }
        const filenameArr = filename.split('.');
        if (filenameArr.length == 0) {
            return '';
        }
        else {
            const extension = filenameArr.pop();
            return extension.toLowerCase();
        }
    }
}
LocalService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0, type: LocalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
LocalService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0, type: LocalService, providedIn: 'root' });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0, type: LocalService, decorators: [{
            type: Injectable,
            args: [{
                    providedIn: 'root'
                }]
        }], ctorParameters: function () { return []; } });

class VideoHlsComponent {
    constructor(elementRef, ls) {
        this.elementRef = elementRef;
        this.ls = ls;
        this.SHOW_LOADING = "loading...";
        this.SHOW_DONE = "done.";
        this.isH265 = true;
        this.isPlaying = false;
        this.muteState = true;
        this.isFullScreenBtn = false;
        this.networkState = 1; //1:加载中 2:视频地址超时 3:视频地址格式错误 4:初始化组件失败 5:成功
        this.glplayerId = 'glplayer' + '_' + new Date().getTime() + '_' + Math.random().toString(36).substring(2, 15);
        this.initMissileOk = false;
        this.fullscreenHandler = null;
        this.canvasStyle = {
            marginLeft: 0,
            marginTop: 0,
            width: 0,
            height: 0
        };
        this.resizeObserver = null;
        this.resizeDebounceTimer = null;
        this.isInitialResize = true;
        this.ncUrl = ''; //视频地址
        this.ncErrorTime = 8; //视频地址错误检测时间
        this.ncResizeWay = 'default';
        this.ncPlaying = new EventEmitter(); //返回播放状态
        this.ncLoaded = new EventEmitter(); //返回播放器
        this.autoplayMode = false;
        this.mutedMode = true;
        this.controlsMode = true;
        this.playError = false;
        //重写console.log来捕获所有输出
        this.originalConsoleLog = console.log; // 保存原始 console.log
        console.log = (...args) => {
            this.originalConsoleLog.apply(console, args);
            const message = args.join(' ');
            if (message.includes('onReadyShowDone')) {
                this.originalConsoleLog('检测到missile初始化成功!');
                this.initMissileOk = true;
            }
        };
        // 只在第一次实例化时加载脚本
        if (!VideoHlsComponent.h265webjsLoaded) {
            this.ls.loadScript('assets/h265webjs-js/h265webjs-v20211104.js');
            VideoHlsComponent.h265webjsLoaded = true;
        }
    }
    //自动播放
    set ncAutoplay(value) {
        this.autoplayMode = value !== null && value !== undefined && value !== false && value !== 'false';
    }
    //静音
    set ncMuted(value) {
        this.mutedMode = value !== null && value !== undefined && value !== false && value !== 'false';
    }
    //隐藏控制栏
    set ncControls(value) {
        this.controlsMode = value !== null && value !== undefined && value !== false && value !== 'false';
    }
    ngOnInit() { }
    ngAfterViewInit() {
        if (this.ls.getFileExtension(this.ncUrl) !== 'm3u8') {
            console.error("视频地址格式错误!仅支持m3u8格式!");
            this.networkState = 3;
            return;
        }
        this.waitForPlayerLoad();
    }
    ngOnDestroy() {
        // 恢复原始的 console.log
        if (this.originalConsoleLog) {
            console.log = this.originalConsoleLog;
        }
        // 移除全屏事件监听器
        if (this.fullscreenHandler) {
            document.removeEventListener('fullscreenchange', this.fullscreenHandler);
            this.fullscreenHandler = null;
        }
        // 清理ResizeObserver
        if (this.resizeObserver) {
            this.resizeObserver.disconnect();
            this.resizeObserver = null;
        }
        // 清理防抖定时器
        if (this.resizeDebounceTimer) {
            clearTimeout(this.resizeDebounceTimer);
            this.resizeDebounceTimer = null;
        }
        // 重置初始化标志和尺寸记录
        this.isInitialResize = true;
        //销毁 h265webjs player
        try {
            if (this.player && typeof this.player.release === 'function') {
                this.player.release();
            }
        }
        catch (error) {
            console.warn('播放器销毁失败:', error);
        }
        //销毁 hls.js player
        this.destroyAll();
    }
    //等待265webjs加载完成
    waitForPlayerLoad() {
        if (!window.new265webjs) {
            setTimeout(() => {
                this.waitForPlayerLoad();
            }, 100);
            return;
        }
        //初始化
        this.initPlayer();
        // 8秒后通过打印台信息检查missile是否初始化成功
        setTimeout(() => {
            if (!this.initMissileOk) {
                console.log("missile初始化失败!");
                this.networkState = 4;
            }
        }, this.ncErrorTime * 1000);
    }
    //重新加载
    reload() {
        this.isInitialResize = true;
        this.player.release();
        const glplayer = this.elementRef.nativeElement.querySelector('#' + this.glplayerId);
        const playerCanvas = glplayer.querySelector('canvas');
        playerCanvas.remove();
        this.initPlayer();
    }
    //初始化
    initPlayer() {
        return __awaiter(this, void 0, void 0, function* () {
            var token = "base64:QXV0aG9yOmNoYW5neWFubG9uZ3xudW1iZXJ3b2xmLEdpdGh1YjpodHRwczovL2dpdGh1Yi5jb20vbnVtYmVyd29sZixFbWFpbDpwb3JzY2hlZ3QyM0Bmb3htYWlsLmNvbSxRUTo1MzEzNjU4NzIsSG9tZVBhZ2U6aHR0cDovL3h2aWRlby52aWRlbyxEaXNjb3JkOm51bWJlcndvbGYjODY5NCx3ZWNoYXI6bnVtYmVyd29sZjExLEJlaWppbmcsV29ya0luOkJhaWR1";
            // var url = "http://182.140.3.24:9999/rtp/51332300001320000001_51332300001320000001/hls.m3u8";//265 canvas
            // var url = "https://sf1-cdn-tos.huoshanstatic.com/obj/media-fe/xgplayer_doc_video/hls/xgplayer-demo.m3u8";//264 vjs
            // var url = "http://pull-demo.volcfcdnrd.com/live/st-4536521_yzmuhevcd.flv";//265
            // var url = "https://sf1-cdn-tos.huoshanstatic.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv";//264 flvjs
            //检查流地址是否可访问
            this.networkState = 1;
            try {
                const isAvailable = yield this.ls.checkStreamUrl(this.ncUrl);
                if (!isAvailable) {
                    this.networkState = 2;
                    return;
                }
            }
            catch (error) {
                this.networkState = 2;
                return;
            }
            let width = this.elementRef.nativeElement.offsetWidth;
            let height = this.elementRef.nativeElement.offsetHeight;
            console.log("width===========>", width);
            console.log("height===========>", height);
            var config = {
                player: this.glplayerId,
                width: width,
                height: height,
                token: token,
                extInfo: {
                    coreProbePart: 0.4,
                    probeSize: 8192
                }
            };
            let playerObj = window.new265webjs(this.ncUrl, config);
            this.player = playerObj;
            //加载missile(如果放在构造函数中加载的话,会产生可能不去加载视频地址导致的初始化失败问题)
            if (!VideoHlsComponent.missileLoaded) {
                this.ls.loadScript('assets/h265webjs-js/missile.js');
                VideoHlsComponent.missileLoaded = true;
            }
            let playerCont = this.elementRef.nativeElement.querySelector('#player-container');
            let controllerCont = this.elementRef.nativeElement.querySelector('#controller');
            let progressCont = this.elementRef.nativeElement.querySelector('#progress-contaniner');
            let progressContW = progressCont.offsetWidth;
            let cachePts = progressCont.querySelector('#cachePts');
            let progressPts = progressCont.querySelector('#progressPts');
            let progressVoice = this.elementRef.nativeElement.querySelector('#progressVoice');
            let playBtn = this.elementRef.nativeElement.querySelector('#playBtn');
            let showLabel = this.elementRef.nativeElement.querySelector('#showLabel');
            let ptsLabel = this.elementRef.nativeElement.querySelector('#ptsLabel');
            let coverToast = this.elementRef.nativeElement.querySelector('#coverLayer');
            let coverBtn = this.elementRef.nativeElement.querySelector('#coverLayerBtn');
            let muteBtn = this.elementRef.nativeElement.querySelector('#muteBtn');
            let fullScreenBtn = this.elementRef.nativeElement.querySelector('#fullScreenBtn');
            let mediaInfo = null;
            playBtn.disabled = true;
            showLabel.textContent = this.SHOW_LOADING;
            playerCont.style.width = config.width + 'px';
            playerCont.style.height = config.height + 'px';
            controllerCont.style.width = config.width + 'px';
            //播放方法
            let playAction = () => {
                if (playerObj.isPlaying()) {
                    console.log("bar pause============>");
                    playerObj.pause();
                    this.isPlaying = false;
                    coverToast.removeAttribute('hidden');
                }
                else {
                    console.log("bar play============>");
                    playerObj.play();
                    this.isPlaying = true;
                    coverToast.setAttribute('hidden', 'hidden');
                }
                this.ncPlaying.emit(this.isPlaying);
            };
            playerCont.onmouseover = () => {
                if (!this.controlsMode) {
                    controllerCont.hidden = true;
                }
                else {
                    controllerCont.hidden = false;
                }
            };
            controllerCont.hidden = true; //默认隐藏工具栏,不在html中设置是因为前方需要获取宽度
            playerCont.onmouseout = () => {
                controllerCont.hidden = true;
            };
            //播放按钮点击事件
            playBtn.onclick = () => {
                playAction();
            };
            //静音按钮点击事件
            muteBtn.onclick = () => {
                // console.log(playerObj.getVolume());
                if (this.muteState) {
                    playerObj.setVoice(1.0);
                    progressVoice.value = 100;
                }
                else {
                    playerObj.setVoice(0.0);
                    progressVoice.value = 0;
                }
                this.muteState = !this.muteState;
            };
            //全屏按钮点击事件
            fullScreenBtn.onclick = () => {
                if (!this.isFullScreenBtn) {
                    // 设置当前全屏播放器ID
                    VideoHlsComponent.currentFullscreenPlayerId = this.glplayerId;
                    document.documentElement.requestFullscreen();
                    // 记录canvas的样式用于还原
                    const glplayer = this.elementRef.nativeElement.querySelector('#' + this.glplayerId);
                    const playerCanvas = glplayer.querySelector('canvas');
                    if (playerCanvas) {
                        this.canvasStyle.marginLeft = parseInt(getComputedStyle(playerCanvas).marginLeft) || 0;
                        this.canvasStyle.marginTop = parseInt(getComputedStyle(playerCanvas).marginTop) || 0;
                        this.canvasStyle.width = playerCanvas.offsetWidth;
                        this.canvasStyle.height = playerCanvas.offsetHeight;
                    }
                }
                else {
                    document.exitFullscreen();
                }
            };
            // 全屏监听
            this.fullscreenHandler = (event) => {
                // 只处理当前触发全屏的播放器
                if (VideoHlsComponent.currentFullscreenPlayerId === this.glplayerId) {
                    if (document.fullscreenElement) {
                        const screenWidth = window.screen.width;
                        const screenHeight = window.screen.height;
                        this.updatePlayerSize('fullscreen', screenWidth, screenHeight);
                        this.isFullScreenBtn = true;
                        // 添加全屏时的样式
                        playerCont.style.position = 'fixed';
                        playerCont.style.top = '0';
                        playerCont.style.left = '0';
                        playerCont.style.zIndex = '10001';
                    }
                    else {
                        this.updatePlayerSize('normal', config.width, config.height);
                        this.isFullScreenBtn = false;
                        // 退出全屏时清除当前全屏播放器ID
                        VideoHlsComponent.currentFullscreenPlayerId = null;
                        // 恢复正常样式
                        playerCont.style.position = 'relative';
                        playerCont.style.top = 'auto';
                        playerCont.style.left = 'auto';
                        playerCont.style.zIndex = 'auto';
                    }
                }
            };
            document.addEventListener('fullscreenchange', this.fullscreenHandler);
            //进度条点击事件
            progressCont.addEventListener('click', (e) => {
                showLabel.textContent = this.SHOW_LOADING;
                let x = e.pageX - progressCont.getBoundingClientRect().left; // or e.offsetX (less support, though)
                let y = e.pageY - progressCont.getBoundingClientRect().top; // or e.offsetY
                let clickedValue = x * progressCont.max / progressCont.offsetWidth;
                playerObj.seek(clickedValue);
            });
            //进度条音量点击事件
            progressVoice.addEventListener('click', (e) => {
                let x = e.pageX - progressVoice.getBoundingClientRect().left; // or e.offsetX (less support, though)
                let y = e.pageY - progressVoice.getBoundingClientRect().top; // or e.offsetY
                let clickedValue = x * progressVoice.max / progressVoice.offsetWidth;
                progressVoice.value = clickedValue;
                let volume = clickedValue / 100;
                playerObj.setVoice(volume);
                this.muteState = volume == 0;
            });
            //进度条开始拖拽事件
            playerObj.onSeekStart = (pts) => {
                showLabel.textContent = this.SHOW_LOADING + " seek to:" + parseInt(pts);
            };
            //进度条结束拖拽事件
            playerObj.onSeekFinish = () => {
                showLabel.textContent = this.SHOW_DONE;
            };
            //播放结束事件
            playerObj.onPlayFinish = () => {
                console.log("============= FINISHED ===============");
                this.isPlaying = false;
            };
            //渲染事件
            playerObj.onRender = (width, height, imageBufferY, imageBufferB, imageBufferR) => {
                console.log("on render");
            };
            //打开全屏事件
            playerObj.onOpenFullScreen = () => {
                console.log("onOpenFullScreen");
            };
            //关闭全屏事件
            playerObj.onCloseFullScreen = () => {
                console.log("onCloseFullScreen");
            };
            //进度条结束拖拽事件
            playerObj.onSeekFinish = () => {
                showLabel.textContent = this.SHOW_DONE;
            };
            //加载缓存事件
            playerObj.onLoadCache = () => {
                showLabel.textContent = "Caching...";
            };
            //加载缓存完成事件
            playerObj.onLoadCacheFinshed = () => {
                showLabel.textContent = this.SHOW_DONE;
            };
            //准备完成事件
            playerObj.onReadyShowDone = () => {
                console.log("onReadyShowDone");
                showLabel.textContent = "Cover Img OK";
                this.networkState = 5;
            };
            //加载完成事件
            playerObj.onLoadFinish = () => {
                mediaInfo = playerObj.mediaInfo();
                console.log("mediaInfo===========>", mediaInfo);
                if (mediaInfo.meta.isHEVC === false) {
                    console.log("is not HEVC/H.265 media!");
                    playerObj.release();
                    this.isH265 = false;
                    setTimeout(() => {
                        this.initVideo();
                    }, 200);
                    return;
                }
                playBtn.disabled = false;
                //H265 resize - 使用ResizeObserver监听元素尺寸变化
                if (this.isH265) {
                    this.setupResizeObserver(token, playerCont, controllerCont);
                }
                //视频类型
                if (mediaInfo.videoType == "vod") {
                    cachePts.max = mediaInfo.meta.durationMs / 1000;
                    progressCont.max = mediaInfo.meta.durationMs / 1000;
                    ptsLabel.textContent = this.ls.durationText(0) + '/' + this.ls.durationText(progressCont.max);
                }
                else {
                    cachePts.hidden = true;
                    progressCont.hidden = true;
                    ptsLabel.textContent = 'LIVE';
                }
                //封面按钮点击事件
                coverBtn.onclick = () => {
                    playAction();
                };
                //没有音频
                if (mediaInfo.meta.audioNone) {
                    progressVoice.value = 0;
                    progressVoice.style.display = 'none';
                    this.muteState = true;
                }
                else {
                    if (this.mutedMode) {
                        playerObj.setVoice(0.0);
                        progressVoice.value = 0;
                        this.muteState = true;
                    }
                    else {
                        playerObj.setVoice(0.5);
                        progressVoice.value = 50;
                        this.muteState = false;
                    }
                }
                //自动播放
                if (this.autoplayMode) {
                    playAction();
                }
                else {
                    coverToast.removeAttribute('hidden');
                }
                showLabel.textContent = this.SHOW_DONE;
            };
            //缓存进度事件
            playerObj.onCacheProcess = (cPts) => {
                try {
                    let precent = cPts / progressCont.max;
                    let cacheWidth = precent * progressContW;
                    cachePts.style.width = cacheWidth + 'px';
                }
                catch (err) {
                    console.log(err);
                }
            };
            //播放时间事件
            playerObj.onPlayTime = (videoPTS) => {
                if (mediaInfo.videoType == "vod") {
                    let precent = videoPTS / progressCont.max;
                    let progWidth = precent * progressContW;
                    progressPts.style.width = progWidth + 'px';
                    ptsLabel.textContent = this.ls.durationText(videoPTS) + '/' + this.ls.durationText(progressCont.max);
                }
                else {
                    ptsLabel.textContent = 'LIVE';
                }
            };
            playerObj.do();
            this.ncLoaded.emit(this.player);
        });
    }
    // 设置ResizeObserver监听.video-hls-265尺寸变化
    setupResizeObserver(token, playerCont, controllerCont) {
        // 清理之前的observer
        if (this.resizeObserver) {
            this.resizeObserver.disconnect();
        }
        this.resizeObserver = new ResizeObserver((entries) => {
            console.log('resize observer');
            // 跳过首次初始化触发
            if (this.isInitialResize) {
                this.isInitialResize = false;
                console.log('resize initial');
                return;
            }
            const entry = entries[0];
            const { width, height } = entry.contentRect;
            console.log('resize width===========>', width);
            console.log('resize height===========>', height);
            // 清除之前的防抖定时器
            if (this.resizeDebounceTimer) {
                clearTimeout(this.resizeDebounceTimer);
                console.log('resize debounce cleared');
            }
            //更改原player-container容器样式
            playerCont.style.width = width + 'px';
            playerCont.style.height = height + 'px';
            //更改控制条controller宽度
            controllerCont.style.width = width + 'px';
            //更改原glplayer样式
            const glplayer = this.elementRef.nativeElement.querySelector('#' + this.glplayerId);
            glplayer.style.width = width + 'px';
            glplayer.style.height = height + 'px';
            //先更改原canvas样式为占满,后面再用新的值更新
            const playerCanvas = glplayer.querySelector('canvas');
            playerCanvas.style.width = width + 'px';
            playerCanvas.style.height = height + 'px';
            playerCanvas.style.marginLeft = '0px';
            playerCanvas.style.marginTop = '0px';
            // 设置防抖,500ms后执行resize逻辑
            this.resizeDebounceTimer = setTimeout(() => {
                if (this.ncResizeWay == 'default') {
                    console.log('resize start');
                    var config = {
                        player: 'resize-container',
                        width: width,
                        height: height,
                        token: token,
                        extInfo: {
                            coreProbePart: 0.4,
                            probeSize: 8192
                        }
                    };
                    let playerObjForResize = window.new265webjs(this.ncUrl, config);
                    playerObjForResize.onLoadFinish = () => {
                        playerObjForResize.play();
                        console.log('playerObjForResize play');
                        // 监听canvas样式变化
                        const glplayerForResize = this.elementRef.nativeElement.querySelector('#resize-container');
                        const allPlayerCanvasForResize = glplayerForResize.querySelectorAll('canvas');
                        //这里查询all并使用最后一个canvas是因为可能在监听canvas尺寸变化过程中(还在播放准备中)又有新的play(尺寸又变化了)增加了新的canvas,同时存在多个canvas
                        //如果不使用最后一个canvas,都会监听第一个canvas,第一个canvas被移除后,后面的尺寸变化监听就是失效了且多余的canvas不会被移除
                        //总结:存在多个canvas时,会对每个都监听,也就是按顺序执行样式变化更新和清理
                        const playerCanvasForResize = allPlayerCanvasForResize[allPlayerCanvasForResize.length - 1];
                        // 使用MutationObserver监听style属性变化
                        const observer = new MutationObserver((mutations) => {
                            mutations.forEach((mutation) => {
                                if (mutation.type === 'attributes' && mutation.attributeName === 'style') {
                                    const target = mutation.target;
                                    const computedStyle = getComputedStyle(target);
                                    const marginLeft = parseInt(computedStyle.marginLeft) || 0;
                                    const marginTop = parseInt(computedStyle.marginTop) || 0;
                                    // 检查是否出现了margin-top和margin-left属性
                                    if (marginLeft !== 0 || marginTop !== 0) {
                                        const width = target.offsetWidth;
                                        const height = target.offsetHeight;
                                        console.log('检测到canvas样式变化:', { marginLeft, marginTop, width, height });
                                        // 执行清理操作
                                        observer.disconnect();
                                        playerObjForResize.release();
                                        playerCanvasForResize.remove();
                                        //更新原canvas样式
                                        playerCanvas.style.width = width + 'px';
                                        playerCanvas.style.height = height + 'px';
                                        playerCanvas.style.marginLeft = marginLeft + 'px';
                                        playerCanvas.style.marginTop = marginTop + 'px';
                                        console.log('resize end');
                                    }
                                }
                            });
                        });
                        // 开始监听canvas的style属性变化
                        observer.observe(playerCanvasForResize, {
                            attributes: true,
                            attributeFilter: ['style']
                        });
                    };
                    playerObjForResize.do();
                }
                else {
                    this.reload();
                }
            }, 500); // 500ms防抖延迟
        });
        // 开始监听video-hls-265元素尺寸变化
        const videoHls265Element = this.elementRef.nativeElement.querySelector('.video-hls-265');
        this.resizeObserver.observe(videoHls265Element);
    }
    // 抽取尺寸更新逻辑到单独的方法
    updatePlayerSize(mode, width, height) {
        const playerCont = this.elementRef.nativeElement.querySelector('#player-container');
        const controllerCont = this.elementRef.nativeElement.querySelector('#controller');
        const glplayer = this.elementRef.nativeElement.querySelector('#' + this.glplayerId);
        playerCont.style.width = width + 'px';
        playerCont.style.height = height + 'px';
        controllerCont.style.width = width + 'px';
        glplayer.style.width = width + 'px';
        glplayer.style.height = height + 'px';
        // canvas
        const playerCanvas = glplayer.querySelector('canvas');
        if (playerCanvas) {
            if (mode == 'fullscreen') {
                playerCanvas.style.width = width + 'px';
                playerCanvas.style.height = height + 'px';
                playerCanvas.style.marginLeft = '0px';
                playerCanvas.style.marginTop = '0px';
            }
            else {
                playerCanvas.style.width = this.canvasStyle.width + 'px';
                playerCanvas.style.height = this.canvasStyle.height + 'px';
                playerCanvas.style.marginLeft = this.canvasStyle.marginLeft + 'px';
                playerCanvas.style.marginTop = this.canvasStyle.marginTop + 'px';
            }
        }
    }
    //初始化
    initVideo() {
        return __awaiter(this, void 0, void 0, function* () {
            console.log('启用hls.js!');
            this.destroyAll(); //加载前先销毁
            this.video = this.elementRef.nativeElement.querySelector('#video'); //获取video
            //hls(m3u8)
            if (this.video.canPlayType('application/vnd.apple.mpegurl')) {
                this.video.src = this.ncUrl;
            }
            else if (Hls.isSupported()) {
                this.hls = new Hls();
                this.hls.loadSource(this.ncUrl);
                this.hls.attachMedia(this.video);
                //错误监听
                this.hls.on(Hls.Events.ERROR, (event, data) => {
                    if (data.details == 'bufferStalledError') {
                        console.warn('warning:', data.error);
                    }
                    else if (data.details == 'fragParsingError') {
                        console.warn('warning:', data.error);
                    }
                    else if (data.details == 'bufferNudgeOnStall') {
                        console.warn('warning:', data.error);
                    }
                    else {
                        this.playError = true;
                        console.error('error:', data.details);
                        console.error('error:', data.error);
                    }
                });
            }
            //播放监听
            this.video.addEventListener('play', () => {
                this.ncPlaying.emit(true);
            });
            //暂停监听
            this.video.addEventListener('pause', () => {
                this.ncPlaying.emit(false);
            });
            //返回video对象
            this.ncLoaded.emit(this.video);
        });
    }
    //销毁
    destroyAll() {
        if (this.hls) {
            this.hls.destroy();
        }
        if (this.video) {
            this.destroyVideo(this.video);
        }
    }
    destroyVideo(video) {
        video.pause();
        video.src = '';
        video.removeEventListener('play', () => { });
        video.removeEventListener('pause', () => { });
        video.removeEventListener('loadedmetadata', () => { });
        video.remove();
    }
}
VideoHlsComponent.currentFullscreenPlayerId = null; //静态属性来记录当前全屏的播放器ID
VideoHlsComponent.h265webjsLoaded = false; // 添加静态变量跟踪脚本加载状态
VideoHlsComponent.missileLoaded = false; // 添加静态变量跟踪missile加载状态
VideoHlsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0, type: VideoHlsComponent, deps: [{ token: i0.ElementRef }, { token: LocalService }], target: i0.ɵɵFactoryTarget.Component });
VideoHlsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: VideoHlsComponent, selector: "nc-video-hls", inputs: { ncUrl: "ncUrl", ncErrorTime: "ncErrorTime", ncAutoplay: "ncAutoplay", ncMuted: "ncMuted", ncControls: "ncControls", ncResizeWay: "ncResizeWay" }, outputs: { ncPlaying: "ncPlaying", ncLoaded: "ncLoaded" }, ngImport: i0, template: "<div class=\"video-hls-265\" *ngIf=\"isH265\">\r\n    <!--\u52A0\u8F7D\u3001\u9519\u8BEF\u4FE1\u606F-->\r\n    <div class=\"error-container\" *ngIf=\"networkState != 5\">\r\n        <!--\u52A0\u8F7D\u4E2D-->\r\n        <div class=\"error-text\" *ngIf=\"networkState == 1\">\r\n            <div class=\"loading-spinner\"></div>\r\n            <div>\u52A0\u8F7D\u4E2D...</div>\r\n        </div>\r\n        <!--\u9519\u8BEF-->\r\n        <div class=\"error-text\" *ngIf=\"networkState == 2 || networkState == 3 || networkState == 4\">\r\n            <svg t=\"1724830569178\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"\r\n                p-id=\"10496\" width=\"64\" height=\"64\">\r\n                <path\r\n                    d=\"M725.333333 469.333333c129.6 0 234.666667 105.066667 234.666667 234.666667s-105.066667 234.666667-234.666667 234.666667-234.666667-105.066667-234.666666-234.666667 105.066667-234.666667 234.666666-234.666667z m128-341.333333a128 128 0 0 1 128 128v294.101333a300.224 300.224 0 0 0-85.312-91.221333L896 426.666667h-59.605333c-34.346667-13.76-71.808-21.333333-111.061334-21.333334v-192H298.666667v597.333334h147.626666a298.453333 298.453333 0 0 0 50.282667 85.354666L170.666667 896a128 128 0 0 1-128-128V256a128 128 0 0 1 128-128h682.666666z m-119.466666 661.333333h-17.066667a21.333333 21.333333 0 0 0-21.333333 21.333334v17.066666a21.333333 21.333333 0 0 0 21.333333 21.333334h17.066667a21.333333 21.333333 0 0 0 21.333333-21.333334V810.666667a21.333333 21.333333 0 0 0-21.333333-21.333334zM213.333333 682.666667H128v85.333333a42.666667 42.666667 0 0 0 39.466667 42.56L170.666667 810.666667h42.666666v-128z m520.533334-128h-17.066667a21.333333 21.333333 0 0 0-21.184 18.837333L695.466667 576v149.333333a21.333333 21.333333 0 0 0 18.837333 21.184L716.8 746.666667h17.066667a21.333333 21.333333 0 0 0 21.184-18.837334L755.2 725.333333v-149.333333a21.333333 21.333333 0 0 0-21.333333-21.333333z m-266.026667-187.114667l2.773333 1.6 114.090667 71.296a298.965333 298.965333 0 0 0-154.432 217.002667 42.24 42.24 0 0 1-24.832-35.584L405.333333 618.666667V405.333333c0-32.426667 34.517333-52.608 62.506667-37.781333zM213.333333 426.666667H128v170.666666h85.333333v-170.666666z m0-213.333334H170.666667a42.666667 42.666667 0 0 0-42.56 39.466667L128 256v85.333333h85.333333v-128z m640 0h-42.666666v128h85.333333v-85.333333a42.666667 42.666667 0 0 0-39.466667-42.56L853.333333 213.333333z\"\r\n                    fill=\"#cdcdcd\" p-id=\"10497\"></path>\r\n            </svg>\r\n            <div *ngIf=\"networkState == 2\">\u89C6\u9891\u5730\u5740\u8BBF\u95EE\u8D85\u65F6\uFF0C\u64AD\u653E\u5931\u8D25\uFF01</div>\r\n            <div *ngIf=\"networkState == 3\">\u89C6\u9891\u5730\u5740\u683C\u5F0F\u9519\u8BEF\uFF0C\u4EC5\u652F\u6301m3u8\u683C\u5F0F\uFF01</div>\r\n            <div *ngIf=\"networkState == 4\">\u521D\u59CB\u5316\u7EC4\u4EF6\u5931\u8D25\uFF0C\u8BF7\u5237\u65B0\u9875\u9762\u91CD\u8BD5\u3002</div>\r\n        </div>\r\n    </div>\r\n\r\n    <!--\u5168\u5C4F\u64AD\u653E\u6309\u94AE-->\r\n    <div id=\"coverLayer\" hidden=\"hidden\">\r\n        <svg id=\"coverLayerBtn\" t=\"1730859326001\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\"\r\n            xmlns=\"http://www.w3.org/2000/svg\" p-id=\"5366\" width=\"48\" height=\"48\">\r\n            <path\r\n                d=\"M870.2 466.333333l-618.666667-373.28a53.333333 53.333333 0 0 0-80.866666 45.666667v746.56a53.206667 53.206667 0 0 0 80.886666 45.666667l618.666667-373.28a53.333333 53.333333 0 0 0 0-91.333334z\"\r\n                fill=\"#ffffff\" p-id=\"5367\"></path>\r\n        </svg>\r\n    </div>\r\n\r\n    <div id=\"player-container\">\r\n        <!--\u89C6\u9891\u5BB9\u5668-->\r\n        <div [id]=\"glplayerId\" class=\"glplayer\"></div>\r\n        <!--\u5DE5\u5177\u680F-->\r\n        <div id=\"controller\" class=\"controller\">\r\n\r\n            <!--\u8FDB\u5EA6\u6761-->\r\n            <div id=\"progress-contaniner\" class=\"progress-common progress-contaniner\">\r\n                <div id=\"cachePts\" class=\"progress-common cachePts\"></div>\r\n                <div id=\"progressPts\" class=\"progress-common progressPts\"></div>\r\n            </div>\r\n\r\n            <!--\u64CD\u4F5C\u680F-->\r\n            <div id=\"operate-container\" class=\"operate-container\">\r\n                <div class=\"left-container\">\r\n                    <!--\u65F6\u95F4-->\r\n                    <span id=\"ptsLabel\" class=\"ptsLabel\">00:00:00/00:00:00</span>\r\n                    <!--\u58F0\u97F3-->\r\n                    <div class=\"voice-div\">\r\n                        <span>\r\n                            <a id=\"muteBtn\" class=\"muteBtn\" href=\"javascript:void(0)\">\r\n                                <svg *ngIf=\"!muteState\" t=\"1730872283671\" class=\"icon\" viewBox=\"0 0 1024 1024\"\r\n                                    version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"1952\" width=\"20\" height=\"20\">\r\n                                    <path\r\n                                        d=\"M789.904 256.006a35.337 35.337 0 0 0-26.856-4.837 35.348 35.348 0 0 0-22.293 15.745c-10.69 16.753-6.085 38.982 10.384 50.116 3.845 2.61 95.493 66.021 95.493 223.695 0 158.078-87.909 221.529-91.385 223.917-16.537 11.266-20.958 33.723-9.931 50.414a35.583 35.583 0 0 0 22.707 15.351 35.58 35.58 0 0 0 26.885-5.339c5.043-3.363 123.277-85.635 123.277-284.382 0-199.051-123.017-281.284-128.281-284.68M678.54 362.663a35.357 35.357 0 0 0-27.125-1.288 35.378 35.378 0 0 0-20.041 18.319c-8.474 17.905-1.265 39.308 16.321 48.436 2.279 1.192 55.866 29.426 55.866 109.94 0 85.97-50.116 114.463-51.758 115.397-17.756 9.141-24.891 30.84-16.023 48.732a35.783 35.783 0 0 0 48.025 16.286c3.739-1.943 91.272-47.911 91.272-180.375 0-127.906-92.615-173.577-96.536-175.481M515.796 800.753l-74.695-67.89-122.264-111.176a37.404 37.404 0 0 0-25.17-9.71l-113.979 0.034-0.37-239.827h150.05a37.423 37.423 0 0 0 32.001-9.072l79.698-72.488 74.688-67.89v578.019h0.041z m44.361-678.294c-9.147-4.028-33.273-10.792-59.747 13.295l-59.31 53.928-118.604 107.814H179.318c-41.107 0.165-74.341 33.546-74.318 74.653v239.862c0 41.16 33.346 74.655 74.318 74.655h99.932L441.1 833.803l59.383 53.963c14.976 13.597 29.165 17.403 40.334 17.403 8.621 0 15.494-2.279 19.454-4.034 9.112-4.029 30.246-17.25 30.246-52.99v-672.84c0-24.685-11.35-44.406-30.36-52.846z m0 0\"\r\n                                        fill=\"#ffffff\" p-id=\"1953\"></path>\r\n                                </svg>\r\n                                <svg *ngIf=\"muteState\" t=\"1730872181114\" class=\"icon\" viewBox=\"0 0 1024 1024\"\r\n                                    version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"13389\" width=\"20\"\r\n                                    height=\"20\">\r\n                                    <path\r\n                                        d=\"M515.756 621.32v179.391L441.1 732.859 318.837 621.685a37.46 37.46 0 0 0-25.169-9.714l-113.981 0.036-0.369-239.826h87.299l-74.687-74.687h-12.612c-41.107 0.164-74.341 33.553-74.318 74.651v239.862c0 41.171 33.348 74.651 74.318 74.651h99.929L441.1 833.808l59.382 53.965c14.977 13.596 29.165 17.387 40.332 17.387 8.621 0 15.496-2.26 19.455-4.028 9.113-4.028 30.245-17.241 30.245-52.981V696.08l-74.758-74.76zM846.634 540.729c0 72.792-18.663 125.298-39.116 161.239l52.156 52.161c29.753-45.873 58.512-115.439 58.512-213.436 0-199.056-123.02-281.288-128.283-284.678a35.316 35.316 0 0 0-26.859-4.848 35.397 35.397 0 0 0-22.289 15.747c-10.689 16.749-6.087 38.984 10.384 50.119 3.845 2.605 95.495 66.011 95.495 223.696z\"\r\n                                        fill=\"#ffffff\" p-id=\"13390\"></path>\r\n                                    <path\r\n                                        d=\"M647.697 428.133c2.278 1.185 55.865 29.416 55.865 109.935 0 20.759-3.012 38-7.463 52.47l54.616 54.621c13.733-26.828 24.363-61.51 24.363-107.055 0-127.905-92.616-173.577-96.534-175.472v0.036a35.383 35.383 0 0 0-27.128-1.294 35.349 35.349 0 0 0-20.039 18.316c-8.475 17.916-1.267 39.312 16.32 48.443zM417.558 312.002l23.511-21.378 74.687-67.889V410.2l74.76 74.76V175.313c0-24.695-11.35-44.415-30.359-52.853-9.145-4.028-33.275-10.789-59.747 13.304l-59.309 53.91-76.405 69.456 52.862 52.872zM829.266 866.596c-9.55 0-19.1-3.645-26.39-10.935l-634.53-634.53c-14.58-14.58-14.58-38.2 0-52.78 14.58-14.58 38.2-14.58 52.78 0l634.53 634.529c14.58 14.58 14.58 38.2 0 52.78-7.29 7.291-16.84 10.936-26.39 10.936z\"\r\n                                        fill=\"#ffffff\" p-id=\"13391\"></path>\r\n                                </svg>\r\n                            </a>\r\n                        </span>\r\n                        <progress id=\"progressVoice\" class=\"progressVoice\" value=\"0\" max=\"100\"></progress>\r\n                    </div>\r\n                </div>\r\n\r\n                <div class=\"right-container\">\r\n                    <!--\u64AD\u653E\u3001\u6682\u505C-->\r\n                    <div id=\"playBtn\" [title]=\"isPlaying ? '\u6682\u505C' : '\u64AD\u653E'\">\r\n                        <svg *ngIf=\"!isPlaying\" t=\"1730861815254\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\"\r\n                            xmlns=\"http://www.w3.org/2000/svg\" p-id=\"8053\" width=\"20\" height=\"20\">\r\n                            <path\r\n                                d=\"M780.8 475.733333L285.866667 168.533333c-27.733333-17.066667-64 4.266667-64 36.266667v614.4c0 32 36.266667 53.333333 64 36.266667l492.8-307.2c29.866667-14.933333 29.866667-57.6 2.133333-72.533334z\"\r\n                                fill=\"#ffffff\" p-id=\"8054\"></path>\r\n                        </svg>\r\n                        <svg *ngIf=\"isPlaying\" t=\"1730861393868\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\"\r\n                            xmlns=\"http://www.w3.org/2000/svg\" p-id=\"6827\" width=\"20\" height=\"20\">\r\n                            <path\r\n                                d=\"M428.539658 833.494155c0 15.954367-13.053294 29.007661-29.007661 29.007661L285.613458 862.501816c-15.954367 0-29.007661-13.053294-29.007661-29.007661l0-639.423111c0-15.954367 13.053294-29.007661 29.007661-29.007661l113.918539 0c15.954367 0 29.007661 13.053294 29.007661 29.007661L428.539658 833.494155z\"\r\n                                fill=\"#ffffff\" p-id=\"6828\"></path>\r\n                            <path\r\n                                d=\"M760.124635 833.494155c0 15.954367-13.053294 29.007661-29.007661 29.007661l-113.918539 0c-15.954367 0-29.007661-13.053294-29.007661-29.007661l0-639.423111c0-15.954367 13.053294-29.007661 29.007661-29.007661l113.918539 0c15.954367 0 29.007661 13.053294 29.007661 29.007661L760.124635 833.494155z\"\r\n                                fill=\"#ffffff\" p-id=\"6829\"></path>\r\n                        </svg>\r\n                    </div>\r\n                    <!--\u5168\u5C4F-->\r\n                    <div id=\"fullScreenBtn\" class=\"fullScreenBtn\" [title]=\"isFullScreenBtn ? '\u9000\u51FA\u5168\u5C4F' : '\u5168\u5C4F'\">\r\n                        <svg *ngIf=\"!isFullScreenBtn\" t=\"1730875130357\" class=\"icon\" viewBox=\"0 0 1024 1024\"\r\n                            version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"8257\" width=\"20\" height=\"20\">\r\n                            <path\r\n                                d=\"M358.4 768H426.666667v85.333333H213.333333v-213.333333h85.333334v68.266667l128-128 59.733333 59.733333-128 128z m345.6 0l-128-128 59.733333-59.733333 132.266667 132.266666V640h85.333333v213.333333h-213.333333v-85.333333h64zM358.4 298.666667l128 128-59.733333 59.733333-128-128V426.666667H213.333333V213.333333h213.333334v85.333334H358.4z m345.6 0H640V213.333333h213.333333v213.333334h-85.333333V354.133333l-132.266667 132.266667-59.733333-59.733333 128-128z\"\r\n                                fill=\"#ffffff\" p-id=\"8258\"></path>\r\n                        </svg>\r\n                        <svg *ngIf=\"isFullScreenBtn\" t=\"1730875137734\" class=\"icon\" viewBox=\"0 0 1024 1024\"\r\n                            version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"8467\" width=\"20\" height=\"20\">\r\n                            <path\r\n                                d=\"M298.666667 631.466667H226.133333v-81.066667h217.6v204.8h-85.333333v-68.266667l-128 128L170.666667 759.466667l128-128z m422.4 0l128 128-59.733334 59.733333-128-128v68.266667h-85.333333V554.666667h217.6v81.066666h-72.533333zM298.666667 341.333333L187.733333 230.4 243.2 170.666667l115.2 115.2V217.6h85.333333v204.8H226.133333V341.333333H298.666667z m430.933333 0h64v81.066667h-217.6V217.6h85.333333v72.533333L780.8 170.666667l59.733333 59.733333L729.6 341.333333z\"\r\n                                fill=\"#ffffff\" p-id=\"8468\"></path>\r\n                        </svg>\r\n                    </div>\r\n                    <!--\u4FE1\u606F-->\r\n                    <span id=\"showLabel\" class=\"showLabel\"></span>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n\r\n</div>\r\n\r\n<div style=\"position: fixed;left: 0;top: 10000px;\">\r\n    <div id=\"resize-container\"></div>\r\n</div>\r\n\r\n<div *ngIf=\"!isH265\" class=\"video-hls-264\">\r\n    <div class=\"playError\" *ngIf=\"playError\">\r\n        <svg t=\"1724830569178\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"\r\n            p-id=\"10496\" width=\"64\" height=\"64\">\r\n            <path\r\n                d=\"M725.333333 469.333333c129.6 0 234.666667 105.066667 234.666667 234.666667s-105.066667 234.666667-234.666667 234.666667-234.666667-105.066667-234.666666-234.666667 105.066667-234.666667 234.666666-234.666667z m128-341.333333a128 128 0 0 1 128 128v294.101333a300.224 300.224 0 0 0-85.312-91.221333L896 426.666667h-59.605333c-34.346667-13.76-71.808-21.333333-111.061334-21.333334v-192H298.666667v597.333334h147.626666a298.453333 298.453333 0 0 0 50.282667 85.354666L170.666667 896a128 128 0 0 1-128-128V256a128 128 0 0 1 128-128h682.666666z m-119.466666 661.333333h-17.066667a21.333333 21.333333 0 0 0-21.333333 21.333334v17.066666a21.333333 21.333333 0 0 0 21.333333 21.333334h17.066667a21.333333 21.333333 0 0 0 21.333333-21.333334V810.666667a21.333333 21.333333 0 0 0-21.333333-21.333334zM213.333333 682.666667H128v85.333333a42.666667 42.666667 0 0 0 39.466667 42.56L170.666667 810.666667h42.666666v-128z m520.533334-128h-17.066667a21.333333 21.333333 0 0 0-21.184 18.837333L695.466667 576v149.333333a21.333333 21.333333 0 0 0 18.837333 21.184L716.8 746.666667h17.066667a21.333333 21.333333 0 0 0 21.184-18.837334L755.2 725.333333v-149.333333a21.333333 21.333333 0 0 0-21.333333-21.333333z m-266.026667-187.114667l2.773333 1.6 114.090667 71.296a298.965333 298.965333 0 0 0-154.432 217.002667 42.24 42.24 0 0 1-24.832-35.584L405.333333 618.666667V405.333333c0-32.426667 34.517333-52.608 62.506667-37.781333zM213.333333 426.666667H128v170.666666h85.333333v-170.666666z m0-213.333334H170.666667a42.666667 42.666667 0 0 0-42.56 39.466667L128 256v85.333333h85.333333v-128z m640 0h-42.666666v128h85.333333v-85.333333a42.666667 42.666667 0 0 0-39.466667-42.56L853.333333 213.333333z\"\r\n                fill=\"#cdcdcd\" p-id=\"10497\"></path>\r\n        </svg>\r\n        <div class=\"errorText\">\u64AD\u653E\u5931\u8D25</div>\r\n    </div>\r\n    <video class=\"video\" [ngStyle]=\"{'object-fit': 'contain' }\" crossOrigin=\"anonymous\" [controls]=\"controlsMode\"\r\n        [muted]=\"mutedMode\" [autoplay]=\"autoplayMode\" id=\"video\"></video>\r\n</div>", styles: [".video-hls-265{width:100%;height:100%;position:relative}.video-hls-265 .error-container{width:100%;height:100%;position:absolute;top:0px;left:0px;z-index:10000;background-color:#000;display:flex;align-items:center;justify-content:center;color:#fff}.video-hls-265 .error-container .error-text{display:flex;flex-direction:column;justify-content:center;align-items:center}.video-hls-265 .error-container .error-text .loading-spinner{width:40px;height:40px;border:4px solid #f3f3f3;border-top:4px solid #a7a7a7;border-radius:50%;margin:0 auto 10px;animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.video-hls-265 #coverLayer{width:100%;height:100%;z-index:10000;position:absolute;top:0px;left:0px;background-color:#00000080}.video-hls-265 #coverLayer #coverLayerBtn{cursor:pointer;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.video-hls-265 #player-container{position:absolute;margin:auto;left:0;right:0;overflow:hidden}.video-hls-265 #player-container .controller{background-color:#0009;width:960px;height:40px;position:absolute;z-index:99999;left:0;bottom:0}.video-hls-265 #player-container .controller .progress-common{border-radius:5px;border:none;margin-bottom:2px}.video-hls-265 #player-container .controller .progress-contaniner{z-index:1000;width:100%;background-color:#666;position:absolute;top:0;height:6px}.video-hls-265 #player-container .controller .progress-contaniner .cachePts{position:absolute;z-index:1001;width:0px;background-color:#d9d9d9}.video-hls-265 #player-container .controller .progress-contaniner .progressPts{position:absolute;z-index:1002;width:0px;height:100%;background-color:#f64f1e}.video-hls-265 #player-container .controller .operate-container{width:100%;height:100%;display:flex;align-items:center;justify-content:space-between}.video-hls-265 #player-container .controller .operate-container .left-container{display:flex;align-items:center}.video-hls-265 #player-container .controller .operate-container .left-container .ptsLabel{font-size:14px;color:#fff;margin-left:5px}.video-hls-265 #player-container .controller .operate-container .left-container .voice-div{color:#fff;margin-left:10px;display:flex;align-items:center}.video-hls-265 #player-container .controller .operate-container .left-container .voice-div .muteBtn{color:#fff;display:flex;align-items:center;opacity:.7}.video-hls-265 #player-container .controller .operate-container .left-container .voice-div .muteBtn:hover{opacity:1}.video-hls-265 #player-container .controller .operate-container .left-container .voice-div .progressVoice{width:100px;height:6px;cursor:pointer;border-radius:5px}.video-hls-265 #player-container .controller .operate-container .left-container .voice-div .progressVoice::-moz-progress-bar{background-color:#d9d9d9}.video-hls-265 #player-container .controller .operate-container .left-container .voice-div .progressVoice::-webkit-progress-value{background-color:#d9d9d9}.video-hls-265 #player-container .controller .operate-container .left-container .voice-div span{color:#fff;margin-right:5px}.video-hls-265 #player-container .controller .operate-container .right-container{display:flex;align-items:center}.video-hls-265 #player-container .controller .operate-container .right-container #playBtn{cursor:pointer;display:flex;align-items:center;justify-content:center;margin-right:5px;opacity:.7}.video-hls-265 #player-container .controller .operate-container .right-container #playBtn:hover{opacity:1}.video-hls-265 #player-container .controller .operate-container .right-container .fullScreenBtn{margin-right:5px;display:flex;align-items:center;cursor:pointer;opacity:.7}.video-hls-265 #player-container .controller .operate-container .right-container .fullScreenBtn:hover{opacity:1}.video-hls-265 #player-container .controller .operate-container .right-container .showLabel{height:18px;font-size:8px;color:#fff;border-bottom:1px solid #666666;padding-top:1px;padding-left:5px;padding-right:5px;margin-right:5px}.video-hls-264{width:100%;height:100%;position:relative}.video-hls-264 .playError{background-color:#000;width:100%;height:100%;position:absolute;left:0;top:0;display:flex;flex-direction:column;justify-content:center;align-items:center;z-index:2}.video-hls-264 .playError .errorText{color:#cdcdcd;font-size:16px;margin-top:10px;letter-spacing:1px}.video-hls-264 .video{width:100%;height:100%}\n"], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0, type: VideoHlsComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'nc-video-hls',
                    templateUrl: './video-hls.component.html',
                    styleUrls: ['./video-hls.component.less']
                }]
        }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: LocalService }]; }, propDecorators: { ncUrl: [{
                type: Input
            }], ncErrorTime: [{
                type: Input
            }], ncAutoplay: [{
                type: Input
            }], ncMuted: [{
                type: Input
            }], ncControls: [{
                type: Input
            }], ncResizeWay: [{
                type: Input
            }], ncPlaying: [{
                type: Output
            }], ncLoaded: [{
                type: Output
            }] } });

class NcVideoHlsModule {
}
NcVideoHlsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0, type: NcVideoHlsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
NcVideoHlsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0, type: NcVideoHlsModule, declarations: [VideoHlsComponent], imports: [CommonModule], exports: [VideoHlsComponent] });
NcVideoHlsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0, type: NcVideoHlsModule, imports: [[
            CommonModule
        ]] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0, type: NcVideoHlsModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [
                        VideoHlsComponent
                    ],
                    imports: [
                        CommonModule
                    ],
                    exports: [
                        VideoHlsComponent
                    ]
                }]
        }] });

/**
 * Generated bundle index. Do not edit.
 */

export { NcVideoHlsModule, VideoHlsComponent };
//# sourceMappingURL=ng-cw-v12-video-hls.js.map