Browse Source

推流播放参数添加

dev_trial
wenlele 3 years ago
parent
commit
5ddfedaf06
  1. 2
      code/VideoAccess-VCMP/api/.vscode/launch.json
  2. 8
      code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js
  3. 15
      code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx
  4. 3
      code/VideoAccess-VCMP/web/client/src/layout/actions/global.js
  5. 2
      code/VideoAccess-VCMP/web/client/src/layout/reducers/global.js
  6. 2
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrCamera.jsx
  7. 7
      code/VideoAccess-VCMP/web/config.js
  8. 2
      code/VideoAccess-VCMP/web/package.json
  9. 5
      code/VideoAccess-VCMP/web/routes/attachment/index.js

2
code/VideoAccess-VCMP/api/.vscode/launch.json

@ -24,7 +24,7 @@
"--godUrl https://restapi.amap.com/v3", "--godUrl https://restapi.amap.com/v3",
"--godKey 21c2d970e1646bb9a795900dd00093ce", "--godKey 21c2d970e1646bb9a795900dd00093ce",
"--mqttVideoServer mqtt://10.8.30.71:30883", "--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", // "--iotVideoServerUrl http://10.8.30.59:8080",
"--cameraPlayWsHost ws://221.230.55.27:8081", "--cameraPlayWsHost ws://221.230.55.27:8081",
"--cameraPlayHttpFlvHost http://221.230.55.27:2020", "--cameraPlayHttpFlvHost http://221.230.55.27:2020",

8
code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js

@ -147,10 +147,10 @@ async function getCameraProject (ctx, next) {
namePresent: corUser ? corUser.namePresent : '' namePresent: corUser ? corUser.namePresent : ''
} }
if (camera.type != 'yingshi') { // if (camera.type != 'yingshi') {
const playUrl = await getPlayUrl({ topSerialNo: camera.topSerialNo, serialNo: camera.serialNo }) // const playUrl = await getPlayUrl({ topSerialNo: camera.topSerialNo, serialNo: camera.serialNo })
camera.gbCamera.dataValues.playUrl = playUrl // camera.gbCamera.dataValues.playUrl = playUrl
} // }
} }
ctx.status = 200; ctx.status = 200;

15
code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx

