|
@@ -8,256 +8,63 @@ const password = "!X2MWvIX!F";
|
|
|
|
|
|
let curIndexCode: any = null;
|
|
|
let token: any = null;
|
|
|
-let jessibuca: any = null;
|
|
|
|
|
|
-const videoTree = [
|
|
|
+const videoCode = [
|
|
|
{
|
|
|
- "id": "70119139",
|
|
|
- "title": "中和村流量站",
|
|
|
- "indexCode": "34102206531322000100",
|
|
|
- "children": []
|
|
|
- },
|
|
|
- {
|
|
|
- "id": "70119129",
|
|
|
- "title": "呈村流量站",
|
|
|
- "indexCode": null,
|
|
|
- "children": []
|
|
|
- },
|
|
|
- {
|
|
|
- "id": "701121001",
|
|
|
- "title": "罗桐埠",
|
|
|
- "indexCode": null,
|
|
|
+ "stcd": "63304700",
|
|
|
+ "stnm": "太师桥",
|
|
|
"children": [
|
|
|
{
|
|
|
- "id": "70112100",
|
|
|
- "title": "站院入口",
|
|
|
- "indexCode": "33018206531322000700",
|
|
|
- "children": []
|
|
|
- },
|
|
|
- {
|
|
|
- "id": "70112100",
|
|
|
- "title": "储藏室",
|
|
|
- "indexCode": "33018206531322000100",
|
|
|
- "children": []
|
|
|
- },
|
|
|
- {
|
|
|
- "id": "70112100",
|
|
|
- "title": "站院一层",
|
|
|
- "indexCode": "33018206531322000200",
|
|
|
- "children": []
|
|
|
- },
|
|
|
- {
|
|
|
- "id": "70112100",
|
|
|
- "title": "站院二层",
|
|
|
- "indexCode": "33018206531322000300",
|
|
|
- "children": []
|
|
|
- },
|
|
|
- {
|
|
|
- "id": "70112100",
|
|
|
- "title": "办公室",
|
|
|
- "indexCode": "33018206531322000500",
|
|
|
- "children": []
|
|
|
+ "id": "0e873d77-3895-4156-81e9-b104bd4868f0",
|
|
|
+ "pid": "06d3322e-eb7b-44e3-8371-a8712e40eee5",
|
|
|
+ "name": "太师桥室外角球机",
|
|
|
+ "mark": "室外2",
|
|
|
+ "code": "33048306531322000300",
|
|
|
},
|
|
|
{
|
|
|
- "id": "70112100",
|
|
|
- "title": "水尺牌",
|
|
|
- "indexCode": "33018206531322000600",
|
|
|
- "children": []
|
|
|
+ "id": "dbe0bac5-93eb-418d-b017-32de9bacc5a9",
|
|
|
+ "pid": "06d3322e-eb7b-44e3-8371-a8712e40eee5",
|
|
|
+ "name": "太师桥室内球机",
|
|
|
+ "mark": "室内",
|
|
|
+ "code": "33048306531322000100",
|
|
|
},
|
|
|
{
|
|
|
- "id": "70112100",
|
|
|
- "title": "观测室",
|
|
|
- "indexCode": "33018206531322000400",
|
|
|
- "children": []
|
|
|
+ "id": "f4c33fc3-283c-457f-aec6-21b245c5f158",
|
|
|
+ "pid": "06d3322e-eb7b-44e3-8371-a8712e40eee5",
|
|
|
+ "name": "太师桥室外栈桥球机",
|
|
|
+ "mark": "室外",
|
|
|
+ "code": "33048306531322000200",
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
- "id": "701114001",
|
|
|
- "title": "街口水文站",
|
|
|
- "indexCode": null,
|
|
|
+ "stcd": "63304650",
|
|
|
+ "stnm": "思源",
|
|
|
"children": [
|
|
|
{
|
|
|
- "id": "70111400",
|
|
|
- "title": "上游跟踪",
|
|
|
- "indexCode": "34102106531322000500",
|
|
|
- "children": []
|
|
|
- },
|
|
|
- {
|
|
|
- "id": "70111400",
|
|
|
- "title": "全景摄像机",
|
|
|
- "indexCode": "34102106531322000100",
|
|
|
- "children": []
|
|
|
+ "id": "df4a993b-a58d-4431-b3ca-4c3e5d68507f",
|
|
|
+ "pid": "1c47a453-bde7-475a-8482-cadb4bc9c1b6",
|
|
|
+ "name": "思源室外",
|
|
|
+ "mark": "室外",
|
|
|
+ "code": "32050906531322002200",
|
|
|
},
|
|
|
{
|
|
|
- "id": "70111400",
|
|
|
- "title": "下游跟踪",
|
|
|
- "indexCode": "34102106531322000400",
|
|
|
- "children": []
|
|
|
- },
|
|
|
- {
|
|
|
- "id": "70111400",
|
|
|
- "title": "上游监控",
|
|
|
- "indexCode": "34102106531322000200",
|
|
|
- "children": []
|
|
|
- },
|
|
|
- {
|
|
|
- "id": "70111400",
|
|
|
- "title": "缆道球机",
|
|
|
- "indexCode": "34102106531322000600",
|
|
|
- "children": []
|
|
|
- },
|
|
|
- {
|
|
|
- "id": "70111400",
|
|
|
- "title": "下游监控",
|
|
|
- "indexCode": "34102106531322000300",
|
|
|
- "children": []
|
|
|
+ "id": "c12e7204-79f2-40d8-804d-8ffe7bf76f32",
|
|
|
+ "pid": "1c47a453-bde7-475a-8482-cadb4bc9c1b6",
|
|
|
+ "name": "思源室内",
|
|
|
+ "mark": "室内",
|
|
|
+ "code": "32050906531322002100",
|
|
|
}
|
|
|
]
|
|
|
- },
|
|
|
- {
|
|
|
- "id": "63313001",
|
|
|
- "title": "梅台港桥水文站",
|
|
|
- "indexCode": "33042106531322001100",
|
|
|
- "children": []
|
|
|
- },
|
|
|
- {
|
|
|
- "id": "63312411",
|
|
|
- "title": "陶庄枢纽",
|
|
|
- "indexCode": "33042106531322001000",
|
|
|
- "children": []
|
|
|
- },
|
|
|
- {
|
|
|
- "id": "63312340",
|
|
|
- "title": "大舜枢纽水文站",
|
|
|
- "indexCode": "33042106531322000800",
|
|
|
- "children": []
|
|
|
- },
|
|
|
- {
|
|
|
- "id": "63312300",
|
|
|
- "title": "丁栅枢纽水文站",
|
|
|
- "indexCode": "33042106531322000900",
|
|
|
- "children": []
|
|
|
- },
|
|
|
- {
|
|
|
- "id": "63304730",
|
|
|
- "title": "文桥水文站",
|
|
|
- "indexCode": "32050906531322002300",
|
|
|
- "children": []
|
|
|
- },
|
|
|
- {
|
|
|
- "id": "633047001",
|
|
|
- "title": "太师桥",
|
|
|
- "indexCode": null,
|
|
|
- "children": [
|
|
|
- {
|
|
|
- "id": "63304700",
|
|
|
- "title": "太师桥室外角球机",
|
|
|
- "indexCode": "33048306531322000300",
|
|
|
- "children": []
|
|
|
- },
|
|
|
- {
|
|
|
- "id": "63304700",
|
|
|
- "title": "太师桥室内球机",
|
|
|
- "indexCode": "33048306531322000200",
|
|
|
- "children": []
|
|
|
- },
|
|
|
- {
|
|
|
- "id": "63304700",
|
|
|
- "title": "太师桥室外栈桥球机",
|
|
|
- "indexCode": "33048306531322000100",
|
|
|
- "children": []
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- "id": "633046501",
|
|
|
- "title": "思源",
|
|
|
- "indexCode": null,
|
|
|
- "children": [
|
|
|
- {
|
|
|
- "id": "63304650",
|
|
|
- "title": "思源室内",
|
|
|
- "indexCode": "32050906531322002100",
|
|
|
- "children": []
|
|
|
- },
|
|
|
- {
|
|
|
- "id": "63304650",
|
|
|
- "title": "思源室外",
|
|
|
- "indexCode": "32050906531322002200",
|
|
|
- "children": []
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- "id": "63301700",
|
|
|
- "title": "北虹大桥站室外",
|
|
|
- "indexCode": "33041106531322000100",
|
|
|
- "children": []
|
|
|
- },
|
|
|
- {
|
|
|
- "id": "63205690",
|
|
|
- "title": "太平桥",
|
|
|
- "indexCode": "33041106531322000200",
|
|
|
- "children": []
|
|
|
- },
|
|
|
- {
|
|
|
- "id": "63205680",
|
|
|
- "title": "双林桥 ",
|
|
|
- "indexCode": "32050906531322002400",
|
|
|
- "children": []
|
|
|
- },
|
|
|
- {
|
|
|
- "id": "63205670",
|
|
|
- "title": "章湾圩公路桥",
|
|
|
- "indexCode": "32050906531322002500",
|
|
|
- "children": []
|
|
|
- },
|
|
|
- {
|
|
|
- "id": "111111111",
|
|
|
- "title": "新安江水文实验站试验场",
|
|
|
- "indexCode": null,
|
|
|
- "children": [
|
|
|
- {
|
|
|
- "id": "11111111",
|
|
|
- "title": "天然径流场(小)",
|
|
|
- "indexCode": "34102206531322000200",
|
|
|
- "children": []
|
|
|
- },
|
|
|
- {
|
|
|
- "id": "11111111",
|
|
|
- "title": "气象场、人工降雨场",
|
|
|
- "indexCode": "34102206531322000300",
|
|
|
- "children": []
|
|
|
- },
|
|
|
- {
|
|
|
- "id": "11111111",
|
|
|
- "title": "天然径流场(大)",
|
|
|
- "indexCode": "34102206531322000400",
|
|
|
- "children": []
|
|
|
- },
|
|
|
- {
|
|
|
- "id": "11111111",
|
|
|
- "title": "小流域监测",
|
|
|
- "indexCode": "34102206531322000500",
|
|
|
- "children": []
|
|
|
- },
|
|
|
- {
|
|
|
- "id": "11111111",
|
|
|
- "title": "实验场入口",
|
|
|
- "indexCode": "34102206531322000600",
|
|
|
- "children": []
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- "id": "63305451",
|
|
|
- "title": "圣塘桥(下)",
|
|
|
- "indexCode": "33041106531322000300",
|
|
|
- "children": []
|
|
|
}
|
|
|
]
|
|
|
|
|
|
+export function getVideoCodeByMark(stcd: string, mark: string) {
|
|
|
+ const videos = videoCode.find(v => v.stcd === stcd)
|
|
|
+ const video = videos?.children.find(v => v.mark === mark)
|
|
|
+ return video?.code || null
|
|
|
+}
|
|
|
+
|
|
|
function encryptPwd() {
|
|
|
const first_md5 = MD5(password).toString().toUpperCase();
|
|
|
console.log(first_md5);
|
|
@@ -280,46 +87,17 @@ async function getToken() {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-export function init(container: any) {
|
|
|
- const decoderSrc = '/decoder.js'
|
|
|
- jessibuca = new window.Jessibuca({
|
|
|
- decoder: decoderSrc,
|
|
|
- container: container.value,
|
|
|
- videoBuffer: 0.2, // 缓存时长
|
|
|
- isResize: false,
|
|
|
- text: "",
|
|
|
- loadingText: "",
|
|
|
- useMSE: false,
|
|
|
- debug: true,
|
|
|
- showBandwidth: true, // 显示网速
|
|
|
- operateBtns: {
|
|
|
- fullscreen: true,
|
|
|
- screenshot: true,
|
|
|
- play: true,
|
|
|
- audio: false,
|
|
|
- recorder: false
|
|
|
- },
|
|
|
- forceNoOffscreen: true,
|
|
|
- isNotMute: false,
|
|
|
- });
|
|
|
+function getsiteList(stid: string, authorization = token) {
|
|
|
+ getSiteList(stid, authorization)
|
|
|
}
|
|
|
|
|
|
-export async function playVideo(code: string) {
|
|
|
+export async function getVideoSrc(code: string) {
|
|
|
if (!token) {
|
|
|
await getToken()
|
|
|
}
|
|
|
-
|
|
|
- closeVideo(curIndexCode, token);
|
|
|
- getvideoUrl(code, token);
|
|
|
-}
|
|
|
-
|
|
|
-//获取视频地址并进行播放
|
|
|
-function getvideoUrl(videoNm = curIndexCode, authorization = token) {
|
|
|
- curIndexCode = videoNm;
|
|
|
- getVideoUrl(videoNm, authorization).then(res => {
|
|
|
- debugger
|
|
|
- jessibuca.play(res.data.ws_flv);
|
|
|
- })
|
|
|
+ closeVideo();
|
|
|
+ curIndexCode = code;
|
|
|
+ return await getVideoUrl(curIndexCode, token).then(res => res.data.https_fmp4).catch(() => null)
|
|
|
}
|
|
|
|
|
|
export function closeVideo(videoNm = curIndexCode, authorization = token) {
|
|
@@ -332,7 +110,3 @@ export function closeVideo(videoNm = curIndexCode, authorization = token) {
|
|
|
console.log(res);
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
-function getsiteList(stid: string, authorization = token) {
|
|
|
- getSiteList(stid, authorization)
|
|
|
-}
|