2022-06-08 14:51:11 +08:00
|
|
|
|
<template>
|
2022-07-16 14:54:53 +08:00
|
|
|
|
<div id="playWnd"></div>
|
2022-06-08 14:51:11 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
<script>
|
2022-07-16 14:54:53 +08:00
|
|
|
|
let closeVideo=null
|
2022-06-08 14:51:11 +08:00
|
|
|
|
import {
|
|
|
|
|
|
OpenVideo,
|
|
|
|
|
|
unInitObjPlugin,
|
2022-07-16 14:54:53 +08:00
|
|
|
|
InitObjPlugin, hidePluginWindow, showPluginWindow, resizeFn, isLoadPlugin, setWidthAndHeight, setOffset
|
2022-06-08 14:51:11 +08:00
|
|
|
|
} from "./video_isc_plugin.js";
|
|
|
|
|
|
export default {
|
2022-07-16 14:54:53 +08:00
|
|
|
|
props: ["devList", "type", 'isIframe'],
|
|
|
|
|
|
watch: {
|
|
|
|
|
|
//监听value的变化,进行相应的操作即可
|
|
|
|
|
|
devList: function (a, b) {
|
|
|
|
|
|
console.log('isc_plugin.vue获取到设备列表')
|
|
|
|
|
|
//a是value的新值,b是旧值
|
|
|
|
|
|
if (a.length > 0) {
|
|
|
|
|
|
isLoadPlugin(a, this.layout)
|
|
|
|
|
|
} else {
|
|
|
|
|
|
// unInitObjPlugin()
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// a.forEach(element => {
|
|
|
|
|
|
// setTimeout(()=>{
|
|
|
|
|
|
// OpenVideo(element.serialNumber,1)
|
|
|
|
|
|
// },500)
|
|
|
|
|
|
|
|
|
|
|
|
// });
|
2022-06-08 14:51:11 +08:00
|
|
|
|
|
|
|
|
|
|
},
|
2022-07-16 14:54:53 +08:00
|
|
|
|
isExpand: {
|
|
|
|
|
|
immediate: true,
|
|
|
|
|
|
handler: function (newval) {
|
|
|
|
|
|
console.log('resizeFn')
|
|
|
|
|
|
resizeFn()
|
|
|
|
|
|
}
|
2022-06-08 14:51:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
2022-07-16 14:54:53 +08:00
|
|
|
|
},
|
|
|
|
|
|
computed: {
|
|
|
|
|
|
isExpand() {
|
|
|
|
|
|
return this.$store.state.isExpand;
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
layout: ''
|
2022-06-08 14:51:11 +08:00
|
|
|
|
}
|
2022-07-16 14:54:53 +08:00
|
|
|
|
},
|
|
|
|
|
|
created() {
|
|
|
|
|
|
if (COMPANY == 'xingxuan') { setWidthAndHeight(633, 381); }
|
|
|
|
|
|
|
|
|
|
|
|
this.$EventBus.$on("controlVideoShowOrHide", (data) => {
|
|
|
|
|
|
console.log('controlVideoShowOrHide', data)
|
|
|
|
|
|
if (data == 'hide') {
|
|
|
|
|
|
hidePluginWindow()
|
|
|
|
|
|
} else {
|
|
|
|
|
|
showPluginWindow()
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
mounted() {
|
|
|
|
|
|
// if (COMPANY == 'xingxuan') {
|
|
|
|
|
|
// closeVideo= setInterval(()=>{
|
|
|
|
|
|
// window.onhashchange = function () {
|
|
|
|
|
|
// hidePluginWindow();
|
|
|
|
|
|
// clearTimeout(closeVideo);
|
|
|
|
|
|
// };
|
|
|
|
|
|
// },1000)
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
var layout = '2x2'
|
|
|
|
|
|
if (this.type == 'company') {
|
|
|
|
|
|
// layout='6x10'
|
|
|
|
|
|
layout = '4x6'
|
|
|
|
|
|
}
|
|
|
|
|
|
if (this.type.indexOf('x') != -1) {
|
|
|
|
|
|
layout = this.type
|
|
|
|
|
|
}
|
|
|
|
|
|
this.layout = layout
|
|
|
|
|
|
console.log('加载isc_plugin.vue')
|
|
|
|
|
|
// console.log(this.type)
|
|
|
|
|
|
// console.log('layout',layout)
|
|
|
|
|
|
// InitObjPlugin(
|
|
|
|
|
|
// this.devList[0].appId,
|
|
|
|
|
|
// this.devList[0].appSecret,
|
|
|
|
|
|
// this.devList[0].account,
|
|
|
|
|
|
// this.devList[0].password,
|
|
|
|
|
|
// false,
|
|
|
|
|
|
// this.devList,layout
|
|
|
|
|
|
// );
|
|
|
|
|
|
if (this.devList.length > 0) {
|
|
|
|
|
|
isLoadPlugin(this.devList, this.layout)
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
beforeDestroy() {
|
|
|
|
|
|
//反初始化
|
|
|
|
|
|
unInitObjPlugin();
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2022-06-08 14:51:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
2022-07-16 14:54:53 +08:00
|
|
|
|
#playWnd {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 100%;
|
2022-06-08 14:51:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
</style>
|