Tang 2 жил өмнө
parent
commit
bf9fd9c218

+ 7 - 3
src/components/videoCy/index.vue

@@ -5,7 +5,7 @@
       backgroundImage: `url(${$tools.splitImgHost(goodsData.coverUrl, false)})`
     }"
   >
-    <div id="player"></div>
+    <div id="player" v-show="!HideVideo"></div>
     <div class="recordStyle" v-if="showRecordStatus">
       您上次看{{
         $tools.secondToTime(this.activeSection.videoCurrentTime || 0)
@@ -39,6 +39,7 @@ export default {
     return {
       vodPlayerJs: "https://player.polyv.net/script/player.js",
       player: null,
+      HideVideo: false, //是否隐藏播放器
       photoList: [], //抓拍时间拍照数组
       photoHistoryList: [], //历史和已拍照数据
       photoIndex: 0, //当前拍照对应索引
@@ -93,7 +94,7 @@ export default {
         this.player.on("serverError", this.serverError); //发生业务逻辑错误时触发,比如授权验证失败、域名黑白名单验证不通过等错误。参数返回事件名称和错误代码。
       }); //播放器初始化完毕时触发。播放器提供的方法需要在此事件发生后才可以调用。
     });
-    document.addEventListener("visibilitychange", this.pauseVideo);
+    // document.addEventListener("visibilitychange", this.pauseVideo);
   },
   methods: {
     getBeforeWork() {},
@@ -326,6 +327,7 @@ export default {
               wrap: "#player",
               width: 810,
               height: 455,
+              preventKeyboardEvent: true, //是否屏蔽键盘事件,为true时屏蔽。
               showLine: true, //是否显示线路选择按钮
               ban_history_time: "on", //是否禁用续播功能,取值:{on,off}。
               vid: self.activeSection.recordingUrl,
@@ -502,9 +504,11 @@ export default {
         this.exitFullscreen();
       }
       this.$refs.takePicture.openPhoto();
+      this.HideVideo = true;
     },
     //拍照成功回显 url
     async returnParameter(url) {
+      this.HideVideo = false;
       let compareFaceData = await this.faceRecognition(url);
       if (compareFaceData >= 80) {
         let file = this.$tools.convertBase64UrlToBlob(url);
@@ -686,7 +690,7 @@ export default {
   beforeDestroy() {
     this.$bus.$off("toPlay");
     clearTimeout(this.videoPauseSetTimeout); //删除暂停计算拍照定时器
-    document.removeEventListener("visibilitychange", this.pauseVideo);
+    // document.removeEventListener("visibilitychange", this.pauseVideo);
     this.player && this.player.destroy(); //初始化播放器
     this.player &&
       this.player.HTML5.video.removeEventListener("timeupdate", this.timeEvent); //监听器