Browse Source

视频播放cross

release_0.0.2
巴林闲侠 2 years ago
parent
commit
30ccd213a7
  1. 2
      code/VideoAccess-VCMP/web/client/src/components/index.js
  2. 3
      code/VideoAccess-VCMP/web/client/src/sections/monitor/containers/index.js
  3. 43
      code/VideoAccess-VCMP/web/client/src/sections/monitor/containers/videoPlayCross.jsx
  4. 10
      code/VideoAccess-VCMP/web/client/src/sections/monitor/routes.js
  5. 2
      code/VideoAccess-VCMP/web/package.json

2
code/VideoAccess-VCMP/web/client/src/components/index.js

@ -2,11 +2,13 @@
import SimpleFileDownButton from './simpleFileDownButton' import SimpleFileDownButton from './simpleFileDownButton'
import Coming from './coming' import Coming from './coming'
import ReminderBox from './reminderBox' import ReminderBox from './reminderBox'
import VideoPlay from './videoPlayer/videoPlay'
import VideoPlayModal from './videoPlayer/videoPlayModal' import VideoPlayModal from './videoPlayer/videoPlayModal'
export { export {
SimpleFileDownButton, SimpleFileDownButton,
Coming, Coming,
ReminderBox, ReminderBox,
VideoPlay,
VideoPlayModal, VideoPlayModal,
}; };

3
code/VideoAccess-VCMP/web/client/src/sections/monitor/containers/index.js

@ -1,5 +1,6 @@
'use strict'; 'use strict';
import MonitorCenter from './monitorCenter'; import MonitorCenter from './monitorCenter';
import VideoPlayCross from './videoPlayCross';
export { MonitorCenter }; export { MonitorCenter, VideoPlayCross };

43
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 && <VideoPlay {...videoParams} />
}
</>
)
}
function mapStateToProps (state) {
const { auth } = state;
return {
user: auth.user,
};
}
export default connect(mapStateToProps)(VideoPlayCross);

10
code/VideoAccess-VCMP/web/client/src/sections/monitor/routes.js

@ -1,5 +1,5 @@
'use strict'; 'use strict';
import { MonitorCenter, } from './containers'; import { MonitorCenter, VideoPlayCross } from './containers';
export default [{ export default [{
type: 'inner', type: 'inner',
@ -9,4 +9,12 @@ export default [{
breadcrumb: '数据监控中心', breadcrumb: '数据监控中心',
component: MonitorCenter, component: MonitorCenter,
} }
}, {
type: 'outer',
route: {
path: '/video_play_cross',
key: 'videoPlayCross',
breadcrumb: '',
component: VideoPlayCross,
}
}]; }];

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

@ -52,7 +52,7 @@
"@fs/attachment": "^1.0.0", "@fs/attachment": "^1.0.0",
"@peace/components": "0.0.35", "@peace/components": "0.0.35",
"@peace/utils": "^0.0.48", "@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": "^1.3.1",
"@vitejs/plugin-react-refresh": "^1.3.6", "@vitejs/plugin-react-refresh": "^1.3.6",
"args": "^5.0.1", "args": "^5.0.1",

Loading…
Cancel
Save