From 66aedb8ccde8914238f8e9b8dc46421a9e93ea46 Mon Sep 17 00:00:00 2001
From: CODE <1650192445@qq.com>
Date: Fri, 18 Aug 2023 09:59:55 +0800
Subject: [PATCH] =?UTF-8?q?master=20=E5=90=8C=E6=AD=A5=E5=88=86=E6=94=AF?=
=?UTF-8?q?=E6=95=B0=E6=8D=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.gitignore | 2 +
console/client/assets/env.js | 2 +-
.../src/sections/console/actions/index.js | 26 +
.../sections/console/components/videoModal.js | 71 +
.../src/sections/console/containers/index.js | 425 +-
.../src/sections/console/containers/setUp.js | 123 +-
console/client/src/utils/webapi.js | 3 +
console/package-lock.json | 18002 ++++++++++++++++
console/package.json | 207 +-
9 files changed, 18680 insertions(+), 181 deletions(-)
create mode 100644 .gitignore
create mode 100644 console/client/src/sections/console/components/videoModal.js
create mode 100644 console/package-lock.json
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..36192d2
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+*development.txt
+console/log/development.txt
diff --git a/console/client/assets/env.js b/console/client/assets/env.js
index 48039f9..a7647fe 100644
--- a/console/client/assets/env.js
+++ b/console/client/assets/env.js
@@ -1 +1 @@
-window.FS_API_ROOT = 'http://10.8.30.183:4100'
\ No newline at end of file
+window.FS_API_ROOT = 'http://127.0.0.1:4100'
\ No newline at end of file
diff --git a/console/client/src/sections/console/actions/index.js b/console/client/src/sections/console/actions/index.js
index f5b0af1..25528a3 100644
--- a/console/client/src/sections/console/actions/index.js
+++ b/console/client/src/sections/console/actions/index.js
@@ -26,7 +26,33 @@ export function getCrane (params) {
});
}
+export function getVideo (params) {
+ return dispatch => basicAction({
+ type: 'get',
+ query: params,
+ dispatch: dispatch,
+ actionType: 'GET_VIDEO',
+ url: ApiTable.videoGet,
+ msg: { error: '获取视频信息失败' },
+ reducer: { name: 'video' }
+ });
+}
+
+export function logoutApp (params) {
+ return dispatch => basicAction({
+ type: 'post',
+ query: params,
+ dispatch: dispatch,
+ actionType: 'LOGOUT_APP',
+ url: ApiTable.logoutApp,
+ msg: { error: '退出应用失败' },
+ });
+}
+
+
export default {
editCrane,
getCrane,
+ getVideo,
+ logoutApp,
}
\ No newline at end of file
diff --git a/console/client/src/sections/console/components/videoModal.js b/console/client/src/sections/console/components/videoModal.js
new file mode 100644
index 0000000..0782b10
--- /dev/null
+++ b/console/client/src/sections/console/components/videoModal.js
@@ -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 (
+