Commit bbe8167d56ed540d409db7bce80ebadc411ba83f

Authored by loveumiko
1 parent 7b3faf2d

feat: 增加GBT 28181协议的新功能

... ... @@ -77,7 +77,9 @@
77 77 </BasicTable>
78 78 </PageWrapper>
79 79 <CameraDrawer @register="registerDrawer" @success="handleSuccess" />
80   - <VideoPreviewModal @register="registerModal" />
  80 + <!-- <VideoPreviewModal @register="registerModal" /> -->
  81 +
  82 + <VideoModal @register="registerModal" />
81 83 </div>
82 84 </template>
83 85
... ... @@ -90,12 +92,13 @@
90 92 import { useResetOrganizationTree, OrganizationIdTree } from '/@/views/common/organizationIdTree';
91 93 import { cameraPage, deleteCameraManage } from '/@/api/camera/cameraManager';
92 94 import { searchFormSchema, columns, AccessMode, PageMode, CameraPermission } from './config.data';
93   - import VideoPreviewModal from './DialogPreviewVideo.vue';
  95 + // import VideoPreviewModal from './DialogPreviewVideo.vue';
94 96 import { useModal } from '/@/components/Modal';
95 97 import { Authority } from '/@/components/Authority';
96 98 import { useBatchDelete } from '/@/hooks/web/useBatchDelete';
97 99 import { Popconfirm } from 'ant-design-vue';
98 100 import { Tag } from 'ant-design-vue';
  101 + import VideoModal from '/@/views/device/list/cpns/tabs/VideoChannel/videoModal.vue';
99 102
100 103 export default defineComponent({
101 104 components: {
... ... @@ -104,7 +107,8 @@
104 107 BasicTable,
105 108 TableAction,
106 109 CameraDrawer,
107   - VideoPreviewModal,
  110 + // VideoPreviewModal,
  111 + VideoModal,
108 112 TableImg,
109 113 Authority,
110 114 Popconfirm,
... ...
... ... @@ -13,10 +13,11 @@
13 13 PauseOutlined,
14 14 CaretDownOutlined,
15 15 CaretLeftOutlined,
16   - PlusOutlined,
17   - MinusOutlined,
  16 + ZoomInOutlined,
  17 + ZoomOutOutlined,
18 18 } from '@ant-design/icons-vue';
19 19 import { Button } from 'ant-design-vue';
  20 + import { nextTick } from 'vue';
20 21 const { prefixCls } = useDesign('basic-video-play');
21 22
22 23 const props = defineProps<{
... ... @@ -31,8 +32,6 @@
31 32
32 33 const videoPlayEl = ref<HTMLVideoElement>();
33 34
34   - const isPlay = ref<Boolean>(true); //是否是播放状态
35   -
36 35 const videoPlayInstance = ref<Nullable<VideoJsPlayer>>();
37 36
38 37 const getOptions = computed(() => {
... ... @@ -82,19 +81,29 @@
82 81
83 82 //type 1:上 2:右 3:下 4:左 5:暂停
84 83 const handleClick = (type: number) => {
85   - console.log(type, 'type');
86 84 if (type == 5) {
87   - isPlay.value = !unref(isPlay);
  85 + // if (unref(isPlay)) {
  86 + // unref(videoPlayInstance)?.play();
  87 + // } else {
  88 + // unref(videoPlayInstance)?.pause();
  89 + // }
  90 + isPlay.value = !isPlay.value;
88 91 }
89 92 };
90 93
91 94 // type 1:放大 2:缩小
92 95 const handleScale = (type: number) => {
93   - console.log(type, 'type');
  96 + if (type == 1) {
  97 + } else {
  98 + }
94 99 };
95 100
96   - onMounted(() => {
  101 + const isPlay = ref<Boolean | null | undefined>(true);
  102 +
  103 + onMounted(async () => {
97 104 init();
  105 + await nextTick();
  106 + isPlay.value = unref(videoPlayInstance)?.paused();
98 107 });
99 108
100 109 onUnmounted(() => {
... ... @@ -127,7 +136,9 @@
127 136 <CaretLeftOutlined class="front-sty-left child-icon" @click="handleClick(3)" />
128 137
129 138 <Button class="front-sty-center child center" shape="circle" @click="handleClick(5)">
130   - <PauseOutlined v-if="isPlay" class="child-icon" style="color: #fffbfb" />
  139 + <!-- 暂停 -->
  140 + <PauseOutlined v-if="!isPlay" class="child-icon" style="color: #fffbfb" />
  141 + <!-- 播放 -->
131 142 <CaretRightOutlined v-else class="child-icon" style="color: #fffbfb" />
132 143 </Button>
133 144
... ... @@ -154,10 +165,10 @@
154 165 </div>
155 166 <div class="flex justify-center mt-8">
156 167 <Button shape="circle" class="button-icon" @click="handleScale(1)">
157   - <PlusOutlined style="color: #315a9c; font-size: 1.5rem" />
  168 + <ZoomInOutlined style="color: #315a9c; font-size: 1.5rem" />
158 169 </Button>
159 170 <Button shape="circle" class="ml-10 button-icon" @click="handleScale(2)">
160   - <MinusOutlined style="color: #315a9c; font-size: 1.5rem" />
  171 + <ZoomOutOutlined style="color: #315a9c; font-size: 1.5rem" />
161 172 </Button>
162 173 </div>
163 174 </div>
... ...