@ -56,18 +56,19 @@ const VideoPlay = ({ dispatch, actions,
// videoObj = { // videoObj = {
// type: 'cascade', // type: 'cascade',
// audio: false, // audio: false,
// serialNo: '34020000001310000003', // // serialNo: '34020000001310000001', //
// topSerialNo: '34020000001110000079', // // topSerialNo: '34020000001320000001', //
// playUrlSd: 'wss://221.230.55.27:8082/jessica/34020000001110000079/34020000001310000003.flv', // // playUrlSd: 'wss://221.230.55.27:8082/jessica/34020000001320000001/34020000001310000001', //
// // playUrlHd: 'ezopen://open.ys7.com/G75922040/1.hd.live', // // playUrlHd: 'ezopen://open.ys7.com/G75922040/1.hd.live',
// // replayUrl: 'ezopen://open.ys7.com/G75922040/1.rec', // // replayUrl: 'ezopen://open.ys7.com/G75922040/1.rec',
// }, // },
// //
iotVideoServer, iotVideoServer,
iotVideoPlayServer,
local, // local, //
}) => { }) => {
// console.log('1754',videoObj); console.log('1754',videoObj);
if (videoObj.type == 'yingshi') { if (videoObj.type == 'yingshi') {
videoObj = { videoObj = {
...videoObj, ...videoObj,
@ -75,6 +76,11 @@ const VideoPlay = ({ dispatch, actions,
playUrlHd: `ezopen://open.ys7.com/${videoObj.serialNo}/${videoObj.channelNo || '1'}.hd.live`, 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`, 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; const { openness } = actions;
@ -586,6 +592,7 @@ function mapStateToProps (state) {
return { return {
user: auth.user, user: auth.user,
iotVideoServer: global.iotVideoServer, iotVideoServer: global.iotVideoServer,
iotVideoPlayServer: global.iotVideoPlayServer,
actions: global.actions, actions: global.actions,
}; };
} }

3
code/VideoAccess-VCMP/web/client/src/layout/actions/global.js

@ -39,7 +39,8 @@ export function initApiRoot () {
payload: { payload: {
apiRoot: res.root, apiRoot: res.root,
iotAuthWeb: res.iotAuthWeb, iotAuthWeb: res.iotAuthWeb,
iotVideoServer: res.iotVideoServer iotVideoServer: res.iotVideoServer,
iotVideoPlayServer: res.iotVideoPlayServer,
} }
}) })
}); });

2
code/VideoAccess-VCMP/web/client/src/layout/reducers/global.js

@ -13,6 +13,7 @@ function global (state = {
apiRoot: '', apiRoot: '',
iotAuthWeb: '', iotAuthWeb: '',
iotVideoServer: '', iotVideoServer: '',
iotVideoPlayServer:'',
}, action) { }, action) {
const payload = action.payload; const payload = action.payload;
switch (action.type) { switch (action.type) {
@ -34,6 +35,7 @@ function global (state = {
apiRoot: payload.apiRoot, apiRoot: payload.apiRoot,
iotAuthWeb: payload.iotAuthWeb, iotAuthWeb: payload.iotAuthWeb,
iotVideoServer: payload.iotVideoServer, iotVideoServer: payload.iotVideoServer,
iotVideoPlayServer: payload.iotVideoPlayServer,
}).toJS(); }).toJS();
default: default:
return state; return state;

2
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()} onClick={(e) => e.stopPropagation()}
></Input> ></Input>
) : ( ) : (
item.name.length > 12 ? `${item.name.substr(0,12)}...` : item.name item.name?.length > 12 ? `${item.name?.substr(0,12)}...` : item.name
)} )}
</div> </div>
<div <div

7
code/VideoAccess-VCMP/web/config.js

@ -17,6 +17,7 @@ args.option('apiAuthUrl', 'IOT 鉴权 api');
args.option('apiAnxinyunUrl', '安心云 api'); args.option('apiAnxinyunUrl', '安心云 api');
args.option('iotAuthWeb', 'IOT 鉴权 web'); args.option('iotAuthWeb', 'IOT 鉴权 web');
args.option('iotVideoServer', 'IOT 后端视频服务鉴权'); args.option('iotVideoServer', 'IOT 后端视频服务鉴权');
args.option('iotVideoPlayServer', 'IOT 后端视频播放服务');
const flags = args.parse(process.argv); const flags = args.parse(process.argv);
@ -26,8 +27,9 @@ const API_AUTH_URL = process.env.API_AUTH_URL || flags.apiAuthUrl;
const IOT_AUTH_WEB = process.env.IOT_AUTH_WEB || flags.iotAuthWeb; const IOT_AUTH_WEB = process.env.IOT_AUTH_WEB || flags.iotAuthWeb;
const API_ANXINYUN_URL = process.env.API_ANXINYUN_URL || flags.apiAnxinyunUrl; const API_ANXINYUN_URL = process.env.API_ANXINYUN_URL || flags.apiAnxinyunUrl;
const IOT_VIDEO_SERVER = process.env.IOT_VIDEO_SERVER || flags.iotVideoServer; const IOT_VIDEO_SERVER = process.env.IOT_VIDEO_SERVER || flags.iotVideoServer;
const IOT_VIDEO_PALY_SERVER = process.env.IOT_VIDEO_PALY_SERVER || flags.iotVideoPlayServer;
if (!API_URL || !API_ANXINYUN_URL || !API_AUTH_URL || !IOT_AUTH_WEB || !IOT_VIDEO_SERVER) { if (!API_URL || !API_ANXINYUN_URL || !API_AUTH_URL || !IOT_AUTH_WEB || !IOT_VIDEO_SERVER || !IOT_VIDEO_PALY_SERVER) {
console.log('缺少启动参数,异常退出'); console.log('缺少启动参数,异常退出');
args.showHelp(); args.showHelp();
process.exit(-1); process.exit(-1);
@ -60,7 +62,7 @@ const product = {
host: IOT_VIDEO_SERVER, host: IOT_VIDEO_SERVER,
match: /^\/_vs\//, match: /^\/_vs\//,
} }
},{ }, {
// TODO 还不能用 // TODO 还不能用
entry: require('./middlewares/proxy').entry, entry: require('./middlewares/proxy').entry,
opts: { opts: {
@ -73,6 +75,7 @@ const product = {
apiUrl: API_VCMP_URL, apiUrl: API_VCMP_URL,
iotAuthWeb: IOT_AUTH_WEB, iotAuthWeb: IOT_AUTH_WEB,
iotVideoServer: IOT_VIDEO_SERVER, iotVideoServer: IOT_VIDEO_SERVER,
iotVideoPlayServer: IOT_VIDEO_PALY_SERVER,
staticRoot: './client', staticRoot: './client',
} }
}, { }, {

2
code/VideoAccess-VCMP/web/package.json

@ -7,7 +7,7 @@
"test": "mocha", "test": "mocha",
"start-vite": "cross-env NODE_ENV=developmentVite npm run start-params", "start-vite": "cross-env NODE_ENV=developmentVite npm run start-params",
"start": "cross-env NODE_ENV=development npm run start-params", "start": "cross-env NODE_ENV=development npm run start-params",
"start-params": "node server -p 5000 -u http://localhost:4000 --apiVcmpUrl http://localhost:4000 --apiAuthUrl http://localhost:4200 --apiAnxinyunUrl http://localhost:4100 --iotAuthWeb http://localhost:5200 --iotVideoServer http://iotmedia.anxinyun.cn", "start-params": "node server -p 5000 -u http://localhost:4000 --apiVcmpUrl http://localhost:4000 --apiAuthUrl http://localhost:4200 --apiAnxinyunUrl http://localhost:4100 --iotAuthWeb http://localhost:5200 --iotVideoServer https://iotmedia.anxinyun.cn --iotVideoPlayServer wss://221.230.55.27:8082",
"deploy": "export NODE_ENV=production&& npm run build && node server", "deploy": "export NODE_ENV=production&& npm run build && node server",
"build-dev": "cross-env NODE_ENV=development&&webpack --config webpack.config.js", "build-dev": "cross-env NODE_ENV=development&&webpack --config webpack.config.js",
"build": "cross-env NODE_ENV=production&&webpack --config webpack.config.prod.js" "build": "cross-env NODE_ENV=production&&webpack --config webpack.config.prod.js"

5
code/VideoAccess-VCMP/web/routes/attachment/index.js

@ -19,13 +19,14 @@ module.exports = {
entry: function (app, router, opts) { entry: function (app, router, opts) {
const getApiRoot = async function (ctx) { const getApiRoot = async function (ctx) {
const { apiUrl, iotAuthWeb, iotVideoServer } = opts; const { apiUrl, iotAuthWeb, iotVideoServer ,iotVideoPlayServer} = opts;
ctx.status = 200; ctx.status = 200;
ctx.body = { ctx.body = {
root: apiUrl, root: apiUrl,
iotAuthWeb, iotAuthWeb,
iotVideoServer iotVideoServer,
iotVideoPlayServer
}; };
}; };

Loading…
Cancel
Save