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 Coming from './coming'
import ReminderBox from './reminderBox'
import VideoPlay from './videoPlayer/videoPlay'
import VideoPlayModal from './videoPlayer/videoPlayModal'
export {
SimpleFileDownButton,
Coming,
ReminderBox,
VideoPlay,
VideoPlayModal,
};

3
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 };
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';
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,
}
}];

2
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",

Loading…
Cancel
Save