diff --git a/code/VideoAccess-VCMP/api/.vscode/launch.json b/code/VideoAccess-VCMP/api/.vscode/launch.json index 6e40169..1445146 100644 --- a/code/VideoAccess-VCMP/api/.vscode/launch.json +++ b/code/VideoAccess-VCMP/api/.vscode/launch.json @@ -24,7 +24,7 @@ "--godUrl https://restapi.amap.com/v3", "--godKey 21c2d970e1646bb9a795900dd00093ce", "--mqttVideoServer mqtt://10.8.30.71:30883", - "--iotVideoServerUrl http://221.230.55.27:8081", + "--iotVideoServerUrl http://10.8.30.42:8082", // "--iotVideoServerUrl http://10.8.30.59:8080", "--cameraPlayWsHost ws://221.230.55.27:8081", "--cameraPlayHttpFlvHost http://221.230.55.27:2020", diff --git a/code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js b/code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js index 4fdb38c..2049729 100644 --- a/code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js +++ b/code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js @@ -147,10 +147,10 @@ async function getCameraProject (ctx, next) { namePresent: corUser ? corUser.namePresent : '' } - if (camera.type != 'yingshi') { - const playUrl = await getPlayUrl({ topSerialNo: camera.topSerialNo, serialNo: camera.serialNo }) - camera.gbCamera.dataValues.playUrl = playUrl - } + // if (camera.type != 'yingshi') { + // const playUrl = await getPlayUrl({ topSerialNo: camera.topSerialNo, serialNo: camera.serialNo }) + // camera.gbCamera.dataValues.playUrl = playUrl + // } } ctx.status = 200; diff --git a/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx b/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx index 9989cdf..2e5961e 100644 --- a/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx +++ b/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx @@ -56,18 +56,19 @@ const VideoPlay = ({ dispatch, actions, // videoObj = { // type: 'cascade', // audio: false, - // serialNo: '34020000001310000003', // 设备序列号 必须 - // topSerialNo: '34020000001110000079', // 设备顶级序列号 必须 - // playUrlSd: 'wss://221.230.55.27:8082/jessica/34020000001110000079/34020000001310000003.flv', // 必须 + // serialNo: '34020000001310000001', // 设备序列号 必须 + // topSerialNo: '34020000001320000001', // 设备顶级序列号 必须 + // playUrlSd: 'wss://221.230.55.27:8082/jessica/34020000001320000001/34020000001310000001', // 必须 // // playUrlHd: 'ezopen://open.ys7.com/G75922040/1.hd.live', // // replayUrl: 'ezopen://open.ys7.com/G75922040/1.rec', // }, // iotVideoServer, + iotVideoPlayServer, local, //是否本地调用视频 }) => { - // console.log('1754',videoObj); + console.log('1754',videoObj); if (videoObj.type == 'yingshi') { videoObj = { ...videoObj, @@ -75,6 +76,11 @@ const VideoPlay = ({ dispatch, actions, playUrlHd: `ezopen://open.ys7.com/${videoObj.serialNo}/${videoObj.channelNo || '1'}.hd.live`, replayUrl: `ezopen://open.ys7.com/${videoObj.serialNo}/${videoObj.channelNo || '1'}.hd.local.rec`, } + }else { + videoObj = { + ...videoObj, + playUrlSd: `${iotVideoPlayServer}/jessica/${videoObj.topSerialNo}/${videoObj.serialNo}`, + } } const { openness } = actions; @@ -586,6 +592,7 @@ function mapStateToProps (state) { return { user: auth.user, iotVideoServer: global.iotVideoServer, + iotVideoPlayServer: global.iotVideoPlayServer, actions: global.actions, }; } diff --git a/code/VideoAccess-VCMP/web/client/src/layout/actions/global.js b/code/VideoAccess-VCMP/web/client/src/layout/actions/global.js index fa2a4cc..b6789e5 100644 --- a/code/VideoAccess-VCMP/web/client/src/layout/actions/global.js +++ b/code/VideoAccess-VCMP/web/client/src/layout/actions/global.js @@ -39,7 +39,8 @@ export function initApiRoot () { payload: { apiRoot: res.root, iotAuthWeb: res.iotAuthWeb, - iotVideoServer: res.iotVideoServer + iotVideoServer: res.iotVideoServer, + iotVideoPlayServer: res.iotVideoPlayServer, } }) }); diff --git a/code/VideoAccess-VCMP/web/client/src/layout/reducers/global.js b/code/VideoAccess-VCMP/web/client/src/layout/reducers/global.js index 1385fb9..292a1f1 100644 --- a/code/VideoAccess-VCMP/web/client/src/layout/reducers/global.js +++ b/code/VideoAccess-VCMP/web/client/src/layout/reducers/global.js @@ -13,6 +13,7 @@ function global (state = { apiRoot: '', iotAuthWeb: '', iotVideoServer: '', + iotVideoPlayServer:'', }, action) { const payload = action.payload; switch (action.type) { @@ -34,6 +35,7 @@ function global (state = { apiRoot: payload.apiRoot, iotAuthWeb: payload.iotAuthWeb, iotVideoServer: payload.iotVideoServer, + iotVideoPlayServer: payload.iotVideoPlayServer, }).toJS(); default: return state; diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrCamera.jsx b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrCamera.jsx index ca80619..8cf779b 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrCamera.jsx +++ b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrCamera.jsx @@ -368,7 +368,7 @@ function nvrCamera ({ dispatch, actions, nvrRef, cameraData, addNvr, nvrNumber, onClick={(e) => e.stopPropagation()} > ) : ( - item.name.length > 12 ? `${item.name.substr(0,12)}...` : item.name + item.name?.length > 12 ? `${item.name?.substr(0,12)}...` : item.name )}