diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/Video/Video.vue b/ruoyi-ui/src/views/JiHeExpressway/components/Video/Video.vue index 18782370..801faa20 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/components/Video/Video.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/components/Video/Video.vue @@ -22,8 +22,8 @@ export default { } }, async mounted() { - const player = await openLiveVideo(this.$refs.videoContainerRef, { camId: this.camId, url: this.url, pileNum: this.pileNum }) - // const player = new HttpLivePlayer(this.$refs.videoContainerRef, { camId: this.camId, url: this.url, pileNum: this.pileNum }); + // const player = await openLiveVideo(this.$refs.videoContainerRef, { camId: this.camId, url: this.url, pileNum: this.pileNum }) + const player = new HttpLivePlayer(this.$refs.videoContainerRef, { camId: this.camId, url: this.url, pileNum: this.pileNum }); this.$once("hook:beforeDestroy", () => player?.destroy()); } diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/Video/videoStream.js b/ruoyi-ui/src/views/JiHeExpressway/components/Video/videoStream.js index b2946f6d..d9d5f2cb 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/components/Video/videoStream.js +++ b/ruoyi-ui/src/views/JiHeExpressway/components/Video/videoStream.js @@ -107,8 +107,6 @@ export class HttpLivePlayer { if (!flvJs.getFeatureList().mseLiveFlvPlayback) return Message.error("浏览器不支持播放 flv 视频流"); - this.initLiveVideo(); - getUrl(options).then((url) => { this.url = url; this.initLiveVideo(); @@ -140,7 +138,7 @@ export class HttpLivePlayer { }, { autoCleanupSourceBuffer: true, - enableWorker: true, // 启用分离的线程进行转换 + // enableWorker: true, // 启用分离的线程进行转换 enableStashBuffer: false, // 关闭IO隐藏缓冲区 如果您需要实时(最小延迟)来进行实时流播放,则设置为false stashInitialSize: 128, isLive: true, @@ -153,23 +151,23 @@ export class HttpLivePlayer { this.player.load(); this.player.play(); - this.container.addEventListener("progress", () => { - let end = player.buffered.end(0); //获取当前buffered值(缓冲区末尾) - let delta = end - player.currentTime; //获取buffered与当前播放位置的差值 + // this.container.addEventListener("progress", () => { + // let end = this.player.buffered.end(0); //获取当前buffered值(缓冲区末尾) + // let delta = end - this.player.currentTime; //获取buffered与当前播放位置的差值 - // 延迟过大,通过跳帧的方式更新视频 - if (delta > 10 || delta < 0) { - this.player.currentTime = this.player.buffered.end(0) - 1; - return; - } + // // 延迟过大,通过跳帧的方式更新视频 + // if (delta > 10 || delta < 0) { + // this.player.currentTime = this.player.buffered.end(0) - 1; + // return; + // } - // 追帧 - if (delta > 1) { - this.container.playbackRate = 1.1; - } else { - this.container.playbackRate = 1; - } - }); + // // 追帧 + // if (delta > 1) { + // this.container.playbackRate = 1.1; + // } else { + // this.container.playbackRate = 1; + // } + // }); this.player.on(flvJs.Events.ERROR, (errorType, errorDetail, errorInfo) => { console.log("errorType", errorType); @@ -222,8 +220,8 @@ export async function openLiveVideo(container, options) { { autoCleanupSourceBuffer: true, enableWorker: true, // 启用分离的线程进行转换 - enableStashBuffer: false, // 关闭IO隐藏缓冲区 如果您需要实时(最小延迟)来进行实时流播放,则设置为false - stashInitialSize: 128, + // enableStashBuffer: false, // 关闭IO隐藏缓冲区 如果您需要实时(最小延迟)来进行实时流播放,则设置为false + // stashInitialSize: 128, isLive: true, lazyLoad: true, } diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/index.vue index 9c22faad..da0e1d12 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/index.vue @@ -15,7 +15,8 @@ - + +