Browse Source

打包测试

lite
‘daijinzheng@xingtongworld.com’ 3 years ago
parent
commit
8687974aaa
  1. 1533
      src/views/ty/index.vue
  2. 1124
      src/views/ty/index14.vue
  3. 258
      src/views/ty/index3.vue

1533
src/views/ty/index.vue

File diff suppressed because it is too large

1124
src/views/ty/index14.vue

File diff suppressed because it is too large

258
src/views/ty/index3.vue

@ -0,0 +1,258 @@
<template>
<v-scale-screen width="1920" height="1080">
<div id="ty">
<!-- <video id="playWnd" autoplay></video> -->
<!--预览界面-->
<!-- <div id="operate" class="operate">
<div class="module" style="color:#fff;">
<div class="item"><span class="label">监控点编号</span><input id="cameraIndexCode" type="text" value="">
</div>
<div class="item" style="margin-top: 20px;margin-left: -20px;color:#fff;">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button style="width:20px;padding:0;margin:0;color:#fff;" id="startPreview" class="btn">预览</button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button style="width:90px;padding:0;margin:0;" id="stopAllPreview" class="btn">停止全部预览</button>
</div>
</div>
</div> -->
<!--视频窗口展示-->
<video id="playWnd" autoplay></video>
</div>
</v-scale-screen>
</template>
<script>
// import flvjs from "flv.js";
// import '@/utils/h5player.min.js'
// api
import * as homeApi from '@/api/home'
import $ from "jquery";
// import { getVideoRegionTree, getVideoInfo } from "@/api/realTimeInformation";
export default {
data() {
return {
initCount: 0,
pubKey: '',
oWebControl2: '',
}
},
created() {
// this.$nextTick DOM使DOM
this.$nextTick(() => {
this.initPlugin();
});
},
methods: {
//
initPlugin() {
let _that = this;
const oWebControl = new window.WebControl({
szPluginContainer: 'playWnd', // id
iServicePortStart: 15900, // 使
iServicePortEnd: 15900,
szClassId: '23BF3B0A-2C56-4D97-9C03-0CB103AA8F11', // IE10使ActiveXclsid
cbConnectSuccess() {
console.log('创建WebControl实例成功');
oWebControl.JS_StartService('window', {
// WebControl
dllPath: './VideoPluginConnect.dll', // "./VideoPluginConnect.dll"
})
.then(
() => {
// //
oWebControl.JS_SetWindowControlCallback({
//
cbIntegrationCallBack: _that.cbIntegrationCallBack,
});
oWebControl.JS_CreateWnd('playWnd').then(() => {
//JS_CreateWnd
console.log('111111111111');
_that.init(); //
_that.getVideoFun('05edddc148b141c5930301af43154942')
});
},
() => {
//
console.log('启动插件服务失败');
}
)
.catch((err) => {
console.log(err);
});
},
cbConnectError() {
// WebControl
console.log('xxx');
oWebControl = null;
$('#playWnd').html('插件未启动,正在尝试启动,请稍候...');
window.WebControl.JS_WakeUp('VideoWebPlugin://'); // errorwakeup
this.initCount++;
if (this.initCount < 3) {
setTimeout(function () {
this.initPlugin();
}, 3000);
} else {
$('#playWnd').html('插件启动失败,请检查插件是否安装!');
}
},
cbConnectClose(bNormalClose) {
// bNormalClose = false
// JS_DisconnectbNormalClose = true
console.log('cbConnectClose');
oWebControl = null;
},
});
this.oWebControl2 = oWebControl;
},
//
init() {
let _that = this;
this.getPubKey(function () {
//
var appkey = "28730366"; //appkey
var secret = _that.setEncrypt("HSZkCJpSJ7gSUYrO6wVi"); //secret
var ip = "10.19.132.75"; //IP
var playMode = 0; //0-1-
var port = 443; //HTTPS443
var snapDir = ""; //
var videoDir = "D:\\VideoDir"; //
var layout = "1x1"; //playMode
var enableHTTPS = 1; //HTTPS1
var encryptedFields = "secret"; //secret
var showToolbar = 0; //0-0-
var showSmart = 1; //线0-0-
var buttonIDs = "0,16,256,257,258,259,260,512,513,514,515,516,517,768,769"; //
//
_that.oWebControl2.JS_RequestInterface({
funcName: "init",
argument: JSON.stringify({
appkey: appkey, //APIappkey
secret: secret, //APIsecret
ip: ip, //APIIP
playMode: playMode, //
port: port, //
snapDir: snapDir, //
videoDir: videoDir, //
layout: layout, //
enableHTTPS: enableHTTPS, //HTTPS
encryptedFields: encryptedFields, //
showToolbar: showToolbar, //
showSmart: showSmart, //
buttonIDs: buttonIDs, //
}),
})
.then((oData) => {
let width = document.querySelector("#playWnd").offsetWidth;
let height = document.querySelector("#playWnd").offsetHeight;
_that.oWebControl2.JS_Resize(width, height); // resize
console.log(oData);
});
});
},
//
setCallbacks() {
this.oWebControl.JS_SetWindowControlCallback({
cbIntegrationCallBack: this.cbIntegrationCallBack,
});
},
//
cbIntegrationCallBack(oData) {
//
console.log(oData);
},
//
getPubKey(callback) {
this.oWebControl2.JS_RequestInterface({
funcName: "getRSAPubKey",
argument: JSON.stringify({
keyLength: 1024,
}),
})
.then((oData) => {
if (oData.responseMsg.data) {
this.pubKey = oData.responseMsg.data;
console.log(this.pubKey);
callback();
}
});
},
//RSA
setEncrypt(value) {
var encrypt = new window.JSEncrypt();
encrypt.setPublicKey(this.pubKey);
return encrypt.encrypt(value);
},
//
getVideoFun(Code) {
//
var cameraIndexCode = Code; //
var streamMode = 0; //0-1-
var transMode = 1; //0-UDP1-TCP
var gpuMode = 1; //GPU0-1-
var wndId = -1; //2x2
cameraIndexCode = cameraIndexCode.replace(/(^\s*)/g, "");
cameraIndexCode = cameraIndexCode.replace(/(\s*$)/g, "");
console.log(cameraIndexCode);
this.oWebControl2.JS_RequestInterface({
funcName: "startPreview",
argument: JSON.stringify({
cameraIndexCode: cameraIndexCode, //
streamMode: streamMode, //
transMode: transMode, //
gpuMode: gpuMode, //GPU
wndId: wndId, //
}),
})
.then((res) => {
//
console.log('播放成功')
console.log(res);
},
err => {
console.log('播放失败')
console.log(preUrl);
// console.info('JS_Play failed:', err)
console.info(err)
});
},
//
stopVideoFun() {
this.oWebControl2.JS_RequestInterface({
funcName: "stopAllPreview",
});
},
// ---html
// 使
//
destroyVideoDiv() {
this.oWebControl2.JS_DestroyWnd()
.then((data) => {
console.log("销毁窗口成功");
})
.catch((err) => {
console.log("销毁窗口失败");
});
},
// ---
zhuaPicFun() {
this.oWebControl2.JS_RequestInterface({
funcName: "snapShot",
argument: {
name: "D:\test.jpg", //
},
});
},
},
}
</script>
<style>
.demo-video {
max-width: 880px;
max-height: 660px;
/* background-image: url(../../../src/utils/h5player.min.js); */
}
</style>
Loading…
Cancel
Save