安琪酵母(西藏)益生菌信息采集中心智能实验室
longyvfengyun
2023-08-24 fe936486ee0023e4be8d17625471aad6e8e284ff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<script setup>
import {computed, onMounted, onUnmounted, ref, watch} from "vue";
import hkModule from "@/views/video/components/js/hkVideo/hkModule";
import FlexLayout from "@/components/FlexLayout.vue";
const props = defineProps({
    companyVideoData: {
        type: Object,
        default() {
            return [];
        },
    },
});
 
// 海康威视模块
const {
    divPlugin, iWndowType, gIWndIndex,
    videoInitPlugin, clickLogin
} = hkModule();
 
const clickLogins = ()=>{
    for(let i=0; i<props.companyVideoData.length; i++) {
        let item = props.companyVideoData[i];
        setTimeout(()=>{
            clickLogin(item, i);
        }, 1000);
    }
}
 
onMounted(()=>{
    videoInitPlugin(()=>{
        clickLogins();
    });
});
 
onUnmounted(()=>{
    for(let i=0; i<props.companyVideoData.length; i++) {
        let item = props.companyVideoData[i];
        WebVideoCtrl.I_Logout(item.ip);
    }
    WebVideoCtrl.I_GetPluginOBJECT().JS_DestroyPlugin();
});
</script>
 
<template>
        <div class="video-player">
            <div id="divPlugin" class="divPlugin" ref="divPlugin"></div>
        </div>
</template>
 
<style scoped>
.video-player {
    position: relative;
    width: 100%;
    height: 100%;
}
.divPlugin {
    width: 100%;
    height: 100%;
}
.hk-tools-wrapper {
    position: absolute;
    width: 300px;
    right: 0;
    top: 0;
    bottom: 0;
    background-color: #ffffff;
    z-index: 99;
}
</style>