CODE
1 year ago
9 changed files with 18680 additions and 181 deletions
@ -0,0 +1,2 @@ |
|||||
|
*development.txt |
||||
|
console/log/development.txt |
@ -1 +1 @@ |
|||||
window.FS_API_ROOT = 'http://10.8.30.183:4100' |
window.FS_API_ROOT = 'http://127.0.0.1:4100' |
@ -0,0 +1,71 @@ |
|||||
|
import React, { useEffect, useState, useRef } from 'react' |
||||
|
import { push } from 'react-router-redux'; |
||||
|
import { connect } from 'react-redux'; |
||||
|
import flvjs from 'flv.js' |
||||
|
import { getVideo } from '../actions' |
||||
|
import { Modal } from 'antd' |
||||
|
|
||||
|
const VideoModal = ({ dispatch, onCancel }) => { |
||||
|
const [video, setVideo] = useState({}) |
||||
|
const flvPlayer = useRef() |
||||
|
|
||||
|
useEffect(() => { |
||||
|
dispatch(getVideo()).then(res => { |
||||
|
console.log(res); |
||||
|
if (res.success) { |
||||
|
setVideo(res.payload.data) |
||||
|
const container = document.getElementById('video-play'); |
||||
|
const flv = flvjs.createPlayer({ |
||||
|
type: 'flv', |
||||
|
url: `${res.payload.data.ws_flv}`, |
||||
|
isLive: true, |
||||
|
hasAudio: false, |
||||
|
hasVideo: true, |
||||
|
}, { |
||||
|
enableWorker: false, |
||||
|
enalleStashBuffer: true, |
||||
|
stashInitialSize: 128, |
||||
|
lazyLoadMaxDuration: 3 * 60, |
||||
|
seekType: 'range', |
||||
|
autoCleanupSourceBuffer: true, |
||||
|
cors: true, |
||||
|
}); |
||||
|
flv.attachMediaElement(container); |
||||
|
flv.load(); |
||||
|
flv.play(); |
||||
|
flvPlayer.current = flv |
||||
|
} |
||||
|
}) |
||||
|
}, []) |
||||
|
|
||||
|
return ( |
||||
|
<Modal |
||||
|
title="监控视频" |
||||
|
open={true} |
||||
|
onOk={() => { }} |
||||
|
onCancel={() => { |
||||
|
onCancel() |
||||
|
}} |
||||
|
width={'64%'} |
||||
|
style={{}} |
||||
|
footer={null} |
||||
|
> |
||||
|
<video |
||||
|
id={'video-play'} |
||||
|
autoPlay muted controls |
||||
|
style={{ height: '100%', width: '100%', }} |
||||
|
> |
||||
|
|
||||
|
</video> |
||||
|
</Modal> |
||||
|
) |
||||
|
} |
||||
|
|
||||
|
function mapStateToProps (state) { |
||||
|
const { crane } = state; |
||||
|
return { |
||||
|
craneData: crane.data || {} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
export default connect(mapStateToProps)(VideoModal); |
File diff suppressed because it is too large
@ -1,105 +1,106 @@ |
|||||
{ |
{ |
||||
"name": "fs-anxincloud-4.0", |
"name": "fs-anxincloud-4.0", |
||||
"version": "1.0.0", |
"version": "1.0.0", |
||||
"description": "anxincloud-4.0", |
"description": "anxincloud-4.0", |
||||
"main": "main.js", |
"main": "main.js", |
||||
"scripts": { |
"scripts": { |
||||
"elctr": "electron .", |
"elctr": "electron .", |
||||
"test": "mocha", |
"test": "mocha", |
||||
"start-elctr-forge": "electron-forge start", |
"start-elctr-forge": "electron-forge start", |
||||
"start": "cross-env NODE_ENV=development npm run start-params", |
"start": "cross-env NODE_ENV=development npm run start-params", |
||||
"start-params": "node server -p 5400 -u http://10.8.30.183:4100", |
"start-params": "node server -p 5400 -u http://127.0.0.1:4100", |
||||
"deploy": "export NODE_ENV=production && npm run build && node server", |
"deploy": "export NODE_ENV=production && npm run build && node server", |
||||
"build-dev": "set NODE_ENV=development&&webpack --config webpack.config.js", |
"build-dev": "set NODE_ENV=development&&webpack --config webpack.config.js", |
||||
"build": "set NODE_ENV=production&&webpack --config webpack.config.prod.js", |
"build": "set NODE_ENV=production&&webpack --config webpack.config.prod.js", |
||||
"package": "electron-forge package", |
"package": "electron-forge package", |
||||
"make": "electron-forge make" |
"make": "electron-forge make" |
||||
}, |
}, |
||||
"keywords": [ |
"keywords": [ |
||||
"app" |
"app" |
||||
], |
], |
||||
"author": "fs", |
"author": "fs", |
||||
"license": "ISC", |
"license": "ISC", |
||||
"devDependencies": { |
"devDependencies": { |
||||
"@babel/core": "^7.14.6", |
"@babel/core": "^7.14.6", |
||||
"@babel/plugin-proposal-class-properties": "^7.14.5", |
"@babel/plugin-proposal-class-properties": "^7.14.5", |
||||
"@babel/plugin-proposal-object-rest-spread": "^7.14.7", |
"@babel/plugin-proposal-object-rest-spread": "^7.14.7", |
||||
"@babel/plugin-transform-runtime": "^7.14.5", |
"@babel/plugin-transform-runtime": "^7.14.5", |
||||
"@babel/polyfill": "^7.12.1", |
"@babel/polyfill": "^7.12.1", |
||||
"@babel/preset-env": "^7.14.7", |
"@babel/preset-env": "^7.14.7", |
||||
"@babel/preset-react": "^7.14.5", |
"@babel/preset-react": "^7.14.5", |
||||
"@electron-forge/cli": "^6.0.5", |
"@electron-forge/cli": "^6.0.5", |
||||
"@electron-forge/maker-deb": "^6.0.5", |
"@electron-forge/maker-deb": "^6.0.5", |
||||
"@electron-forge/maker-rpm": "^6.0.5", |
"@electron-forge/maker-rpm": "^6.0.5", |
||||
"@electron-forge/maker-squirrel": "^6.0.5", |
"@electron-forge/maker-squirrel": "^6.0.5", |
||||
"@electron-forge/maker-zip": "^6.0.5", |
"@electron-forge/maker-zip": "^6.0.5", |
||||
"babel-loader": "^8.2.2", |
"babel-loader": "^8.2.2", |
||||
"babel-plugin-import": "^1.13.3", |
"babel-plugin-import": "^1.13.3", |
||||
"babel-polyfill": "^6.26.0", |
"babel-polyfill": "^6.26.0", |
||||
"connected-react-router": "^6.8.0", |
"connected-react-router": "^6.8.0", |
||||
"css-loader": "^3.5.0", |
"css-loader": "^3.5.0", |
||||
"electron": "^23.1.3", |
"electron": "^23.1.3", |
||||
"electron-reloader": "^1.2.3", |
"electron-reloader": "^1.2.3", |
||||
"express": "^4.17.1", |
"express": "^4.17.1", |
||||
"file-loader": "^6.0.0", |
"file-loader": "^6.0.0", |
||||
"html-webpack-plugin": "^4.5.0", |
"html-webpack-plugin": "^4.5.0", |
||||
"immutable": "^4.0.0-rc.12", |
"immutable": "^4.0.0-rc.12", |
||||
"less": "^3.12.2", |
"less": "^3.12.2", |
||||
"less-loader": "^7.0.2", |
"less-loader": "^7.0.2", |
||||
"natty-fetch": "^2.5.3", |
"natty-fetch": "^2.5.3", |
||||
"nprogress": "^0.2.0", |
"nprogress": "^0.2.0", |
||||
"path-to-regexp": "^2.4.0", |
"path-to-regexp": "^2.4.0", |
||||
"perfect-scrollbar": "^1.5.5", |
"perfect-scrollbar": "^1.5.5", |
||||
"react": "^17.0.0", |
"react": "^17.0.0", |
||||
"react-copy-to-clipboard": "^5.0.1", |
"react-copy-to-clipboard": "^5.0.1", |
||||
"react-dnd": "^10.0.2", |
"react-dnd": "^10.0.2", |
||||
"react-dnd-html5-backend": "^10.0.2", |
"react-dnd-html5-backend": "^10.0.2", |
||||
"react-dom": "^17.0.0", |
"react-dom": "^17.0.0", |
||||
"react-if": "^2.2.1", |
"react-if": "^2.2.1", |
||||
"react-jsonschema-form": "^1.8.1", |
"react-jsonschema-form": "^1.8.1", |
||||
"react-quill": "^1.3.5", |
"react-quill": "^1.3.5", |
||||
"react-redux": "^7.2.1", |
"react-redux": "^7.2.1", |
||||
"react-router-dom": "^5.2.0", |
"react-router-dom": "^5.2.0", |
||||
"react-router-redux": "^4.0.8", |
"react-router-redux": "^4.0.8", |
||||
"redux": "^4.0.5", |
"redux": "^4.0.5", |
||||
"redux-thunk": "^2.3.0", |
"redux-thunk": "^2.3.0", |
||||
"redux-undo": "^1.0.1", |
"redux-undo": "^1.0.1", |
||||
"style-loader": "^2.0.0", |
"style-loader": "^2.0.0", |
||||
"webpack": "^5.3.2", |
"webpack": "^5.3.2", |
||||
"webpack-bundle-analyzer": "^4.1.0", |
"webpack-bundle-analyzer": "^4.1.0", |
||||
"webpack-cli": "^4.2.0", |
"webpack-cli": "^4.2.0", |
||||
"webpack-dev-middleware": "^4.0.2", |
"webpack-dev-middleware": "^4.0.2", |
||||
"webpack-hot-middleware": "^2.25.0" |
"webpack-hot-middleware": "^2.25.0" |
||||
}, |
}, |
||||
"dependencies": { |
"dependencies": { |
||||
"@ant-design/icons": "^4.6.2", |
"@ant-design/icons": "^4.6.2", |
||||
"@ant-design/pro-form": "^1.34.0", |
"@ant-design/pro-form": "^1.34.0", |
||||
"@ant-design/pro-table": "^2.48.0", |
"@ant-design/pro-table": "^2.48.0", |
||||
"@antv/g6": "^4.2.5", |
"@antv/g6": "^4.2.5", |
||||
"@fs/attachment": "^1.0.0", |
"@fs/attachment": "^1.0.0", |
||||
"@peace/components": "0.0.35", |
"@peace/components": "0.0.35", |
||||
"@peace/utils": "0.0.37", |
"@peace/utils": "0.0.37", |
||||
"ahooks": "^3.7.4", |
"ahooks": "^3.7.4", |
||||
"ali-oss": "^6.17.1", |
"ali-oss": "^6.17.1", |
||||
"antd": "^4.24.5", |
"antd": "^4.24.5", |
||||
"args": "^5.0.1", |
"args": "^5.0.1", |
||||
"cross-env": "^7.0.3", |
"cross-env": "^7.0.3", |
||||
"crypto-js": "^4.1.1", |
"crypto-js": "^4.1.1", |
||||
"echarts": "^5.4.1", |
"echarts": "^5.4.1", |
||||
"echarts-for-react": "^3.0.2", |
"echarts-for-react": "^3.0.2", |
||||
"electron-squirrel-startup": "^1.0.0", |
"electron-squirrel-startup": "^1.0.0", |
||||
"file-saver": "^2.0.5", |
"file-saver": "^2.0.5", |
||||
"fs-attachment": "^1.0.0", |
"flv.js": "^1.6.2", |
||||
"fs-web-server-scaffold": "^1.0.6", |
"fs-attachment": "^1.0.0", |
||||
"koa-better-http-proxy": "^0.2.5", |
"fs-web-server-scaffold": "^1.0.6", |
||||
"koa-proxy": "^1.0.0-alpha.3", |
"koa-better-http-proxy": "^0.2.5", |
||||
"koa-view": "^2.1.4", |
"koa-proxy": "^1.0.0-alpha.3", |
||||
"moment": "^2.22.0", |
"koa-view": "^2.1.4", |
||||
"npm": "^7.20.6", |
"moment": "^2.22.0", |
||||
"react-router-breadcrumbs-hoc": "^4.0.1", |
"npm": "^7.20.6", |
||||
"superagent": "^6.1.0", |
"react-router-breadcrumbs-hoc": "^4.0.1", |
||||
"uuid": "^8.3.1", |
"superagent": "^6.1.0", |
||||
"webpack-dev-server": "^3.11.2", |
"uuid": "^8.3.1", |
||||
"xlsx": "^0.16.9" |
"webpack-dev-server": "^3.11.2", |
||||
} |
"xlsx": "^0.16.9" |
||||
|
} |
||||
} |
} |
||||
|
Loading…
Reference in new issue