Browse Source

萤石状态更新逻辑

release_0.0.2
巴林闲侠 2 years ago
parent
commit
32ded7ec5a
  1. 2
      code/VideoAccess-VCMP/api/app/lib/controllers/camera/create.js
  2. 3
      code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js
  3. 3
      code/VideoAccess-VCMP/api/app/lib/schedule/freshYingshiMsg.js
  4. 33
      code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx

2
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
}

3
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
}
}

3
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

33
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 = ({
{/* 顶部信息 */}
<VideoHeader operationState={operationState} changeSelectState={changeSelectState} setoperationState={setoperationState} />
{/* 视频内容 */}
<div id="container"
style={{
height: '100%', width: '100%'
}}>
{
type == 'yingshi' ?
<iframe
frameBorder="0"
id={containerId}
src={`https://open.ys7.com/ezopen/h5/iframe?audio=${'audio' ? '1' : '0'}&url=${playUrl}&autoplay=${1}&accessToken=${yingshiToken}`}
// https://open.ys7.com/doc/zh/book/index/live_proto.html
// {width: 400px;height: 300px;}
width={'100%'}
height={'100%'}
allowFullScreen
wmode="transparent"
/> :
<div id="container"
style={{
height: '100%', width: '100%'
}}>
</div>
}
</div>
{/* 云控 对讲 对应操作内容 */}
<VideoOperation
operationState={operationState} operation={operation}

Loading…
Cancel
Save