diff --git a/code/VideoAccess-VCMP/web/client/src/sections/monitor/containers/index.js b/code/VideoAccess-VCMP/web/client/src/sections/monitor/containers/index.js index de8fc32..92b0a50 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/monitor/containers/index.js +++ b/code/VideoAccess-VCMP/web/client/src/sections/monitor/containers/index.js @@ -2,5 +2,6 @@ import MonitorCenter from './monitorCenter'; import VideoPlayCross from './videoPlayCross'; +import VideoPlayStatus from './videoPlayStatus'; -export { MonitorCenter, VideoPlayCross }; \ No newline at end of file +export { MonitorCenter, VideoPlayCross, VideoPlayStatus }; \ No newline at end of file diff --git a/code/VideoAccess-VCMP/web/client/src/sections/monitor/containers/videoPlayStatus.js b/code/VideoAccess-VCMP/web/client/src/sections/monitor/containers/videoPlayStatus.js new file mode 100644 index 0000000..a2d82fa --- /dev/null +++ b/code/VideoAccess-VCMP/web/client/src/sections/monitor/containers/videoPlayStatus.js @@ -0,0 +1,52 @@ +import React, { useEffect, useState } from 'react'; +import EZUIKit from 'ezuikit-js' +import qs from "qs"; + +const VideoPlayStatus = (props) => { + const [playState, setPlayState] = useState({}) + + useEffect(() => { + const params = qs.parse(props.location.search.slice(1)) + /** + * query 查询参数 + * + * ysToken 萤石token + * serialNo 序列号 + * channelNo 通道号 默认 1 + */ + const player = new EZUIKit.EZUIKitPlayer({ + id: 'video_play_check_dom', // 视频容器ID + accessToken: params?.ysToken, + url: `ezopen://open.ys7.com/${params.serialNo}/${params.channelNo || '1'}.live`, + width: 400, + height: 300, + handleSuccess: (e) => { + console.log(e); + setPlayState(e) + }, + handleError: (e) => { + console.log(e); + console.log(e.retcode); + setPlayState(e) + }, + }) + }, []) + + return ( +
status_code = 0 则播放成功
+status_code:{playState.retcode}
+status_message: {playState.msg}
+status_type:{playState.type}
+