diff --git a/code/VideoAccess-VCMP/web/client/src/components/index.js b/code/VideoAccess-VCMP/web/client/src/components/index.js index 71c4dac..5e7f4a7 100644 --- a/code/VideoAccess-VCMP/web/client/src/components/index.js +++ b/code/VideoAccess-VCMP/web/client/src/components/index.js @@ -2,11 +2,13 @@ import SimpleFileDownButton from './simpleFileDownButton' import Coming from './coming' import ReminderBox from './reminderBox' +import VideoPlay from './videoPlayer/videoPlay' import VideoPlayModal from './videoPlayer/videoPlayModal' export { SimpleFileDownButton, Coming, ReminderBox, + VideoPlay, VideoPlayModal, }; 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 7f06116..de8fc32 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 @@ -1,5 +1,6 @@ 'use strict'; import MonitorCenter from './monitorCenter'; +import VideoPlayCross from './videoPlayCross'; -export { MonitorCenter }; \ No newline at end of file +export { MonitorCenter, VideoPlayCross }; \ No newline at end of file diff --git a/code/VideoAccess-VCMP/web/client/src/sections/monitor/containers/videoPlayCross.jsx b/code/VideoAccess-VCMP/web/client/src/sections/monitor/containers/videoPlayCross.jsx new file mode 100644 index 0000000..5adbff0 --- /dev/null +++ b/code/VideoAccess-VCMP/web/client/src/sections/monitor/containers/videoPlayCross.jsx @@ -0,0 +1,43 @@ +import React, { useEffect, useState } from 'react'; +import { connect } from 'react-redux'; +import { VideoPlay } from '$components' +import '../style.less' + +const VideoPlayCross = (props) => { + const [videoParams, setVideoParams] = useState(null) + + useEffect(() => { + function messageListen (e) { + // 此处需做 域名 验证 + const { data } = e + if (data && data.action) { + if (data.action == 'init_video') { + setVideoParams(data.params) + } + } + } + + if (window.parent) { + window.addEventListener('message', messageListen); + } + return () => { + window.removeEventListener('message', messageListen); + } + }, []) + return ( + <> + { + videoParams && + } + + ) +} + +function mapStateToProps (state) { + const { auth } = state; + return { + user: auth.user, + }; +} + +export default connect(mapStateToProps)(VideoPlayCross); \ No newline at end of file diff --git a/code/VideoAccess-VCMP/web/client/src/sections/monitor/routes.js b/code/VideoAccess-VCMP/web/client/src/sections/monitor/routes.js index a181158..0009f51 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/monitor/routes.js +++ b/code/VideoAccess-VCMP/web/client/src/sections/monitor/routes.js @@ -1,5 +1,5 @@ 'use strict'; -import { MonitorCenter, } from './containers'; +import { MonitorCenter, VideoPlayCross } from './containers'; export default [{ type: 'inner', @@ -9,4 +9,12 @@ export default [{ breadcrumb: '数据监控中心', component: MonitorCenter, } +}, { + type: 'outer', + route: { + path: '/video_play_cross', + key: 'videoPlayCross', + breadcrumb: '', + component: VideoPlayCross, + } }]; \ No newline at end of file diff --git a/code/VideoAccess-VCMP/web/package.json b/code/VideoAccess-VCMP/web/package.json index 49195d3..8046d4c 100644 --- a/code/VideoAccess-VCMP/web/package.json +++ b/code/VideoAccess-VCMP/web/package.json @@ -52,7 +52,7 @@ "@fs/attachment": "^1.0.0", "@peace/components": "0.0.35", "@peace/utils": "^0.0.48", - "@semi-bot/semi-theme-fsiot": "0.0.1", + "@semi-bot/semi-theme-fsiot": "^0.0.2", "@vitejs/plugin-react": "^1.3.1", "@vitejs/plugin-react-refresh": "^1.3.6", "args": "^5.0.1",