From 0fd73b26d4e3c5d2dc153429ef82bf2fd8f77168 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期四, 12 十二月 2024 19:49:30 +0800
Subject: [PATCH] ll
---
/dev/null | 148 --------------
h5/pages/staff/task/index.vue | 16 +
h5/utils/config.js | 4
h5/pages/login/login.vue | 4
h5/pages/staff/vehicle/sendACar.vue | 4
screen/src/assets/images/SecurityControl/ic_unable@2x.png | 0
screen/src/views/videoUrl/Video.vue | 229 ++++++++++++++++++++++
screen/src/views/SecurityControl.vue | 179 +----------------
8 files changed, 259 insertions(+), 325 deletions(-)
diff --git a/h5/pages/login/login.vue b/h5/pages/login/login.vue
index f4d558d..9ab5fd0 100644
--- a/h5/pages/login/login.vue
+++ b/h5/pages/login/login.vue
@@ -41,7 +41,7 @@
export default {
data() {
return {
- code: '111'
+ code: ''
}
},
onLoad(option) {
@@ -59,7 +59,7 @@
let code = ''
if (window.location.href.indexOf('code=') !== -1 || this.code) {
const ywinfo = uni.getStorageSync('ywinfo') || {}
- if(ywinfo.ywid){
+ if(ywinfo.ywid && (ywinfo.type || ywinfo.type == 0)){
this.userAuth(ywinfo.type)
}
} else {
diff --git a/h5/pages/staff/task/index.vue b/h5/pages/staff/task/index.vue
index 00a8fb0..ba83dc6 100644
--- a/h5/pages/staff/task/index.vue
+++ b/h5/pages/staff/task/index.vue
@@ -293,6 +293,9 @@
},
modalReset() {
this.modelParam = {}
+ this.search = {
+ queryType: 0
+ }
this.pagination.page = 0
this.dataList = []
this.showFilter = false
@@ -319,13 +322,16 @@
...search
}
}).then(res => {
+ if(res.data && res.data.records){
+ res.data.records.forEach(i => {
+ if (i.param1) {
+ i.param1 = JSON.parse(i.param1)
+ }
+ })
+ }
this.dataList = [...this.dataList, ...res.data.records]
this.total = res.data.total
- this.dataList.forEach(i => {
- if (i.param1) {
- i.param1 = JSON.parse(i.param1)
- }
- })
+
})
},
getHeadList() {
diff --git a/h5/pages/staff/vehicle/sendACar.vue b/h5/pages/staff/vehicle/sendACar.vue
index 53e9809..1b28f44 100644
--- a/h5/pages/staff/vehicle/sendACar.vue
+++ b/h5/pages/staff/vehicle/sendACar.vue
@@ -123,6 +123,10 @@
param.queryStartTime = param.queryDate + ' 00:00:00'
param.queryEndTime = param.queryDate + ' 23:59:59'
}
+ if(param.carCode == '鍏ㄩ儴杞﹁締'){
+ param.carCode = null
+ param.carId = null
+ }
carUseBookPaiche({
...pagination,
model: { ...param }
diff --git a/h5/utils/config.js b/h5/utils/config.js
index 08884a3..05ff784 100644
--- a/h5/utils/config.js
+++ b/h5/utils/config.js
@@ -1,8 +1,8 @@
-export const baseUrl = 'zhyq_interface/'
+// export const baseUrl = 'zhyq_interface/'
// export const baseUrl = 'http://192.168.0.173/gateway_interface/'
// export const baseUrl = 'http://10.50.250.253:8088/gateway_interface/'
-// export const baseUrl = 'https://atwl.ahzyssl.com/zhyq_interface/'
+export const baseUrl = 'https://atwl.ahzyssl.com/zhyq_interface/'
export const app_url = 'https://atwl.ahzyssl.com/zhyq_h5/#/'
diff --git a/screen/src/assets/images/SecurityControl/ic_unable@2x.png b/screen/src/assets/images/SecurityControl/ic_unable@2x.png
new file mode 100644
index 0000000..e7b56dc
--- /dev/null
+++ b/screen/src/assets/images/SecurityControl/ic_unable@2x.png
Binary files differ
diff --git a/screen/src/views/SecurityControl.vue b/screen/src/views/SecurityControl.vue
index 0703983..1496439 100644
--- a/screen/src/views/SecurityControl.vue
+++ b/screen/src/views/SecurityControl.vue
@@ -111,7 +111,8 @@
<div v-show="showJk" class="jiankong">
<img class="jk_bg" src="@/assets/images/SecurityControl/jiankong_bg@2x.png" alt="">
<div class="content">
- <div class="player_bg" style="width: 100%;height: 100%;" id="playWnd"> </div>
+ <Video v-if="showJk && activeMenu && activeMenu.indexCode" :href="data.videoPluginUrl" :indexCode="activeMenu.indexCode" />
+ <!-- <div class="player_bg" style="width: 100%;height: 100%;" id="playWnd"> </div> -->
</div>
<div class="right_wrap">
<div class="menus">
@@ -384,7 +385,7 @@
</div>
<img src="@/assets/images/task/title@2x.png" class="bg" alt="" />
</div>
- <div class="monitoring" @click="showJk = !showJk">
+ <div class="monitoring" @click="changeMon">
<img src="@/assets/images/SecurityControl/ic_jiankong@2x.png" class="icon" alt="">
<div>鐩戞帶鍒楄〃</div>
<img v-if="showJk" src="@/assets/images/SecurityControl/jiankong_ic_close@2x.png" class="top" alt="">
@@ -485,6 +486,7 @@
import * as echarts from 'echarts'
import 'swiper/css/swiper.min.css'
import Swiper from 'swiper'
+import Video from './videoUrl/Video.vue'
import {
getEnergyCenterData,
afgetCarmeraPreviemUrl,
@@ -507,145 +509,6 @@
time.value = dayjs().format('HH:mm:ss')
}, 1000)
-
-
-const oWebControl = ref(null)
-const initCount = ref()
-const pubKey = ref('')
-const initPlugin = () => {
- oWebControl.value = new WebControl({
- szPluginContainer: "playWnd", // 鎸囧畾瀹瑰櫒id
- iServicePortStart: 15900, // 鎸囧畾璧锋绔彛鍙凤紝寤鸿浣跨敤璇ュ��
- iServicePortEnd: 15900,
- szClassId: "23BF3B0A-2C56-4D97-9C03-0CB103AA8F11", // 鐢ㄤ簬IE10浣跨敤ActiveX鐨刢lsid
- cbConnectSuccess: function () {
- // 鍒涘缓WebControl瀹炰緥鎴愬姛
- console.log('鍒涘缓WebControl瀹炰緥鎴愬姛');
-
- oWebControl.value.JS_StartService("window", { // WebControl瀹炰緥鍒涘缓鎴愬姛鍚庨渶瑕佸惎鍔ㄦ湇鍔�
- dllPath: "./VideoPluginConnect.dll" // 鍊�"./VideoPluginConnect.dll"鍐欐
- }).then(function () {
- oWebControl.value.JS_SetWindowControlCallback({ // 璁剧疆娑堟伅鍥炶皟
- cbIntegrationCallBack: cbIntegrationCallBack
- })// 鍚姩鎻掍欢鏈嶅姟鎴愬姛
- oWebControl.value.JS_CreateWnd("playWnd", '300', '200').then(function () { //JS_CreateWnd鍒涘缓瑙嗛鎾斁绐楀彛锛屽楂樺彲璁惧畾锛宐oxWidth, boxHeight瀹瑰櫒
- // oWebControl.value.JS_CreateWnd("playWnd").then(function () { //JS_CreateWnd鍒涘缓瑙嗛鎾斁绐楀彛锛屽楂樺彲璁惧畾锛宐oxWidth, boxHeight瀹瑰櫒
- init() // 鍒涘缓鎾斁瀹炰緥鎴愬姛鍚庡垵濮嬪寲
- })
- }, function () { // 鍚姩鎻掍欢鏈嶅姟澶辫触
- })
- },
- cbConnectError: function () { // 鍒涘缓WebControl瀹炰緥澶辫触
- console.log('鍒涘缓WebControl瀹炰緥澶辫触');
- oWebControl.value = null
- $("#playWnd").html("鎻掍欢鏈惎鍔紝姝e湪灏濊瘯鍚姩锛岃绋嶅��...")
- WebControl.JS_WakeUp("VideoWebPlugin://") // 绋嬪簭鏈惎鍔ㄦ椂鎵цerror鍑芥暟锛岄噰鐢╳akeup鏉ュ惎鍔ㄧ▼搴�
- initCount.value++
- if (initCount.value < 3) {
- setTimeout(function () {
- initPlugin()
- }, 3000)
- } else {
- $("#playWnd").html("鎻掍欢鍚姩澶辫触锛岃妫�鏌ユ彃浠舵槸鍚﹀畨瑁咃紒鎴栭噸鏂颁笅杞� <a href='./videoUrl/VideoWebPlugin.exe' target='_blank'>涓嬭浇a<a>")
- }
- },
- cbConnectClose: function (bNormalClose) {
- // 寮傚父鏂紑锛歜NormalClose = false
- // JS_Disconnect姝e父鏂紑锛歜NormalClose = true
- console.log('寮傚父鏂紑锛歜NormalClose');
- oWebControl.value = null
- $("#playWnd").html("鎻掍欢鏈惎鍔紝姝e湪灏濊瘯鍚姩锛岃绋嶅��...")
- WebControl.JS_WakeUp("VideoWebPlugin://")
- initCount.value++
- if (initCount.value < 3) {
- setTimeout(function () {
- initPlugin()
- }, 3000)
- } else {
- $("#playWnd").html("鎻掍欢鍚姩澶辫触锛岃妫�鏌ユ彃浠舵槸鍚﹀畨瑁咃紒鎴栭噸鏂颁笅杞� <a href='https://img0.baidu.com/it/u=3867022436,608124672&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1422' target='_blank'>涓嬭浇b<a>")
- }
- }
- })
-}
-function fileDown() {
- window.open('./videoUrl/VideoWebPlugin.exe')
-}
-// 娑堟伅鍥炶皟
-const cbIntegrationCallBack = (oData) => {
- let response = oData.responseMsg
- // response.type=1 閫変腑绐楀彛娑堟伅 type=2 鎾斁娑堟伅
-}
-// 鐩戞帶
-
-
-
-
-// 鍒濆鍖�
-const init = () => {
- getPubKey(function () {
- ////////////////////////////////// 璇疯嚜琛屼慨鏀逛互涓嬪彉閲忓�� ////////////////////////////////////
- let appkey = "23154099" //缁煎悎瀹夐槻绠$悊骞冲彴鎻愪緵鐨刟ppkey锛屽繀濉�
- let secret = '88wFsg3xfn7o8QMsWEO2' //缁煎悎瀹夐槻绠$悊骞冲彴鎻愪緵鐨剆ecret锛屽繀濉�
- // let secret = setEncrypt("88wFsg3xfn7o8QMsWEO2") //缁煎悎瀹夐槻绠$悊骞冲彴鎻愪緵鐨剆ecret锛屽繀濉�
- let ip = "10.50.250.253" //缁煎悎瀹夐槻绠$悊骞冲彴IP鍦板潃锛屽繀濉�
- let playMode = 0 //鍒濆鎾斁妯″紡锛�0-棰勮(瀹炴椂娴�)锛�1-鍥炴斁(瑙嗛)
- let port = 443 //缁煎悎瀹夐槻绠$悊骞冲彴绔彛锛岃嫢鍚敤HTTPS鍗忚锛岄粯璁�443
- let snapDir = "D:\\SnapDir" //鎶撳浘瀛樺偍璺緞
- let videoDir = "D:\\VideoDir" //绱ф�ュ綍鍍忔垨褰曞儚鍓緫瀛樺偍璺緞
- let layout = "1x1" //playMode鎸囧畾妯″紡鐨勫竷灞�
- let enableHTTPS = 1 //鏄惁鍚敤HTTPS鍗忚涓庣患鍚堝畨闃茬鐞嗗钩鍙颁氦浜掞紝杩欓噷鎬绘槸濉�1
- let encryptedFields = 'secret' //鍔犲瘑瀛楁锛岄粯璁ゅ姞瀵嗛鍩熶负secret
- let showToolbar = 1 //鏄惁鏄剧ず宸ュ叿鏍忥紝0-涓嶆樉绀猴紝闈�0-鏄剧ず
- let showSmart = 1 //鏄惁鏄剧ず鏅鸿兘淇℃伅锛堝閰嶇疆绉诲姩渚︽祴鍚庣敾闈笂鐨勭嚎妗嗭級锛�0-涓嶆樉绀猴紝闈�0-鏄剧ず
- let buttonIDs = "0,16,256,257,258,259,260,513,514,515,516,517,768" //鑷畾涔夊伐鍏锋潯鎸夐挳
- oWebControl.value.JS_RequestInterface({
- funcName: "init",
- argument: JSON.stringify({
- appkey: appkey, //API缃戝叧鎻愪緵鐨刟ppkey
- secret: secret, //API缃戝叧鎻愪緵鐨剆ecret
- ip: ip, //API缃戝叧IP鍦板潃
- playMode: playMode, //鎾斁妯″紡锛堝喅瀹氭樉绀洪瑙堣繕鏄洖鏀剧晫闈級
- port: port, //绔彛
- snapDir: snapDir, //鎶撳浘瀛樺偍璺緞
- videoDir: videoDir, //绱ф�ュ綍鍍忔垨褰曞儚鍓緫瀛樺偍璺緞
- layout: layout, //甯冨眬
- enableHTTPS: enableHTTPS, //鏄惁鍚敤HTTPS鍗忚
- encryptedFields: encryptedFields, //鍔犲瘑瀛楁
- showToolbar: showToolbar, //鏄惁鏄剧ず宸ュ叿鏍�
- showSmart: showSmart, //鏄惁鏄剧ず鏅鸿兘淇℃伅
- buttonIDs: buttonIDs //鑷畾涔夊伐鍏锋潯鎸夐挳
- })
- }).then(function (oData) {
- console.log('鍒濆鍖栨垚鍔�');
-
- // oWebControl.value.JS_Resize(that.boxWidth, that.boxHeight) // 鍒濆鍖栧悗resize涓�娆★紝瑙勯伩firefox涓嬮娆℃樉绀虹獥鍙e悗鎻掍欢绐楀彛鏈笌DIV绐楀彛閲嶅悎闂
- })
- })
-}
-
-// 鑾峰彇鍏挜
-function getPubKey(callback) {
- oWebControl.value.JS_RequestInterface({
- funcName: 'getRSAPubKey',
- argument: JSON.stringify({
- keyLength: 1024,
- }),
- }).then((oData) => {
- if (oData.responseMsg.data) {
- pubKey.value = oData.responseMsg.data
- callback()
- }
- })
-}
-
-// RSA鍔犲瘑
-function setEncrypt(value) {
- let that = this
- let encrypt = new JSEncrypt()
- encrypt.setPublicKey(pubKey.value)
- return encrypt.encrypt(value)
-}
-
const arr = ['#68e2e3', '#50afd3', '#377cdb', '#d5ae3a']
const initEnergy = () => {
@@ -1045,6 +908,13 @@
data5.value = result.filter(item => item.carmeraList && item.carmeraList.length > 0)
})
}
+const changeMon = () => {
+ showJk.value = !showJk.value
+ if(!showJk.value){
+ activeJkIndex.value = -1
+ activeMenu.value = {}
+ }
+}
const menuClick = (val) => {
if (val == activeJkIndex.value) {
activeJkIndex.value = -1
@@ -1053,35 +923,9 @@
}
}
const menuItemClick = (val) => {
- initPlugin()
activeMenu.value = val
- nextTick(() => {
- console.log('indexCode', val.indexCode);
-
- oWebControl.value.JS_RequestInterface({
- funcName: "startPreview",
- argument: JSON.stringify({
- cameraIndexCode: val.indexCode, //鐩戞帶鐐圭紪鍙�
- streamMode: 0, //涓诲瓙鐮佹祦鏍囪瘑锛�0-涓荤爜娴侊紝1-瀛愮爜娴�
- transMode: 1, //浼犺緭鍗忚锛�0-UDP锛�1-TCP
- gpuMode: 0, //鏄惁鍚敤GPU纭В锛�0-涓嶅惎鐢紝1-鍚敤
- wndId: -1 //鎾斁绐楀彛搴忓彿锛堝湪2x2浠ヤ笂甯冨眬涓嬪彲鎸囧畾鎾斁绐楀彛锛�
- })
- }).then((oData) => {
- if (oData.responseMsg.code === 1) {
- console.log('success', oData)
- }
- }, err => {
- console.log('err', err)
- })
- })
-
- // afgetCarmeraPreviemUrl({ indexCode: val.indexCode }).then(res => {
- // activeVideo.value = res.data
- // })
}
-
const autoplayFlag = (list = [], leng = 4, time = 2000) => {
if (list.length > leng) {
return { delay: time, disableOnInteraction: false }
@@ -1129,7 +973,6 @@
getData3()
getData5()
getWarning()
-
setInterval(() => {
getData1()
diff --git a/screen/src/views/videoUrl/Video.vue b/screen/src/views/videoUrl/Video.vue
new file mode 100644
index 0000000..f5e72a5
--- /dev/null
+++ b/screen/src/views/videoUrl/Video.vue
@@ -0,0 +1,229 @@
+<template>
+ <div class="video_app">
+ <div class="player_bg" ref="videoRef" style="width: 100%;height: 100%;" id="playWnd"> </div>
+ </div>
+ <!-- <img style="width: 34px;margin-bottom: 16px;" src="../../assets/images/SecurityControl/ic_unable@2x.png" > -->
+</template>
+
+<script setup>
+import { defineProps, ref, onMounted, onUnmounted, watch } from 'vue'
+const props = defineProps({
+ indexCode: String,
+ href: String,
+})
+const templateA = `
+ <div style="width:100%;height: 100%;display: flex;justify-content: center;align-items: center;flex-direction: column;">
+ <div style="font-weight: 500;font-size: 15px;color: #CCCCCC;margin-bottom: 4px;">鏃犳硶鎾斁鐩戞帶鐢婚潰锛�</div>
+ <div style="font-weight: 500;font-size: 15px;color: #CCCCCC;margin-bottom: 20px;">鐐瑰嚮涓嬭浇骞跺畨瑁呰灞忔挱鏀炬彃浠�</div>
+ <a href="${props.href}" target="_blank" style="font-weight: 500;font-size: 15px;color: #01D9FE;">鐐瑰嚮涓嬭浇</a>
+ </div>
+`
+
+
+const width = ref(0)
+const height = ref(0)
+const videoRef = ref(null)
+
+onMounted(() => {
+ const rect = videoRef.value.getBoundingClientRect()
+ width.value = rect.width
+ height.value = rect.height
+
+ initPlugin()
+ window.addEventListener('resize', function () { // 鎵ц
+ if (oWebControl.value) {
+ const rect = videoRef.value.getBoundingClientRect()
+ width.value = rect.width
+ height.value = rect.height
+ oWebControl.value.JS_Resize($('#playWnd').width(), $('#playWnd').height())
+ }
+ })
+})
+onUnmounted(() => {
+ destroyed()
+})
+const oWebControl = ref(null)
+const initCount = ref()
+const pubKey = ref('')
+
+watch(
+ () => props.indexCode,
+ (newValue, oldValue) => {
+ console.log('鐖剁粍浠朵紶鍊煎彉鍖栵細', newValue)
+ videoPlay()
+ }
+)
+
+const initPlugin = () => {
+ oWebControl.value = new WebControl({
+ szPluginContainer: "playWnd", // 鎸囧畾瀹瑰櫒id
+ iServicePortStart: 15900, // 鎸囧畾璧锋绔彛鍙凤紝寤鸿浣跨敤璇ュ��
+ iServicePortEnd: 15900,
+ szClassId: "23BF3B0A-2C56-4D97-9C03-0CB103AA8F11", // 鐢ㄤ簬IE10浣跨敤ActiveX鐨刢lsid
+ cbConnectSuccess: function () {
+ // 鍒涘缓WebControl瀹炰緥鎴愬姛
+ console.log('1--鍒涘缓WebControl瀹炰緥鎴愬姛')
+
+ oWebControl.value.JS_StartService("window", { // WebControl瀹炰緥鍒涘缓鎴愬姛鍚庨渶瑕佸惎鍔ㄦ湇鍔�
+ dllPath: "./VideoPluginConnect.dll" // 鍊�"./VideoPluginConnect.dll"鍐欐
+ }).then(function () {
+ oWebControl.value.JS_SetWindowControlCallback({ // 璁剧疆娑堟伅鍥炶皟
+ cbIntegrationCallBack: cbIntegrationCallBack
+ })// 鍚姩鎻掍欢鏈嶅姟鎴愬姛
+ oWebControl.value.JS_CreateWnd("playWnd", width.value, height.value).then(function () { //JS_CreateWnd鍒涘缓瑙嗛鎾斁绐楀彛锛屽楂樺彲璁惧畾锛宐oxWidth, boxHeight瀹瑰櫒
+ // oWebControl.value.JS_CreateWnd("playWnd").then(function () { //JS_CreateWnd鍒涘缓瑙嗛鎾斁绐楀彛锛屽楂樺彲璁惧畾锛宐oxWidth, boxHeight瀹瑰櫒
+ init() // 鍒涘缓鎾斁瀹炰緥鎴愬姛鍚庡垵濮嬪寲
+ })
+ }, function () { // 鍚姩鎻掍欢鏈嶅姟澶辫触
+ })
+ },
+ cbConnectError: function () { // 鍒涘缓WebControl瀹炰緥澶辫触
+ console.log('鍒涘缓WebControl瀹炰緥澶辫触')
+ oWebControl.value = null
+ $("#playWnd").html("鎻掍欢鏈惎鍔紝姝e湪灏濊瘯鍚姩锛岃绋嶅��...")
+ WebControl.JS_WakeUp("VideoWebPlugin://") // 绋嬪簭鏈惎鍔ㄦ椂鎵цerror鍑芥暟锛岄噰鐢╳akeup鏉ュ惎鍔ㄧ▼搴�
+ initCount.value++
+ if (initCount.value < 3) {
+ setTimeout(function () {
+ initPlugin()
+ }, 3000)
+ } else {
+ $("#playWnd").html(templateA)
+ }
+ },
+ cbConnectClose: function (bNormalClose) {
+ // 寮傚父鏂紑锛歜NormalClose = false
+ // JS_Disconnect姝e父鏂紑锛歜NormalClose = true
+ console.log('寮傚父鏂紑锛歜NormalClose')
+ oWebControl.value = null
+ $("#playWnd").html("鎻掍欢鏈惎鍔紝姝e湪灏濊瘯鍚姩锛岃绋嶅��...")
+ WebControl.JS_WakeUp("VideoWebPlugin://")
+ initCount.value++
+ if (initCount.value < 3) {
+ setTimeout(function () {
+ initPlugin()
+ }, 3000)
+ } else {
+ $("#playWnd").html(templateA)
+ }
+ }
+ })
+}
+// 鍒濆鍖�
+const init = () => {
+ getPubKey(function () {
+ ////////////////////////////////// 璇疯嚜琛屼慨鏀逛互涓嬪彉閲忓�� ////////////////////////////////////
+ let appkey = "23154099" //缁煎悎瀹夐槻绠$悊骞冲彴鎻愪緵鐨刟ppkey锛屽繀濉�
+ // let secret = '88wFsg3xfn7o8QMsWEO2' //缁煎悎瀹夐槻绠$悊骞冲彴鎻愪緵鐨剆ecret锛屽繀濉�
+ let secret = setEncrypt("88wFsg3xfn7o8QMsWEO2") //缁煎悎瀹夐槻绠$悊骞冲彴鎻愪緵鐨剆ecret锛屽繀濉�
+ let ip = "10.50.250.253" //缁煎悎瀹夐槻绠$悊骞冲彴IP鍦板潃锛屽繀濉�
+ let playMode = 0 //鍒濆鎾斁妯″紡锛�0-棰勮(瀹炴椂娴�)锛�1-鍥炴斁(瑙嗛)
+ let port = 443 //缁煎悎瀹夐槻绠$悊骞冲彴绔彛锛岃嫢鍚敤HTTPS鍗忚锛岄粯璁�443
+ let snapDir = "D:\\SnapDir" //鎶撳浘瀛樺偍璺緞
+ let videoDir = "D:\\VideoDir" //绱ф�ュ綍鍍忔垨褰曞儚鍓緫瀛樺偍璺緞
+ let layout = "1x1" //playMode鎸囧畾妯″紡鐨勫竷灞�
+ let enableHTTPS = 1 //鏄惁鍚敤HTTPS鍗忚涓庣患鍚堝畨闃茬鐞嗗钩鍙颁氦浜掞紝杩欓噷鎬绘槸濉�1
+ let encryptedFields = 'secret' //鍔犲瘑瀛楁锛岄粯璁ゅ姞瀵嗛鍩熶负secret
+ let showToolbar = 1 //鏄惁鏄剧ず宸ュ叿鏍忥紝0-涓嶆樉绀猴紝闈�0-鏄剧ず
+ let showSmart = 1 //鏄惁鏄剧ず鏅鸿兘淇℃伅锛堝閰嶇疆绉诲姩渚︽祴鍚庣敾闈笂鐨勭嚎妗嗭級锛�0-涓嶆樉绀猴紝闈�0-鏄剧ず
+ let buttonIDs = "0,16,256,257,258,259,260,513,514,515,516,517,768" //鑷畾涔夊伐鍏锋潯鎸夐挳
+ oWebControl.value.JS_RequestInterface({
+ funcName: "init",
+ argument: JSON.stringify({
+ appkey: appkey, //API缃戝叧鎻愪緵鐨刟ppkey
+ secret: secret, //API缃戝叧鎻愪緵鐨剆ecret
+ ip: ip, //API缃戝叧IP鍦板潃
+ playMode: playMode, //鎾斁妯″紡锛堝喅瀹氭樉绀洪瑙堣繕鏄洖鏀剧晫闈級
+ port: port, //绔彛
+ snapDir: snapDir, //鎶撳浘瀛樺偍璺緞
+ videoDir: videoDir, //绱ф�ュ綍鍍忔垨褰曞儚鍓緫瀛樺偍璺緞
+ layout: layout, //甯冨眬
+ enableHTTPS: enableHTTPS, //鏄惁鍚敤HTTPS鍗忚
+ encryptedFields: encryptedFields, //鍔犲瘑瀛楁
+ showToolbar: showToolbar, //鏄惁鏄剧ず宸ュ叿鏍�
+ showSmart: showSmart, //鏄惁鏄剧ず鏅鸿兘淇℃伅
+ buttonIDs: buttonIDs //鑷畾涔夊伐鍏锋潯鎸夐挳
+ })
+ }).then(function (oData) {
+ console.log('鍒濆鍖栨垚鍔�')
+ videoPlay()
+ // oWebControl.value.JS_Resize(that.boxWidth, that.boxHeight) // 鍒濆鍖栧悗resize涓�娆★紝瑙勯伩firefox涓嬮娆℃樉绀虹獥鍙e悗鎻掍欢绐楀彛鏈笌DIV绐楀彛閲嶅悎闂
+ })
+ })
+}
+const videoPlay = () => {
+ console.log('寮�濮嬫挱鏀�')
+
+ oWebControl.value.JS_RequestInterface({
+ funcName: "startPreview",
+ argument: JSON.stringify({
+ cameraIndexCode: props.indexCode, //鐩戞帶鐐圭紪鍙�
+ streamMode: 0, //涓诲瓙鐮佹祦鏍囪瘑锛�0-涓荤爜娴侊紝1-瀛愮爜娴�
+ transMode: 1, //浼犺緭鍗忚锛�0-UDP锛�1-TCP
+ gpuMode: 0, //鏄惁鍚敤GPU纭В锛�0-涓嶅惎鐢紝1-鍚敤
+ wndId: -1 //鎾斁绐楀彛搴忓彿锛堝湪2x2浠ヤ笂甯冨眬涓嬪彲鎸囧畾鎾斁绐楀彛锛�
+ })
+ }).then((oData) => {
+ if (oData.responseMsg.code === 1) {
+ console.log('鎾斁鎴愬姛', oData)
+ }
+ }, err => {
+ console.log('err', err)
+
+ })
+}
+// 閿�姣�
+const destroyed = () => {
+ if (oWebControl.value) {
+ oWebControl.value.JS_HideWnd() // 鍏堣绐楀彛闅愯棌锛岃閬挎彃浠剁獥鍙f粸鍚庝簬娴忚鍣ㄦ秷澶遍棶棰�
+ oWebControl.value.JS_Disconnect().then(function () { }, function () { })
+ }
+}
+
+function fileDown() {
+ window.open('./videoUrl/VideoWebPlugin.exe')
+}
+// 娑堟伅鍥炶皟
+const cbIntegrationCallBack = (oData) => {
+ let response = oData.responseMsg
+ // response.type=1 閫変腑绐楀彛娑堟伅 type=2 鎾斁娑堟伅
+}
+// 鐩戞帶
+
+
+
+
+
+// 鑾峰彇鍏挜
+function getPubKey(callback) {
+ oWebControl.value.JS_RequestInterface({
+ funcName: 'getRSAPubKey',
+ argument: JSON.stringify({
+ keyLength: 1024,
+ }),
+ }).then((oData) => {
+ if (oData.responseMsg.data) {
+ pubKey.value = oData.responseMsg.data
+ callback()
+ }
+ })
+}
+
+// RSA鍔犲瘑
+function setEncrypt(value) {
+ let that = this
+ let encrypt = new JSEncrypt()
+ encrypt.setPublicKey(pubKey.value)
+ return encrypt.encrypt(value)
+}
+
+
+</script>
+
+<style lang="scss" scoped>
+.video_app {
+ width: 100%;
+ height: 100%;
+
+}
+</style>
\ No newline at end of file
diff --git a/screen/src/views/videoUrl/demo_embedded_for_iframe.html b/screen/src/views/videoUrl/demo_embedded_for_iframe.html
deleted file mode 100644
index 470ab6a..0000000
--- a/screen/src/views/videoUrl/demo_embedded_for_iframe.html
+++ /dev/null
@@ -1,446 +0,0 @@
-<!doctype html>
-<html>
-<head>
- <title>棰勮Demo</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta http-equiv="Pragma" content="no-cache" />
- <meta http-equiv="Cache-Control" content="no-cache, must-revalidate" />
- <meta http-equiv="Expires" content="0" />
-</head>
-<style>
-html, body {
- padding: 0;
- margin: 0;
-}
-.playWnd {
- margin: 30px 0 0 50px;
- width: 800px;
- height: 400px;
- border: 1px solid red;
-}
-.cbInfoDiv {
- float: left;
- width: 360px;
- margin-left: 16px;
- border:1px solid #7F9DB9;
-}
-.cbInfo {
- height: 200px;
- padding: 5px;
- border: 1px solid #7F9DB9;
- word-break: break-all;
- overflow: scroll锛廰uto;
-}
-.operate {
- margin-top: 24px;
-}
-.operate::after {
- content: '';
- display: block;
- clear: both;
-}
-.operate .btns {
- height: 32px;
-}
-.module {
- float: left;
- width: 120px;
- min-height: 290px;
- margin-left: 10px;
- padding: 16px 8px;
- box-sizing: border-box;
- border: 1px solid #e5e5e5;
-}
-.module .item {
- margin-bottom: 4px;
-}
-.module .label {
- width: 150px;
- display: inline-block;
- vertical-align: middle;
- margin-right: 8px;
- text-align: right;
-}
-.module input[type="text"],
-.module select {
- box-sizing: border-box;
- display: inline-block;
- vertical-align: middle;
- margin-left: 0;
- width: 150px;
- min-height: 20px;
-}
-.module .btn {
- min-width: 80px;
- min-height: 24px;
- margin-top: 16px;
- margin-left: 158px;
-}
-</style>
-<body>
- <div id="playWnd" class="playWnd" style="left: 109px; top: 133px;"></div>
- <div id="operate" class="operate">
- <!--鍒濆鍖栥�佸弽鍒濆鍖栥�佽缃璇佷俊鎭帴鍙h皟鐢ㄥ叆鍙c��
- 1.鎻掍欢鎵�鏈夋帴鍙i兘闇�瑕佸湪璋冪敤鍒濆鍖栧苟杩斿洖鎴愬姛鍚庢墠鑳借皟鐢�
- 2.璁剧疆璁よ瘉淇℃伅浠呴�傜敤浜庡鎺ュ骞冲彴鏃剁殑鎯呭喌锛屽叿浣撳弬鐓у紑鍙戞寚鍗�
- 3.鍙嶅垵濮嬪寲鍚庯紝鎻掍欢璧勬簮閿�姣�-->
- <div class="module" style="left:30px;height:30px;width:280px;padding:10;margin:10;">
- <div class="item">
- <label >鍒濆鍖栫浉鍏冲弬鏁帮細</label>
- <textarea id="initParam" type="text" style="width:260px;height:200px;">
-{
- "argument": {
- "appkey": "",
- "ip": "",
- "port": 443,
- "secret": "",
- "enableHTTPS": 1,
- "layout": "2x2",
- "playMode": 0
- },
- "funcName": "init"
-}
- </textarea>
- </div>
- <div class="item">
-
- <button style="width:10px;padding:0;margin:0;" id="initBtn" class="btn">鎵ц</button>
- </div>
- </div>
-
- <!--鍗曚釜鐐逛綅鎾斁銆佹壒閲忕偣浣嶆挱鏀俱�佹壒閲忓仠姝㈡挱鏀俱�佸叏閮ㄥ仠姝㈡挱鏀炬帴鍙h皟鐢ㄥ叆鍙c��
- 1.authUuid涓哄鎺ュ骞冲彴鏃跺繀椤荤殑鎾斁瀛楁锛屽鎺ュ崟骞冲彴鏃讹紝鍙笉鎸囧畾-->
- <div class="module" style="height:30;width:280px;padding:10;margin:10;">
- <div class="item">
- <label >鎾斁鐩稿叧鍙傛暟锛�</label>
- <textarea id="playParam" type="text" style="width:260px;height:200px;">
-{
- "argument": {
- "cameraIndexCode": "",
- "ezvizDirect": 0,
- "gpuMode": 0,
- "streamMode": 0,
- "transMode": 1,
- "wndId": -1
- },
- "funcName": "startPreview"
-}
- </textarea>
- </div>
- <div class="item">
-
- <button style="width:10px;padding:0;margin:0;" id="playBtn" class="btn">鎵ц</button>
- </div>
- </div>
- <div class="module" style="height:50;width:300px;padding:10;margin:10;">
- <legend>杩斿洖鍊间俊鎭�</legend>
- <div id="cbInfo" class="cbInfo"></div>
- <button style="width:80px;height:24px;padding:30;margin:0;" id="clear">娓呯┖</button>
- </div>
- </div>
-</body>
-<script src="jquery-1.12.4.min.js"></script>
-<script src="jsencrypt.min.js"></script>
-<script src="web-control_1.2.7.min.js"></script>
-
-<script type="text/javascript">
- // 鎻掍欢瀵硅薄瀹炰緥锛屽垵濮嬪寲涓簄ull锛岄渶瑕佸垱寤哄涓彃浠剁獥鍙f椂锛岄渶瑕佸畾涔夊涓彃浠跺璞″疄渚嬪彉閲忥紝鍚勪釜鍙橀噺鍞竴鏍囧織瀵瑰簲鐨勬彃浠跺疄渚�
- var oWebControl = null;
- var bIE = (!!window.ActiveXObject || 'ActiveXObject' in window);// 鏄惁涓篒E娴忚鍣�
- var pubKey = ''; // demo涓湭浣跨敤鍔犲瘑锛屽彲鏍规嵁闇�姹傚弬鐓у紑鍙戞寚鍗楄嚜琛屼娇鐢ㄥ姞瀵嗗姛鑳�
- var initCount = 0; // 寮傚父閲嶅惎璁℃暟
- var iframePos = {}; // iframe鐩稿鏂囨。鐨勪綅缃�
- var parentTitle = ''; // 鐖堕〉闈㈡爣棰�
- var iframeClientPos = null; // iframe鐩稿瑙嗙獥鐨勪綅缃�
- var iframeParentShowSize = null; // 瑙嗙獥澶у皬 width height
-
- // 鏍囩鍏抽棴
- $(window).unload(function () {
- if (oWebControl != null){
- oWebControl.JS_HideWnd(); // 鍏堣绐楀彛闅愯棌锛岃閬垮彲鑳界殑鎻掍欢绐楀彛婊炲悗浜庢祻瑙堝櫒娑堝け闂
- oWebControl.JS_Disconnect().then(function(){}, function() {});
- }
- });
-
- //鐩戝惉鐖堕〉闈㈢殑娑堟伅
- window.addEventListener('message', function(e){
- if(e && e.data){
- switch (e.data.action){
- case 'sendTitle': // 鐖堕〉闈㈠皢鍏舵爣棰樺彂閫佽繃鏉ワ紝瀛愰〉闈繚瀛樿鏍囬锛屼互渚垮垱寤烘彃浠剁獥鍙f垚鍔熷悗灏嗘爣棰樿缃洖缁欑埗椤甸潰
- parentTitle = e.data.info;
- break;
- case 'updatePos': // 鏇存柊鎻掍欢浣嶇疆
- var scrollValue = e.data.scrollValue; // 婊氬姩鏉℃粴鍔ㄥ亸绉婚噺
- oWebControl.JS_SetDocOffset({
- left: iframePos.left + scrollValue.left,
- top: iframePos.top + scrollValue.top
- }); // 鏇存柊鎻掍欢绐楀彛浣嶇疆
-
- oWebControl.JS_Resize(800, 400);
- setWndCover();
- break;
- case 'scroll':
- iframeParentShowSize = e.data.showSize; // 瑙嗙獥澶у皬
- iframePos = e.data.iframeOffset; // iframe涓庢枃妗g殑鍋忕Щ閲�
- iframeClientPos = e.data.iframeClientPos; // iframe鐩稿瑙嗙獥鐨勪綅缃�
- var scrollValue = e.data.scrollValue; // 婊氬姩鏉℃粴鍔ㄥ亸绉婚噺
- if(oWebControl){
- oWebControl.JS_SetDocOffset({
- left: iframePos.left + scrollValue.left,
- top: iframePos.top + scrollValue.top
- }); // 鏇存柊鎻掍欢绐楀彛浣嶇疆
- oWebControl.JS_Resize(800, 400);
- setWndCover();
- }
- break;
- default:
- break;
- }
- }
- });
-
- // 椤堕儴锛歩frame.getBoundingClientRect().top灏忎簬0骞朵笖鍏剁粷瀵瑰�艰秴杩嘍IV.get(0).getBoundingClientRect().top閮ㄥ垎闇�瑕佸壀鍒�
- // 搴曢儴锛�(iframe.getBoundingClientRect().bottom - iframe鐖剁獥鍙e彲瑙嗗煙楂樺害锛屼负H1)涓轰笉鍙閮ㄥ垎
- // ($(window).height() - DIV.get(0).getBoundingClientRect().bottom)
- // 涓篋IV搴曢儴涓庡叾鎵�鍦╥frame搴曢儴涔嬮棿鐨勮窛绂籋2锛孒1-H2鐨勫�煎ぇ浜�0鍒欒〃绀篋IV鏈夐儴鍒嗗湪涓嶅彲瑙佸尯鍩�
- // 宸﹁竟锛歩frame.getBoundingClientRect().left灏忎簬0骞朵笖鍏剁粷瀵瑰�艰秴杩嘍IV.get(0).getBoundingClientRect().left閮ㄥ垎闇�瑕佸壀鍒�
- // 鍙宠竟锛�(iframe瀹藉害 - DIV.get(0).getBoundingClientRect().right琛ㄧずDIV鍙宠竟涓庡叾鐖秈frame鍙宠竟涔嬮棿鐨勮窛绂伙紝涓篧1)
- // (iframe鐖剁獥鍙e彲瑙嗗煙瀹藉害-iframe.getBoundingClientRect().left琛ㄧずiframe宸﹁竟涓巌frame鐖剁獥鍙e彲瑙嗗煙鍙宠竟涔嬮棿鐨勮窛绂伙紝涓篧2)
- // (iframe瀹藉害 - W2 - W1)濡傛灉澶т簬0锛屽垯琛ㄧずDIV鍙宠竟瓒呭嚭浜唅frame鐖剁獥鍙e彲瑙嗗煙锛岄渶瑕佸壀鍒囪秴杩囩殑閮ㄥ垎
- function setWndCover() {
- if (oWebControl){
- // 鍑嗗瑕佺敤鍒扮殑涓�浜涙暟鎹�
- var iframeWndHeight = $(window).height(); // iframe绐楀彛楂樺害
- var iframeWndWidth = $(window).width(); // iframe绐楀彛瀹藉害
- var divLeft = $("#playWnd").get(0).getBoundingClientRect().left;
- var divTop = $("#playWnd").get(0).getBoundingClientRect().top;
- var divRight = $("#playWnd").get(0).getBoundingClientRect().right;
- var divBottom = $("#playWnd").get(0).getBoundingClientRect().bottom;
- var divWidth = $("#playWnd").width();
- var divHeight = $("#playWnd").height();
-
- oWebControl.JS_RepairPartWindow(0, 0, 801, 401); // 澶�1涓儚绱犵偣闃叉杩樺師鍚庤竟鐣岀己澶变竴涓儚绱犳潯
-
- // 鍒ゆ柇鍓垏鐭╁舰鐨勪笂杈硅窛
- if (iframeClientPos.top < 0 && Math.abs(iframeClientPos.top) > divTop){
- var deltaTop = Math.abs(iframeClientPos.top) - divTop;
- oWebControl.JS_CuttingPartWindow(0, 0, 801, deltaTop + 1);
- //console.log({deltaTop: deltaTop});
- }
-
- // 鍒ゆ柇鍓垏鐭╁舰鐨勫乏杈硅窛
- if (iframeClientPos.left < 0 && Math.abs(iframeClientPos.left) > divLeft){
- var deltaLeft = Math.abs(iframeClientPos.left) - divLeft;
- //console.log({deltaLeft: deltaLeft});
- oWebControl.JS_CuttingPartWindow(0, 0, deltaLeft, 401); // 澶氬壀鎺変竴涓儚绱犳潯锛岄槻姝㈠嚭鐜板壀鎺変竴閮ㄥ垎绐楀彛鍚庡嚭鐜颁竴涓儚绱犳潯
- }
-
- // 鍒ゆ柇鍓垏鐭╁舰鐨勫彸杈硅窛
- var W1 = iframeWndWidth - divRight;
- var W2 = iframeParentShowSize.width - iframeClientPos.left;
- if (W2 < divWidth){
- var deltaRight = iframeWndWidth - W2 - W1;
- if (deltaRight > 0) {
- oWebControl.JS_CuttingPartWindow(800 - deltaRight, 0, deltaRight + 1, 401);
- }
- }
-
- // 鍒ゆ柇鍓垏鐭╁舰鐨勪笅杈硅窛
- var H1 = iframeClientPos.bottom - iframeParentShowSize.height;
- var H2 = iframeWndHeight - divBottom;
- var deltaBottom = H1 - H2;
- //console.log({deltaBottom: deltaBottom});
- if (deltaBottom > 0) {
- oWebControl.JS_CuttingPartWindow(0, 400 - deltaBottom, 801, deltaBottom + 1);
- }
- }
- }
-
- // 鍒涘缓鎻掍欢瀹炰緥锛屽苟鍚姩鏈湴鏈嶅姟寤虹珛websocket杩炴帴锛屽垱寤烘彃浠剁獥鍙�
- function initPlugin () {
- oWebControl = new WebControl({
- szPluginContainer: "playWnd",
- iServicePortStart: 15900,
- iServicePortEnd: 15900,
- szClassId:"23BF3B0A-2C56-4D97-9C03-0CB103AA8F11", // 鐢ㄤ簬IE10浣跨敤ActiveX鐨刢lsid
- cbConnectSuccess: function () {
- initCount = 0;
- setCallbacks();
- oWebControl.JS_StartService("window", {
- dllPath: "./VideoPluginConnect.dll"
- }).then(function () {
- // 姝ラ2锛欽S_CreateWnd鏃舵寚瀹歝bSetDocTitle鍥炶皟锛屽苟鍦ㄥ洖璋冧腑鍚戠埗椤甸潰鍙戦�佹洿鏂版爣棰樻秷鎭紝鏍囬涓哄洖璋冨嚭鏉ョ殑uuid
- oWebControl.JS_CreateWnd("playWnd", 800, 400, {
- bEmbed: true,
- cbSetDocTitle: function (uuid) {
- oWebControl._pendBg = false;
- window.parent.postMessage({
- action:'updateTitle',
- msg:'瀛愰〉闈㈤�氱煡鐖堕〉闈慨鏀箃itle',
- info:uuid
- }, '\*'); // '\*'琛ㄧず璺ㄥ煙鍙傛暟锛岃缁撳悎鑷韩涓氬姟鍚堢悊璁剧疆
- }
- }).then(function () {
- // 姝ラ3锛欽S_CreateWnd鎴愬姛鍚庨�氱煡鐖堕〉闈㈠皢鍏舵爣棰樹慨鏀瑰洖鍘�
- console.log("JS_CreateWnd success");
- window.parent.postMessage({
- action:'updateTitle',
- msg:'瀛愰〉闈㈤�氱煡鐖堕〉闈㈡洿鏂皌itle',
- info: parentTitle
- }, '\*');
-
- // 姝ラ4锛氬彂娑堟伅鏇存柊鎻掍欢绐楀彛浣嶇疆锛氳繖閲屼笉鐩存帴鏇存柊鐨勫師鍥犳槸锛岀埗椤甸潰榛樿鍙兘灏卞瓨鍦ㄦ粴鍔ㄦ潯锛屾鏃舵湁婊氬姩閲�
- window.parent.postMessage({
- action:'updatePos',
- msg:'鏇存柊Pos'
- }, '\*');
-
- initBtnClicked();
- });
- }, function () {
- console.log("JS_CreateWnd fail");
- });
- },
- cbConnectError: function () {
- console.log("cbConnectError");
- oWebControl = null;
- $("#playWnd").html("鎻掍欢鏈惎鍔紝姝e湪灏濊瘯鍚姩锛岃绋嶅��...");
- WebControl.JS_WakeUp("VideoWebPlugin://");
- initCount ++;
- if (initCount < 3) {
- setTimeout(function () {
- initPlugin();
- }, 3000)
- } else {
- $("#playWnd").html("鎻掍欢鍚姩澶辫触锛岃妫�鏌ユ彃浠舵槸鍚﹀畨瑁咃紒");
- }
- },
- cbConnectClose: function (bNormalClose) {
- // 寮傚父鏂紑锛歜NormalClose = false
- // JS_Disconnect姝e父鏂紑锛歜NormalClose = true
- if (true == bNormalClose){
- console.log("cbConnectClose normal");
- }else{
- console.log("cbConnectClose exception");
- }
-
- oWebControl = null;
- $("#playWnd").html("鎻掍欢鏈惎鍔紝姝e湪灏濊瘯鍚姩锛岃绋嶅��...");
- WebControl.JS_WakeUp("VideoWebPlugin://");
- initCount ++;
- if (initCount < 3) {
- setTimeout(function () {
- initPlugin();
- }, 3000)
- } else {
- $("#playWnd").html("鎻掍欢鍚姩澶辫触锛岃妫�鏌ユ彃浠舵槸鍚﹀畨瑁咃紒");
- }
- }
- });
- }
-
- initPlugin();
-
- // 鑾峰彇鍏挜
- function getPubKey (callback) {
- oWebControl.JS_RequestInterface({
- funcName: "getRSAPubKey",
- argument: JSON.stringify({
- keyLength: 1024
- })
- }).then(function (oData) {
- console.log(oData)
- if (oData.responseMsg.data) {
- pubKey = oData.responseMsg.data
- callback()
- }
- })
- }
-
- // 璁剧疆绐楀彛鎺у埗鍥炶皟
- function setCallbacks() {
- oWebControl.JS_SetWindowControlCallback({
- cbIntegrationCallBack: cbIntegrationCallBack
- });
- }
-
- // 鎺ㄩ�佹秷鎭�
- function cbIntegrationCallBack(oData) {
- showCBInfo(JSON.stringify(oData.responseMsg));
- }
-
- // RSA鍔犲瘑
- function setEncrypt (value) {
- var encrypt = new JSEncrypt();
- encrypt.setPublicKey(pubKey);
- return encrypt.encrypt(value);
- }
-
- function requestInterface(value)
- {
- oWebControl.JS_RequestInterface(JSON.parse(value)).then(function (oData) {
- console.log(oData)
- showCBInfo(JSON.stringify(oData ? oData.responseMsg : ''));
- });
- }
-
- // 鏄剧ず鎺ュ彛杩斿洖鐨勬秷鎭強鎻掍欢鍥炶皟淇℃伅
- function showCBInfo(szInfo, type) {
- if (type === 'error') {
- szInfo = "<div style='color: red;'>" + dateFormat(new Date(), "yyyy-MM-dd hh:mm:ss") + " " + szInfo + "</div>";
- } else {
- szInfo = "<div>" + dateFormat(new Date(), "yyyy-MM-dd hh:mm:ss") + " " + szInfo + "</div>";
- }
- $("#cbInfo").html(szInfo + $("#cbInfo").html());
- }
-
- function initBtnClicked(){
- var param = $("#initParam").val();
- //鍒犻櫎瀛楃涓蹭腑鐨勫洖杞︽崲琛�
- param = param.replace(/(\s*)/g, "");
-
- // 鎵ц鍒濆鍖�
- requestInterface(param);
- }
-
- $("#initBtn").click(function() {
- initBtnClicked();
- })
-
- $("#playBtn").click(function() {
- var param = $("#playParam").val();
- //鍒犻櫎瀛楃涓蹭腑鐨勫洖杞︽崲琛�
- param = param.replace(/(\s*)/g, "");
-
- // 鎵ц棰勮
- requestInterface(param);
- })
-
- // 娓呯┖
- $("#clear").click(function() {
- $("#cbInfo").html('');
- })
-
- // 鏍煎紡鍖栨椂闂�
- function dateFormat(oDate, fmt) {
- var o = {
- "M+": oDate.getMonth() + 1, //鏈堜唤
- "d+": oDate.getDate(), //鏃�
- "h+": oDate.getHours(), //灏忔椂
- "m+": oDate.getMinutes(), //鍒�
- "s+": oDate.getSeconds(), //绉�
- "q+": Math.floor((oDate.getMonth() + 3) / 3), //瀛e害
- "S": oDate.getMilliseconds()//姣
- };
- if (/(y+)/.test(fmt)) {
- fmt = fmt.replace(RegExp.$1, (oDate.getFullYear() + "").substr(4 - RegExp.$1.length));
- }
- for (var k in o) {
- if (new RegExp("(" + k + ")").test(fmt)) {
- fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
- }
- }
- return fmt;
- }
-</script>
-</html>
\ No newline at end of file
diff --git a/screen/src/views/videoUrl/init.js b/screen/src/views/videoUrl/init.js
deleted file mode 100644
index 66d5070..0000000
--- a/screen/src/views/videoUrl/init.js
+++ /dev/null
@@ -1,148 +0,0 @@
-export const initFn = () => {
- var iframeWin = document.getElementById("iframe1")
- {
- iframeWin.onload = function () {
- iframeWin.contentWindow.postMessage({
- action: 'sendTitle', // 鍛婅瘔瀛愰〉闈㈡湰椤甸潰鐨勬爣棰橈紙action鑷鎸囧畾锛屼絾闇�瑕佷笌瀛愰〉闈腑鐩戝惉鐨刟ction淇濇寔涓�鑷�
- msg: '灏嗘爣棰樺彂缁欏瓙椤甸潰',
- info: document.title
- }, '\*')
- iframeWin.contentWindow.postMessage({
- action: 'updateInitParam', // 鍛婅瘔瀛愰〉闈竴浜涘垵濮嬪�硷紝鍖呮嫭娴忚鍣ㄨ绐楅珮搴︿笌瀹藉害銆乮frame鍋忕鏂囨。鐨勪綅缃�乮frame鐩稿瑙嗙獥鐨勪綅缃�
- msg: '鏇存柊瀛愰〉闈竴浜涘垵濮嬪��',
- showSize: { // 娴忚鍣ㄨ绐楅珮搴︿笌瀹藉害
- width: $(window).width(),
- height: $(window).height()
- },
- iframeOffset: { // iframe鍋忕鏂囨。鐨勪綅缃�
- left: iframeWin.offsetLeft,
- top: iframeWin.offsetTop
- },
- iframeClientPos: { // iframe鐩稿瑙嗙獥鐨勪綅缃�
- left: iframeWin.getBoundingClientRect().left,
- right: iframeWin.getBoundingClientRect().right,
- top: iframeWin.getBoundingClientRect().top,
- bottom: iframeWin.getBoundingClientRect().bottom
- }
- }, '\*') // '\*'琛ㄧず璺ㄥ煙鍙傛暟锛岃缁撳悎鑷韩涓氬姟鍚堢悊璁剧疆
- }
- }
-
- // 姝ラ3锛氱洃鍚祵鍏ュ瓙椤甸潰鐨勪簨浠�
- window.addEventListener('message', function (e) {
- console.log(e.data.msg)
- if (e && e.data) {
- switch (e.data.action) {
- case 'updateTitle': // 鏈〉闈㈡敹鍒板瓙椤甸潰閫氱煡鏇存柊鏍囬閫氱煡锛屾洿鏂版湰椤甸潰鏍囬
- document.title = e.data.info
- break
- case 'updatePos':
- var scrollLeftValue = document.documentElement.scrollLeft
- var scrollTopValue = document.documentElement.scrollTop
- iframeWin.contentWindow.postMessage({
- action: 'updatePos',
- msg: '鏇存柊Pos',
- scrollValue: { // 婊氬姩鏉℃粴鍔ㄧ殑鍋忕Щ閲�
- left: -1 * scrollLeftValue,
- top: -1 * scrollTopValue,
- }
- }, '\*') // '\*'琛ㄧず璺ㄥ煙鍙傛暟锛岃缁撳悎鑷韩涓氬姟鍚堢悊璁剧疆
- break
- default:
- break
- }
- }
- })
-
- // 姝ラ4锛氬吋鍚湰椤甸潰鐨剅esize浜嬩欢锛屽苟灏嗕竴浜涚姸鎬佸�煎彂閫佺粰宓屽叆鐨勫瓙椤甸潰
- var resizeTimer = null
- var resizeDate
- $(window).resize(function () {
- resizeDate = new Date()
- if (resizeTimer === null) {
- resizeTimer = setTimeout(checkResizeEndTimer, 100)
- }
- })
-
- function checkResizeEndTimer() {
- if (new Date() - resizeDate > 100) { // resize缁撴潫鍚庡啀鍙戞秷鎭紝閬垮厤娈嬪奖闂
- clearTimeout(resizeTimer)
- resizeTimer = null
- postResizeEvent()
- } else {
- setTimeout(checkResizeEndTimer, 100)
- }
- }
-
- function postResizeEvent() {
- iframeWin.contentWindow.postMessage({
- action: 'resize',
- msg: 'resize浜嬩欢',
- showSize: { // 鍛婅瘔宓屽叆鐨勫瓙椤甸潰瑙嗙獥楂樺害涓庡搴�
- width: $(window).width(),
- height: $(window).height()
- },
- iframeClientPos: { // iframe鐩稿瑙嗙獥鐨勪綅缃�
- left: iframeWin.getBoundingClientRect().left,
- right: iframeWin.getBoundingClientRect().right,
- top: iframeWin.getBoundingClientRect().top,
- bottom: iframeWin.getBoundingClientRect().bottom
- },
- iframeOffset: { // iframe鍋忕鏂囨。鐨勪綅缃�
- left: iframeWin.offsetLeft,
- top: iframeWin.offsetTop
- }
- }, '\*') // '\*'琛ㄧず璺ㄥ煙鍙傛暟锛岃缁撳悎鑷韩涓氬姟鍚堢悊璁剧疆
- }
-
- // 姝ラ5锛氬吋鍚湰椤甸潰鐨剆croll浜嬩欢锛屽苟灏嗕竴浜涚姸鎬佸�煎彂閫佺粰宓屽叆鐨勫瓙椤甸潰
- // 涓烘�ц兘鑰冭檻锛屽彲浠ュ湪瀹氭椂鍣ㄤ腑澶勭悊
- var scrollTimer = null
- var scrollDate
- $(window).scroll(function (event) {
- postScrollEvent()
- scrollDate = new Date()
- if (scrollTimer === null) {
- scrollTimer = setTimeout(checkScrollEndTimer, 100)
- }
- })
-
- function checkScrollEndTimer() {
- if (new Date() - scrollDate > 100) { // resize缁撴潫鍚庡啀鍙戞秷鎭紝閬垮厤娈嬪奖闂
- clearTimeout(scrollTimer)
- scrollTimer = null
- } else {
- postScrollEvent()
- setTimeout(checkScrollEndTimer, 100)
- }
- }
-
- function postScrollEvent() {
- // 璁$畻婊氬姩鏉″亸绉婚噺
- var scrollLeftValue = document.documentElement.scrollLeft
- var scrollTopValue = document.documentElement.scrollTop
- iframeWin.contentWindow.postMessage({
- action: 'scroll',
- msg: 'scroll浜嬩欢',
- scrollValue: { // 婊氬姩鏉℃粴鍔ㄧ殑鍋忕Щ閲�
- left: -1 * scrollLeftValue,
- top: -1 * scrollTopValue,
- },
- iframeClientPos: { // iframe鐩稿瑙嗙獥鐨勪綅缃�
- left: iframeWin.getBoundingClientRect().left,
- right: iframeWin.getBoundingClientRect().right,
- top: iframeWin.getBoundingClientRect().top,
- bottom: iframeWin.getBoundingClientRect().bottom
- },
- showSize: { // 鍛婅瘔宓屽叆鐨勫瓙椤甸潰瑙嗙獥楂樺害涓庡搴�
- width: $(window).width(), // 瑙嗙獥瀹藉害
- height: $(window).height() // 瑙嗙獥楂樺害
- },
- iframeOffset: { // iframe鍋忕鏂囨。鐨勪綅缃�
- left: iframeWin.offsetLeft,
- top: iframeWin.offsetTop
- }
- }, '\*') // '\*'琛ㄧず璺ㄥ煙鍙傛暟锛岃缁撳悎鑷韩涓氬姟鍚堢悊璁剧疆
- }
-
-}
\ No newline at end of file
--
Gitblit v1.9.3