From 32ded7ec5a34e9b486db6db052492cd028659ffa Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Mon, 27 Jun 2022 16:40:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=90=A4=E7=9F=B3=E7=8A=B6=E6=80=81=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/app/lib/controllers/camera/create.js | 2 +- .../api/app/lib/controllers/camera/index.js | 3 +- .../api/app/lib/schedule/freshYingshiMsg.js | 3 +- .../src/components/videoPlayer/videoPlay.jsx | 33 ++++++++++++++----- 4 files changed, 29 insertions(+), 12 deletions(-) diff --git a/code/VideoAccess-VCMP/api/app/lib/controllers/camera/create.js b/code/VideoAccess-VCMP/api/app/lib/controllers/camera/create.js index cb97ebc..c121e88 100644 --- a/code/VideoAccess-VCMP/api/app/lib/controllers/camera/create.js +++ b/code/VideoAccess-VCMP/api/app/lib/controllers/camera/create.js @@ -117,7 +117,7 @@ async function getNvrSteam (ctx) { } const addedRes = await models.Camera.findAll({ - attributes: ['id', 'name', 'serialNo'], + attributes: ['id', 'name', 'serialNo', 'cloudControl'], where: { nvrId: nvrRes.id } 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 47b7ca5..0d274d8 100644 --- a/code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js +++ b/code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js @@ -138,7 +138,8 @@ async function getCameraProject (ctx, next) { } if (camera.type != 'yingshi') { - camera.gbCamera.dataValues.playUrl = getPlayUrl({ topSerialNo: camera.topSerialNo, serialNo: camera.serialNo }) + const playUrl = await getPlayUrl({ topSerialNo: camera.topSerialNo, serialNo: camera.serialNo }) + camera.gbCamera.dataValues.playUrl = playUrl } } diff --git a/code/VideoAccess-VCMP/api/app/lib/schedule/freshYingshiMsg.js b/code/VideoAccess-VCMP/api/app/lib/schedule/freshYingshiMsg.js index 0ab221b..6e9e4fd 100644 --- a/code/VideoAccess-VCMP/api/app/lib/schedule/freshYingshiMsg.js +++ b/code/VideoAccess-VCMP/api/app/lib/schedule/freshYingshiMsg.js @@ -53,7 +53,8 @@ module.exports = function (app, opts) { id: existD.id } }) - + // 状态更新 END + // 状态推送 const { connected } = app.socket.sockets const roomId = 'ROOM_' + Math.random() + '_' + d.deviceSerial 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 bf96296..6035bf6 100644 --- a/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx +++ b/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx @@ -6,15 +6,15 @@ import VideoOperation from './videoOperation' import './videoPlay.less'; const VideoPlay = ({ - height, width, + height, width, type, containerId = 'myPlayer', yingshiToken, // playUrl, - + }) => { const [jessibuca, setjessibuca] = useState(null) const [playUrl, setPlayUrl] = useState( // 'http://flv.bdplay.nodemedia.cn/live/bbb.flv' // TEST - // 'http://221.230.55.27:2020/hdl/36011200002002021114/36011200581314002916.flv', - 'ws://221.230.55.27:8081/jessica/34020000001110000077/34020000001310000003' + 'ws://221.230.55.27:8081/jessica/34020000001110000077/34020000001310000001', + // 'ws://221.230.55.27:8081/jessica/34020000001110000077/34020000001310000003' ) const [isPlaying, setIsPlaying] = useState(false) const [operationState, setoperationState] = useState() @@ -121,12 +121,27 @@ const VideoPlay = ({ {/* 顶部信息 */} {/* 视频内容 */} -
+ { + type == 'yingshi' ? +