修改
This commit is contained in:
TimSpan 2024-07-25 11:40:37 +08:00
parent 61ddfb56f4
commit 7038e38809
6 changed files with 1782 additions and 1736 deletions

File diff suppressed because one or more lines are too long

5
components.d.ts vendored
View File

@ -11,12 +11,17 @@ declare module 'vue' {
500: typeof import('./src/components/errorMessage/500.vue')['default']
AButton: typeof import('ant-design-vue/es')['Button']
AConfigProvider: typeof import('ant-design-vue/es')['ConfigProvider']
ADropdown: typeof import('ant-design-vue/es')['Dropdown']
AForm: typeof import('ant-design-vue/es')['Form']
AFormItem: typeof import('ant-design-vue/es')['FormItem']
AImage: typeof import('ant-design-vue/es')['Image']
AInput: typeof import('ant-design-vue/es')['Input']
AInputPassword: typeof import('ant-design-vue/es')['InputPassword']
AMenu: typeof import('ant-design-vue/es')['Menu']
AMenuItem: typeof import('ant-design-vue/es')['MenuItem']
ASegmented: typeof import('ant-design-vue/es')['Segmented']
ASpin: typeof import('ant-design-vue/es')['Spin']
AStatistic: typeof import('ant-design-vue/es')['Statistic']
ATimeline: typeof import('ant-design-vue/es')['Timeline']
ATimelineItem: typeof import('ant-design-vue/es')['TimelineItem']
ATree: typeof import('ant-design-vue/es')['Tree']

View File

@ -1,19 +1,23 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<!-- <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"> -->
<link rel="icon" type="image/svg+xml" href="/gw.png" style="width:40px;height:40px;" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>多元警情</title>
</head>
<body>
<div id="app"></div>
<script src="https://webapi.amap.com/maps?v=1.4.15&key=8910226d8d36a41d856262b1a588850c&plugin=AMap.MarkerClusterer"></script>
<script src="./jquery-3.4.1.min.js"></script>
<script src="./h5player.min.js"></script>
<script type="module" src="/src/main.ts">
</script>
</body>
<head>
<meta charset="UTF-8" />
<!-- <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"> -->
<link rel="icon" type="image/svg+xml" href="/gw.png" style="width:40px;height:40px;" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>多元警情</title>
</head>
<body>
<div id="app"></div>
<script
src="https://webapi.amap.com/maps?v=1.4.15&key=8910226d8d36a41d856262b1a588850c&plugin=AMap.MarkerClusterer"></script>
<script src="./jquery-3.4.1.min.js"></script>
<script src="./h5player.min.js"></script>
<script type="module" src="/src/main.ts">
</script>
</body>
</html>

View File

@ -4,7 +4,7 @@ import { INDEX_ROUTER, LOGIN_ROUTER } from "@/configs";
/**
* staticRouter ()
*/
export const staticRouter : RouteRecordRaw[] = [
export const staticRouter: RouteRecordRaw[] = [
{
path: "/",
redirect: INDEX_ROUTER.path,
@ -14,7 +14,7 @@ export const staticRouter : RouteRecordRaw[] = [
component: () => import("@/views/login.vue"),
},
{
path:'/index',
path: '/index',
component: () => import('@/views/index.vue'),
redirect: '/index/video',
children: [
@ -53,6 +53,7 @@ export const staticRouter : RouteRecordRaw[] = [
{
path: '/index/hkplay',
component: () => import('@/views/page/hkplay.vue'),
props: route => ({ pointId: route.query.pointId }) // 确保 pointId 参数被正确传递
},
{
path: '/index/system',

View File

@ -3,17 +3,28 @@
</template>
<script lang="ts" setup>
import api from '@/axios'
import { Ref, ref, watch, onMounted, onBeforeMount, reactive, getCurrentInstance } from 'vue'
import { Ref, ref, watch, onMounted, onBeforeMount, onBeforeUnmount, reactive, getCurrentInstance } from 'vue'
import { useRouter } from 'vue-router'
const router = useRouter()
const infoData = ref()
var curIndex = 0 //
let myPlugin: any
onMounted(() => {
var data = {
cameraIndexCode: router.currentRoute.value.query.pointId,
if (typeof window.JSPlugin === 'undefined') {
console.error('JSPlugin is not loaded')
return
} else {
console.log('JSPlugin加载成功')
}
console.log(data)
// ws://218.76.54.6:559/openUrl/aUPPuCy
api.post('/multialarm/video/preview', { pointId: data.cameraIndexCode }).then((res) => {
let date = {
pointId: router.currentRoute.value.query.pointId,
useTLS: 0,
}
if (process.env.NODE_ENV === 'production') {
date.useTLS = 1
}
api.post('/multialarm/video/preview', { ...date }).then((res) => {
console.log('router222', res)
console.log('播放地址', res.data.videoUrl)
var code = res['code']
@ -21,7 +32,7 @@ onMounted(() => {
var playURL = res.data.videoUrl
var IS_MOVE_DEVICE = document.body.clientWidth < 992 //
var MSE_IS_SUPPORT = !!window.MediaSource // mse
var player = new window.JSPlugin({
myPlugin = new window.JSPlugin({
// div#play_windowiWidthiHeight
// iWidth: 600,
// iHeight: 400,
@ -35,52 +46,72 @@ onMounted(() => {
},
bSupporDoubleClickFull: true, //true
})
myPlugin
.JS_SetWindowControlCallback({
pluginErrorHandler: function (index: any, iErrorCode: any, oError: any) {
console.error('__________pluginErrorHandler错误码________________', index, iErrorCode, oError)
var index = 2
playVideo()
//
// do you want...
//
//
},
})
.then((res: any) => {
console.log('JS_SetWindowControlCallback________________', res)
})
var controlIndex = 2
function playVideo() {
console.log('____________playURL:', playURL)
console.log('____________curIndex:', curIndex)
// JS_Play
// JS_Play(url, config, windowIndex, startTime, endTime)
player
myPlugin
.JS_Play(
playURL,
{
playURL: playURL, //
mode: 1, // 0=; 1= 0
},
0 //
curIndex //
)
.then(
() => {
console.info('JS_Play success')
// do you want...
},
(err: any) => {
console.info('JS_Play failed:', err)
(e: any) => {
console.log('网络流中断')
controlIndex--
if (controlIndex <= 0) {
return
}
console.info('JS_Play failed:', e)
playVideo()
// do you want...
}
// () => {
// console.log('realplay success')
// },
// (e) => {
// console.log('?')
// index--
// if (index <= 0) {
// return
// }
// var inUrl = '192.168.10.240:559'
// var outUrl = '218.76.54.20:559'
// playURL = playURL.replace(outUrl, inUrl)
// playVideo()
// }
)
}
playVideo()
} else {
alert('播放失败')
}
})
})
// ws
onBeforeUnmount(() => {
myPlugin.JS_Stop(curIndex).then(
() => {
console.info('JS_Stop success')
// do you want...
},
(err: any) => {
console.info('JS_Stop failed:', err)
// do you want...
}
)
})
</script>
<style scoped lang="scss">

File diff suppressed because it is too large Load Diff