Commit 0f61b62ff67f5ebc7ee6f5a45f56f2f49c17201e

Authored by fengtao
1 parent 1a4eb284

fix: 修复视频管理关闭时还有声音问题,和清除控制台报黄问题

... ... @@ -11,7 +11,7 @@
11 11 >
12 12 <div class="video-sty">
13 13 <div>
14   - <vue3videoPlay v-bind="options" :poster="videoPoster" />
  14 + <vue3videoPlay :src="videoUrl" ref="videoRef" v-bind="options" :poster="videoPoster" />
15 15 </div>
16 16 </div>
17 17 </BasicModal>
... ... @@ -32,11 +32,14 @@
32 32 emits: ['success', 'register'],
33 33 setup() {
34 34 let options: any = reactive({});
  35 + const videoRef: any = ref(null);
  36 + const videoUrl = ref<String>('');
35 37 const videoPoster = ref('');
36 38 const heightNum = ref(800);
37 39 const [register] = useModalInner(async (data) => {
38 40 if (data) {
39 41 if (data.record.videoUrl) {
  42 + videoUrl.value = data.record.videoUrl;
40 43 nextTick(() => {
41 44 /**
42 45 * options配置项(使用vue3-video-play插件)
... ... @@ -73,13 +76,18 @@
73 76 }
74 77 }
75 78 });
76   - const handleCancel = () => {};
  79 + const handleCancel = () => {
  80 + //关闭暂停播放视频
  81 + videoRef.value.pause();
  82 + };
77 83 return {
78 84 register,
79 85 handleCancel,
80 86 options,
81 87 heightNum,
82 88 videoPoster,
  89 + videoRef,
  90 + videoUrl,
83 91 };
84 92 },
85 93 });
... ...
... ... @@ -2,7 +2,6 @@
2 2 <div>
3 3 <BasicTable
4 4 :rowSelection="{ type: 'checkbox' }"
5   - @selection-change="useSelectionChange"
6 5 @register="registerTable"
7 6 :clickToRowSelect="false"
8 7 >
... ...