1.删除不用的引用,优化第一次打开的时候慢的问题

pet_li_6.6
guoyuepeng 2024-04-30 11:48:59 +08:00
parent 9825bd63c5
commit 6656305cf7
3 changed files with 16 additions and 59 deletions

View File

@ -9,7 +9,7 @@
<!-- <link href="./static/map/cesium109/Widgets/widgets.css" rel="stylesheet"/>-->
<link rel="stylesheet" href="https://g.alicdn.com/de/prismplayer/2.16.0/skins/default/aliplayer-min.css" />
<script type="text/javascript" charset="utf-8" src="https://g.alicdn.com/de/prismplayer/2.16.0/aliplayer-min.js"></script>
<script type="text/javascript" charset="utf-8" src="http://10.30.20.54:8093/static/imosPlayer.min.js"></script>
<!-- <script type="text/javascript" charset="utf-8" src="http://10.30.20.54:8093/static/imosPlayer.min.js"></script>-->
<script type="text/javascript" charset="utf-8" src="https://api.tianditu.gov.cn/api?v=4.0&tk=e8a16137fd226a62a23cc7ba5c9c78ce"></script>
<script type="text/javascript" src="./static/map/cesium91/CesiumUnminified/Cesium.js"></script>

View File

@ -16,7 +16,7 @@
<script>
import { requestFN } from '@/utils/request'
const imosPlayer = window.imosPlayer
// const imosPlayer = window.imosPlayer
let iframeObj = null
export default {
@ -65,19 +65,19 @@ export default {
},
methods: {
showYsVideo() {
iframeObj = imosPlayer.createPanelWindow()
var dom = document.getElementById('aLiVideoPlayer')
iframeObj.style.margin = 'auto'
dom.appendChild(iframeObj)
imosPlayer
.playLive(iframeObj.id, {
camera: this.id,
title: this.id,
stream: 1
})
.then((e) => {
console.log(e)
})
// iframeObj = imosPlayer.createPanelWindow()
// var dom = document.getElementById('aLiVideoPlayer')
// iframeObj.style.margin = 'auto'
// dom.appendChild(iframeObj)
// imosPlayer
// .playLive(iframeObj.id, {
// camera: this.id,
// title: this.id,
// stream: 1
// })
// .then((e) => {
// console.log(e)
// })
},
showVideo() {
let url = this.requestUrl

View File

@ -296,7 +296,7 @@ import axios from 'axios'
// md5
import md5 from 'md5'
const imosPlayer = window.imosPlayer
// const imosPlayer = window.imosPlayer
var PI = 3.1415926535897932384626
var a = 6378245.0 //
var ee = 0.00669342162296594323 // 椭球的偏心率。//判断是否在国内在中国国内的经纬度才需要做偏移
@ -1176,49 +1176,6 @@ export default {
})
},
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)
window.videoWindow = 0
imosPlayer.setLinkPort('8093')
imosPlayer
.init({
ip: '172.14.0.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)
})
})
},
// keepalive(token) {
// axios({