zhanghua
2022-12-13 cf9468626781bbb55ffd355d9c56c9111ae07062
优化
2个文件已修改
69 ■■■■ 已修改文件
src/views/systemSetting/device/point/index.vue 68 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/video/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/systemSetting/device/point/index.vue
@@ -80,7 +80,7 @@
      videoData: [],
      searchData: null,
      hls: null,
      videoList:[]
      videoList: [],
    };
  },
  methods: {
@@ -104,29 +104,33 @@
        .catch((err) => this.$message.error(err));
    },
    loadVideo(item) {
      if (Hls.isSupported()) {
        var video = document.getElementById(item.id);
        var hls = new Hls();
        videoPoint.getVideoPointUrl(item.platResourceId).then((res) => {
          if (res.code === 0) {
            hls.loadSource(res.data);
            hls.attachMedia(video);
            this.videoList.push(video);
            // hls.on(Hls.Events.MANIFEST_PARSED, function () {
            //   // video.play();
            //   document.body.addEventListener(
            //     "click",
            //     function () {
            //       video.play();
            //     },
            //     false
            //   );
            // });
            setTimeout(() => {
              video.play();
            }, 2000);
          }
        });
      if (item.platResourceId) {
        if (Hls.isSupported()) {
          var video = document.getElementById(item.id);
          var hls = new Hls();
          videoPoint.getVideoPointUrl(item.platResourceId).then((res) => {
            if (res.code === 0) {
              hls.loadSource(res.data);
              hls.attachMedia(video);
              this.videoList.push(video);
              // hls.on(Hls.Events.MANIFEST_PARSED, function () {
              //   // video.play();
              //   document.body.addEventListener(
              //     "click",
              //     function () {
              //       video.play();
              //     },
              //     false
              //   );
              // });
              setTimeout(() => {
                video.play();
              }, 2000);
            }
          });
        }
      } else {
        this.$message.error("暂无视频");
      }
    },
    selectedDepartment(data) {
@@ -141,9 +145,9 @@
      this.getVideoPointList(this.searchData);
    },
  },
  beforeDestroy(){
    videoList.forEach(element => {
      element.push()
  beforeDestroy() {
    videoList.forEach((element) => {
      element.push();
    });
  },
};
@@ -285,22 +289,22 @@
}
video::-webkit-media-controls-timeline {
    display: none;
  display: none;
}
video::-webkit-media-controls-current-time-display {
    display: none;
  display: none;
}
video::-webkit-media-controls-time-remaining-display {
    display: none;
  display: none;
}
video::-webkit-media-controls-mute-button {
    display: none;
  display: none;
}
video::-webkit-media-controls-toggle-closed-captions-button {
    display: none;
  display: none;
}
</style>
src/views/video/index.vue
@@ -70,7 +70,6 @@
      <el-dialog
        :visible.sync="dialogCreate"
        title="查看视频"
        width="80%"
        v-show="dialogCreate"
        :before-close="handleClose2"
      >