diff --git a/src/assets/icon39-active.png b/src/assets/icon39-active.png new file mode 100644 index 0000000..0bee7b2 Binary files /dev/null and b/src/assets/icon39-active.png differ diff --git a/src/assets/icon39.png b/src/assets/icon39.png new file mode 100644 index 0000000..4532223 Binary files /dev/null and b/src/assets/icon39.png differ diff --git a/src/assets/icon40-active.png b/src/assets/icon40-active.png new file mode 100644 index 0000000..9ad60ad Binary files /dev/null and b/src/assets/icon40-active.png differ diff --git a/src/assets/icon40.png b/src/assets/icon40.png new file mode 100644 index 0000000..848aa97 Binary files /dev/null and b/src/assets/icon40.png differ diff --git a/src/assets/icon41-active.png b/src/assets/icon41-active.png new file mode 100644 index 0000000..a7d8911 Binary files /dev/null and b/src/assets/icon41-active.png differ diff --git a/src/assets/icon41.png b/src/assets/icon41.png new file mode 100644 index 0000000..61aae36 Binary files /dev/null and b/src/assets/icon41.png differ diff --git a/src/assets/icon42-active.png b/src/assets/icon42-active.png new file mode 100644 index 0000000..d6c9027 Binary files /dev/null and b/src/assets/icon42-active.png differ diff --git a/src/assets/icon42.png b/src/assets/icon42.png new file mode 100644 index 0000000..d629558 Binary files /dev/null and b/src/assets/icon42.png differ diff --git a/src/components/StupWizard/index.module.scss b/src/components/StupWizard/index.module.scss index f773921..b40247d 100644 --- a/src/components/StupWizard/index.module.scss +++ b/src/components/StupWizard/index.module.scss @@ -1,85 +1,91 @@ // 设置向导 .stupWizard { + height: 70vh; display: flex; - flex-direction: column; - >div:nth-child(1) { - padding: 20px 0 0; - overflow-x: hidden; - max-height: 60vh; + .stupWizardLeft { + background-color: #0C111A; + flex-shrink: 0; + width: 154px; + height: 100%; overflow-y: auto; - >div:nth-child(1) { - color: #EEEEEE; - font-weight: bold; - font-size: 20px; - } - - >div:nth-child(2) { - >div { - display: flex; - align-items: center; - margin-top: 22px; - - >span { - flex-shrink: 0; - color: #828282; - font-size: 18px; - width: 130px; - } - } - } - - >div:nth-child(3) { - margin-top: 34px; + >div { + display: flex; + align-items: center; + cursor: pointer; + padding: 12px 16px; + box-sizing: border-box; >span { - color: #828282; - font-size: 18px; + color: #EEEEEE; + font-size: 16px; + margin-left: 10px; + } + + >img { + height: 20px; + } + } + + .active { + background-color: #131924; + + >span { + color: #5575F2; + } + } + } + + .stupWizardRight { + flex-grow: 1; + height: 100%; + + >div { + display: flex; + flex-direction: column; + height: 100%; + + >span { + flex-shrink: 0; + color: #FFFFFF; + font-size: 16px; + border-bottom: 1px solid #292E33; + padding: 10px 20px; + box-sizing: border-box; } >div { - display: flex; - align-items: center; - margin-top: 20px; - - >img { - flex-shrink: 0; - width: 36px; - margin-right: 20px; - } - - >div { - flex-grow: 1; - height: 40px; - position: relative; - - >img { - height: 100%; - } - - >div { - position: absolute; - left: 0; - top: 0; - height: 100%; - width: 0%; - overflow: hidden; - - >img { - height: 100%; - } - } - } + flex-grow: 1; + overflow-y: auto; + padding: 20px; + box-sizing: border-box; } } } +} + +.videoComponents { + >div:nth-child(1) { + width: 100%; + height: 296px; + border-radius: 10px; + overflow: hidden; + + >video { + width: 100%; + height: 100%; + } + } >div:nth-child(2) { - flex-shrink: 0; + width: 100%; + margin-top: 10px; display: flex; align-items: center; - justify-content: flex-end; - margin-top: 20px; + + >span { + color: white; + } } } \ No newline at end of file diff --git a/src/components/StupWizard/index.tsx b/src/components/StupWizard/index.tsx index fae419a..1a177d3 100644 --- a/src/components/StupWizard/index.tsx +++ b/src/components/StupWizard/index.tsx @@ -1,20 +1,45 @@ import styles from '@/components/StupWizard/index.module.scss' import ImageUrl from '@/utils/package/ImageUrl'; -import { Button, message, Modal, Select, Slider } from 'antd'; -import { useState, useImperativeHandle, forwardRef } from "react"; +import { Button, Empty, message, Modal, Select, Slider } from 'antd'; +import { useState, useImperativeHandle, forwardRef, useEffect } from "react"; import agora from '@/utils/package/agora' const StupWizard = forwardRef((props: any, ref: any) => { useImperativeHandle(ref, () => ({ - changeIsStupWizard: () => { + changeModal: () => { + agora.init() setIsStupWizard(true) - getAudioMediaList(true) - agora.startPlaybackDeviceTest() - agora.setPlaybackDeviceVolume(100) + // getAudioMediaList(true) + // agora.startPlaybackDeviceTest() + // agora.setPlaybackDeviceVolume(100) } })) + const [list, setList] = useState([ + { + title: '视频', + icon: ImageUrl.icon39, + iconActive: ImageUrl.icon39Active, + active: true, + }, + { + title: '音频', + icon: ImageUrl.icon40, + iconActive: ImageUrl.icon40Active, + active: false, + }, + { + title: '录制', + icon: ImageUrl.icon41, + iconActive: ImageUrl.icon41Active, + active: false, + }, + { + title: '共享文件', + icon: ImageUrl.icon42, + iconActive: ImageUrl.icon42Active, + active: false, + } + ]) const [isStupWizard, setIsStupWizard] = useState(false); - const [stepsStatus, setStepsStatus] = useState(1); - const [isVideoLoad, setIsVideoLoad] = useState(false); const [audioDeviceManager, setAudioDeviceManager] = useState({ currentDevices: [], currentDevice: {}, @@ -34,164 +59,122 @@ const StupWizard = forwardRef((props: any, ref: any) => { currentVolume, }) } - // 音频设置向导 - // 视频测试 return ( <> - +
-
-
音频设置向导
-
-
- 音频输出设备: - { - setAudioDeviceManager({ - ...audioDeviceManager, - currentDevice: e - }) - agora.setRecordingDevice(e); - getAudioMediaList() - }} />; - -
- {stepsStatus ?
- 调节声音大小: - { - setAudioDeviceManager({ - ...audioDeviceManager, - currentVolume: e - }) - agora.setRecordingDeviceVolume(e) - }} style={{ flexGrow: 1 }} /> -
: -
- 视频预览: - -
- } -
-
- 您可以对着麦克风说话,试听表克风的输入质量 -
- -
- -
- -
-
-
-
-
-
-
- -
-
- - -
- -
-
*/}
) }) + +const VideoComponents = () => { + const [videoDeviceManager, setVideoDeviceManager] = useState({ + list: [], + item: null, + }); + useEffect(() => { + getVideoDeviceList() + }, []); + const getVideoDeviceList = (): void => { + agora.getVideoDeviceManager().then(res => { + const { item, list } = res + setVideoDeviceManager({ + list: list.map((row: any) => { + return { + value: row.deviceId, + label: row.deviceName + } + }), + item: item ? item : null, + }) + agora.startPreview('videoPreview') + }) + } + return ( + <> +
+ 视频 +
+ { + videoDeviceManager.item ? +
+ +
: +
+ } +
+ 摄像头: +