视频 geoserver地址 和 脚本加载优化
This commit is contained in:
4
env.js
4
env.js
@@ -12,12 +12,14 @@ const envConfig = {
|
|||||||
baseURL: 'http://192.168.2.59:8081',//http://192.168.2.56:8081
|
baseURL: 'http://192.168.2.59:8081',//http://192.168.2.56:8081
|
||||||
//baseURL: 'http://1.95.137.212:59015',//http://192.168.2.56:8081
|
//baseURL: 'http://1.95.137.212:59015',//http://192.168.2.56:8081
|
||||||
WS_URL: 'ws://192.168.2.59:9002/ws/',
|
WS_URL: 'ws://192.168.2.59:9002/ws/',
|
||||||
|
geoserver_url: "http://192.168.2.59:7000/geoserver"
|
||||||
},
|
},
|
||||||
[ENV.PROD]: {
|
[ENV.PROD]: {
|
||||||
//baseURL: 'https://pvcloudservice.satabot.com',
|
//baseURL: 'https://pvcloudservice.satabot.com',
|
||||||
baseURL: 'http://1.95.137.212:59015',//http://192.168.2.56:8081
|
baseURL: 'http://1.95.137.212:59015',//http://192.168.2.56:8081
|
||||||
//baseURL: 'https://serviceri.satabot.com',
|
//baseURL: 'https://serviceri.satabot.com',
|
||||||
WS_URL: 'ws://1.95.137.212:59017/ws/'
|
WS_URL: 'ws://1.95.137.212:59017/ws/',
|
||||||
|
geoserver_url: "http://1.95.137.212:59018/geoserver"
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
11
index.html
11
index.html
@@ -22,7 +22,11 @@
|
|||||||
href="https://lf-unpkg.volccdn.com/obj/vcloudfe/sdk/@volcengine/veplayer/2.11.2/umd/veplayer.production.css"
|
href="https://lf-unpkg.volccdn.com/obj/vcloudfe/sdk/@volcengine/veplayer/2.11.2/umd/veplayer.production.css"
|
||||||
media="print" onload="this.media='all'">
|
media="print" onload="this.media='all'">
|
||||||
<script src="/js/jswebrtc.min.js"></script>
|
<script src="/js/jswebrtc.min.js"></script>
|
||||||
<script src="/js/jswebrtcnew.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/cesium@latest/Build/Cesium/Cesium.js"></script>
|
||||||
|
|
||||||
|
<script src="/js/leaflet.js"></script>
|
||||||
|
<script src="/js/hls.js"></script>
|
||||||
|
<script src="/js/veplayer.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
@@ -48,10 +52,7 @@
|
|||||||
Promise.resolve()
|
Promise.resolve()
|
||||||
//.then(() => loadScript('/js/jswebrtc.min.js'))
|
//.then(() => loadScript('/js/jswebrtc.min.js'))
|
||||||
//.then(() => loadScript('/js/jswebrtcnew.js'))
|
//.then(() => loadScript('/js/jswebrtcnew.js'))
|
||||||
.then(() => loadScript('https://unpkg.com/leaflet@1.9.4/dist/leaflet.js'))
|
//.then(() => loadScript('https://cdn.jsdelivr.net/npm/cesium@latest/Build/Cesium/Cesium.js'))
|
||||||
.then(() => loadScript('https://cdn.jsdelivr.net/npm/cesium@latest/Build/Cesium/Cesium.js'))
|
|
||||||
.then(() => loadScript('https://cdn.jsdelivr.net/npm/hls.js@1.5.8/dist/hls.min.js'))
|
|
||||||
.then(() => loadScript('https://lf-unpkg.volccdn.com/obj/vcloudfe/sdk/@volcengine/veplayer/2.11.2/umd/veplayer.production.js'))
|
|
||||||
.then(() => {
|
.then(() => {
|
||||||
console.log('✅ 所有地图/视频SDK加载完成');
|
console.log('✅ 所有地图/视频SDK加载完成');
|
||||||
window.CESIUM_BASE_URL = "https://cdnjs.cloudflare.com/ajax/libs/cesium/1.114.0/";
|
window.CESIUM_BASE_URL = "https://cdnjs.cloudflare.com/ajax/libs/cesium/1.114.0/";
|
||||||
|
|||||||
2
public/js/hls.js
Normal file
2
public/js/hls.js
Normal file
File diff suppressed because one or more lines are too long
3
public/js/jswebrtc.min.js
vendored
3
public/js/jswebrtc.min.js
vendored
File diff suppressed because one or more lines are too long
6
public/js/leaflet.js
Normal file
6
public/js/leaflet.js
Normal file
File diff suppressed because one or more lines are too long
1
public/js/veplayer.js
Normal file
1
public/js/veplayer.js
Normal file
File diff suppressed because one or more lines are too long
@@ -7,6 +7,8 @@ import droneInspectImg from '../assets/images/xunjiancar.png';
|
|||||||
import gecaocar from '../assets/images/gecaocar.png';
|
import gecaocar from '../assets/images/gecaocar.png';
|
||||||
import arrowImg from '../assets/images/arrow.png';
|
import arrowImg from '../assets/images/arrow.png';
|
||||||
import iotImg from '../assets/images/iot.png';
|
import iotImg from '../assets/images/iot.png';
|
||||||
|
import envConfig from '../../env';
|
||||||
|
|
||||||
|
|
||||||
const CYAN_ALARM_COLOR = new window.Cesium.Color(
|
const CYAN_ALARM_COLOR = new window.Cesium.Color(
|
||||||
34 / 255,
|
34 / 255,
|
||||||
@@ -307,7 +309,7 @@ export default function CesiumMap({ realtimePosition, pathPoints = [], devices =
|
|||||||
}
|
}
|
||||||
|
|
||||||
function fetchPublishedLayers() {
|
function fetchPublishedLayers() {
|
||||||
const baseUrl = "http://192.168.2.59:7000/geoserver";
|
const baseUrl = envConfig.geoserver_url;
|
||||||
//const baseUrl = 'https://gis.caasrobot.com/geoserver';
|
//const baseUrl = 'https://gis.caasrobot.com/geoserver';
|
||||||
const getCapabilitiesUrl = `${baseUrl}/wms?service=WMS&version=1.1.1&request=GetCapabilities`;
|
const getCapabilitiesUrl = `${baseUrl}/wms?service=WMS&version=1.1.1&request=GetCapabilities`;
|
||||||
|
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ export default function DeviceStatusPage({
|
|||||||
|
|
||||||
const { video: robotVideo, error, ready } = useWebRTCPlayer(
|
const { video: robotVideo, error, ready } = useWebRTCPlayer(
|
||||||
serialNumber || '',
|
serialNumber || '',
|
||||||
`webrtc://ri.satabot.com/live/livestream/${serialNumber}`,
|
`webrtc://1.95.137.212/live/livestream/${serialNumber}`,
|
||||||
);
|
);
|
||||||
const getVal = (val) => val === "no_rain" ? "无" : (val || '-');
|
const getVal = (val) => val === "no_rain" ? "无" : (val || '-');
|
||||||
|
|
||||||
@@ -320,7 +320,7 @@ export default function DeviceStatusPage({
|
|||||||
|
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
height: 450,
|
//height: 450,
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
overflow: 'hidden',
|
overflow: 'hidden',
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ export function useWebRTCPlayer(deviceId: string, url: string) {
|
|||||||
v.style.height = '100%';
|
v.style.height = '100%';
|
||||||
v.style.objectFit = 'contain';
|
v.style.objectFit = 'contain';
|
||||||
videoRef.current = v;
|
videoRef.current = v;
|
||||||
const token = "eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6Ijk2ZTQyYzJlLTYwNWMtNGU5MS05ZTJkLWE2NWUxM2VjZTMyZiJ9.l-F0LGxnfUD2WuATaHK7bYlguorGpGkkOR3Qpga7CWU1S_GiRI6U3At0gjOqx7DasZS7ChVsC_Csp6DX6HfArw"
|
const token = "eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjY0MDVjNDgwLTAxNDYtNDAwNS1iY2RiLTFhMTM2YzlmYmFiMCJ9.V1GQiLr0xgu9LB59pGyYPFeVJfKwDsUtTacFrQDpXdEvD81uOkJO304tROF5Ewev6eXkZFuunUAEiMLWEfh2_w"
|
||||||
//const token = localStorage.getItem('videotoken') || JSON.parse(localStorage.getItem('userInfo') || '{}')?.token;
|
//const token = localStorage.getItem('videotoken') || JSON.parse(localStorage.getItem('userInfo') || '{}')?.token;
|
||||||
const videoUrl = `${url}?token=${token}`;
|
const videoUrl = `${url}?token=${token}`;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user