Commit 4b9c13d7 authored by 张伯涛's avatar 张伯涛

视频监控模块代码合并

parent 067db927
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</div> </div>
<!-- <div> <!-- <div>
点击此处前往海康平台下载视频播放插件 点击此处前往海康平台下载视频播放插件
</div> --> </div> -->
</el-card> </el-card>
<div class="videoPlayer" id="playWnd"> <div class="videoPlayer" id="playWnd">
...@@ -96,7 +96,7 @@ var pubKey = ''; ...@@ -96,7 +96,7 @@ var pubKey = '';
var playWnd_width = window.innerWidth - 200; var playWnd_width = window.innerWidth - 200;
var playWnd_height = window.innerHeight - 220; var playWnd_height = window.innerHeight - 220;
var oWebControl; var oWebControl;
var videoIp; var videoIp="218.69.97.198";;
var videoPort=1443; var videoPort=1443;
const enterpriseId = ref(null); const enterpriseId = ref(null);
enterpriseId.value = store.getters.getEnterpriseId(); enterpriseId.value = store.getters.getEnterpriseId();
...@@ -234,8 +234,8 @@ function visibleCascader(isshow) { ...@@ -234,8 +234,8 @@ function visibleCascader(isshow) {
} }
} }
$(document).ready(function () { $(document).ready(async function () {
initIp();//ip await initIp();//ip
initPlugin(); initPlugin();
$('#startPlay').click( $('#startPlay').click(
function () { function () {
...@@ -327,7 +327,9 @@ function cbIntegrationCallBack(oData) { ...@@ -327,7 +327,9 @@ function cbIntegrationCallBack(oData) {
//初始化ip //初始化ip
async function initIp(){ async function initIp(){
const res = await fetch('https://api.ipify.org?format=json'); var res;
try{
res = await fetch('https://api.ipify.org?format=json');
const data = await res.json(); const data = await res.json();
var serverIP = data.ip; var serverIP = data.ip;
if(serverIP === "111.160.132.74" || serverIP === "218.69.97.198"){ if(serverIP === "111.160.132.74" || serverIP === "218.69.97.198"){
...@@ -335,11 +337,18 @@ async function initIp(){ ...@@ -335,11 +337,18 @@ async function initIp(){
}else{ }else{
videoIp="218.69.97.198"; videoIp="218.69.97.198";
} }
}catch(e){
videoIp="218.69.97.198";
}
videoPort=1443; videoPort=1443;
} }
//初始化插件 //初始化插件
function init() { function init() {
getPubKey(function () { getPubKey(function () {
console.log("ip:"+videoIp); console.log("ip:"+videoIp);
////////////////////////////////// 请自行修改以下变量值 //////////////////////////////////// ////////////////////////////////// 请自行修改以下变量值 ////////////////////////////////////
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment