From c3aa826406d52957d6f98d0ecd4b77413d5ce908 Mon Sep 17 00:00:00 2001 From: inleft <inleft@qq.com> Date: Mon, 29 Aug 2022 18:23:08 +0800 Subject: [PATCH] 统计模块异步加载 --- src/components/mini/box15-videoPlayBox.vue | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/mini/box15-videoPlayBox.vue b/src/components/mini/box15-videoPlayBox.vue index 99132eb..8e56ba5 100644 --- a/src/components/mini/box15-videoPlayBox.vue +++ b/src/components/mini/box15-videoPlayBox.vue @@ -51,12 +51,14 @@ <script> import Hls from 'hls.js' import DPlayer from 'dplayer' + import myConstant from "../../config/myConstant.js" export default { data() { return { disabledPointer: false, dp: null, + hls: null, playHistory: [], playRecordIds: [], volumeInit: 0.1, @@ -65,13 +67,12 @@ currentTime: 0, duration: 0, playingVideoData: { - pic: "http://t.inleft.com/share/media_photo/idea_beijing.jpg", + pic: "", url: "", type: "normal", title: "", id: "" }, - hls: null, } }, mounted() { @@ -173,12 +174,16 @@ return } - if (videoData.url != null && videoData.urlL != "" && videoData.url.endsWith("m3u8")) { + if (videoData.url != null && videoData.url != "" && videoData.url.endsWith("m3u8")) { videoData.type = "customHls"; } else { videoData.type = "normal"; } + if (videoData.pic === null || videoData.pic == ''){ + videoData.pic = myConstant.defaultBGVideo; + } + //重要!!防止hls类型视频在切换后不停在后台缓存 if (this.hls != null) { this.hls.destroy(); -- Gitblit v1.9.1