曹煤炭摄像头播放 ---张悦提交

pull/4/head
guoyuepeng 2024-01-12 09:52:58 +08:00
parent a79cd7165e
commit 4c8e9100fd
2 changed files with 167 additions and 3 deletions

View File

@ -250,7 +250,14 @@ var tiandituTk = 'e8a16137fd226a62a23cc7ba5c9c78ce'
var subdomains = ['0', '1', '2', '3', '4', '5', '6', '7'] var subdomains = ['0', '1', '2', '3', '4', '5', '6', '7']
const Cesium = window.Cesium const Cesium = window.Cesium
Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJkOWQ0MGYwMy0yODUwLTQ1YzktOGM4OC02MTMwY2UyZjNlMzQiLCJpZCI6MTY0NTUwLCJpYXQiOjE2OTM4OTU1Mjd9.1cC0sSzyj79LZv0ILNCcl0Mabw6hl8TNngFNFr7H8f4' Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJkOWQ0MGYwMy0yODUwLTQ1YzktOGM4OC02MTMwY2UyZjNlMzQiLCJpZCI6MTY0NTUwLCJpYXQiOjE2OTM4OTU1Mjd9.1cC0sSzyj79LZv0ILNCcl0Mabw6hl8TNngFNFr7H8f4'
// ys使
import axios from 'axios'
// md5
import md5 from 'md5'
const imosPlayer = window.imosPlayer
const iframeObj = null
export default { export default {
components: { components: {
AnquanCfd, AnquanCfd,
@ -1071,15 +1078,171 @@ export default {
iniOne: 0, iniOne: 0,
/* 一公司人员定位 结束*/ /* 一公司人员定位 结束*/
bottomClickDisable: false bottomClickDisable: false,
//
dialogVideoYs: true,
ysVideoInfo: {
vmip: '10.30.20.54',
name: 'loadmin',
passwd: '_Ab54321',
vmport: '7010',
linkPort: '8093',
VIIDPort: '8088'
}
} }
}, },
mounted() { mounted() {
this.initMap() this.initMap()
this.pointBoxCfd = loadMapBoxCfd() this.pointBoxCfd = loadMapBoxCfd()
this.pointBox = loadMapBox() this.pointBox = loadMapBox()
this.ysVideoInit()
}, },
methods: { methods: {
getRandom() {
function S4() {
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1)
}
return S4() + S4() + '-' + S4() + '-' + S4() + '-' + S4() + '-' + S4() + S4() + S4()
},
// keepalive(token) {
// //
// requestFN(
// '/map/loginOrKeepAlive',
// {
// }
// ).then((data) => {
//
// })
// },
// ysVideoInit() {
// //
// var _this = this
// requestFN(
// '/map/loginOrKeepAlive',
// {
// }
// ).then((data) => {
// const token = data.token
// var nbsp = String.fromCharCode(160)
// var arr = []
// arr.length = 40
// const str = arr.fill(nbsp).join('')
// const voidPath = imosPlayer.getUniqueID()
// window.voidPath = voidPath
// document.title = document.title + str + new Date().getTime()
// _this.keepalive(token)
// setInterval(_this.keepalive, 30000, token)
// console.info('-----------1-------------------')
// window.videoWindow = 0
// imosPlayer.setLinkPort('8093')
// imosPlayer
// .init({
// ip: '10.30.20.54',
// token: token,
// title: document.title,
// voidListenerPath: '\\' + voidPath
// })
// .then(async(resr) => {
// console.info('-----------2-------------------')
// if (resr.ErrCode === 0) {
// console.info('-----------3-------------------')
// // imosPlayer.setLiveNetLinkMode(liveNetProtocol, liveByMS)
// // imosPlayer.setReplayNetLinkMode(replayNetProtocol, replayByMS)
//
// // eslint-disable-next-line no-alert
// console.info('')
// } else {
//
// console.info('-----------4-------------------')
// // eslint-disable-next-line no-alert
// console.info(resr.ErrMsg)
// }
// })
// .catch((err) => {
//
// console.info('-----------5-------------------')
// console.error(err)
// })
// })
// },
keepalive(token) {
axios({
method: 'POST',
url: config.ysurl + '/VIID/hadesadapter/user/keepalive',
headers: {
'Content-Type': 'application/json; charset=utf8',
Authorization: token
},
responseType: 'json'
}).then((res) => { })
},
ysVideoInit() {
var _this = this
axios({
method: 'POST',
url: config.ysurl + '/VIID/login/v2', // protocolhttp://
headers: {
'Content-Type': 'application/json; charset=utf8'
},
responseType: 'json'
}).then((res) => {
const AccessCode = res.data.AccessCode// res.bodyres.data
const LoginSignature = md5(btoa(_this.ysVideoInfo.name) + AccessCode + md5(_this.ysVideoInfo.passwd))
axios({
method: 'POST',
url: config.ysurl + '/VIID/login/v2',
headers: {
'Content-Type': 'application/json; charset=utf8'
},
responseType: 'json',
data: {
UserName: _this.ysVideoInfo.name,
AccessCode,
LoginSignature
}
}).then((res) => {
var nbsp = String.fromCharCode(160)
var arr = []
arr.length = 40
const str = arr.fill(nbsp).join('')
const voidPath = imosPlayer.getUniqueID()
window.voidPath = voidPath
document.title = document.title + str + new Date().getTime()
var token = res.data.AccessToken
window.token = res.data.AccessToken
console.log(res)
_this.keepalive(token)
setInterval(_this.keepalive, 30000, token)
window.videoWindow = 0
imosPlayer.setLinkPort('8093')
imosPlayer
.init({
ip: '10.30.20.54',
token: token,
title: document.title,
voidListenerPath: '\\' + voidPath
})
.then(async(resr) => {
if (resr.ErrCode === 0) {
// imosPlayer.setLiveNetLinkMode(liveNetProtocol, liveByMS)
// imosPlayer.setReplayNetLinkMode(replayNetProtocol, replayByMS)
// eslint-disable-next-line no-alert
console.info('登录成功')
} else {
// eslint-disable-next-line no-alert
console.info(resr.ErrMsg)
}
})
.catch((err) => {
console.error(err)
})
})
})
},
initMap() { initMap() {
viewer = new Cesium.Viewer('cesiumContainer', { viewer = new Cesium.Viewer('cesiumContainer', {
// terrainProvider: Cesium.createWorldTerrain() // terrainProvider: Cesium.createWorldTerrain()

View File

@ -1,6 +1,6 @@
const config = { const config = {
weburl: 'http://192.168.0.45:8082/', // 前台地址 weburl: 'http://192.168.0.45:8082/', // 前台地址
httpurl: 'http://192.168.151.56:8092/', // 后台地址 httpurl: 'http://192.168.151.43:8092/', // 后台地址
qyurl: 'http://192.168.0.45:8080/', // 企业前台 qyurl: 'http://192.168.0.45:8080/', // 企业前台
fileUrl: 'http://192.168.192.201:8991/file/', // 附件服务器地址 fileUrl: 'http://192.168.192.201:8991/file/', // 附件服务器地址
publicKey: 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC2zCyUYSD0pNrbtaYdvGfHfWoRV+fo/2N9O2PLLz/jZvMkigkq4eAq4JO+Ek0wDHI9WxP6iTSLYCHhIOs9CQTPvyldJFm8riZtQZlBTD8Plkb3rjrgwTqbBi3w3+HKYdkSvGFXJIdSOPbpXnj5BzN8vlVaybs24R/vpUzG9178lwIDAQAB', publicKey: 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC2zCyUYSD0pNrbtaYdvGfHfWoRV+fo/2N9O2PLLz/jZvMkigkq4eAq4JO+Ek0wDHI9WxP6iTSLYCHhIOs9CQTPvyldJFm8riZtQZlBTD8Plkb3rjrgwTqbBi3w3+HKYdkSvGFXJIdSOPbpXnj5BzN8vlVaybs24R/vpUzG9178lwIDAQAB',
@ -12,5 +12,6 @@ const config = {
perRealTimeLocUrl: '192.168.210.32:8084/netty/test.io', perRealTimeLocUrl: '192.168.210.32:8084/netty/test.io',
cfdfileUrl: 'http://60.2.209.238:8991/file', cfdfileUrl: 'http://60.2.209.238:8991/file',
xfgUrl: 'https://skqhdg.porthebei.com:9006/static/qrcode/views/xgf_hgz/index.html', xfgUrl: 'https://skqhdg.porthebei.com:9006/static/qrcode/views/xgf_hgz/index.html',
messageUrl: 'http://192.168.151.56:8082/static/qrcode/views/xgf_hgz/index.html' messageUrl: 'http://192.168.151.56:8082/static/qrcode/views/xgf_hgz/index.html',
ysurl:'/ysapi'
} }