This commit is contained in:
parent
9eb85d1bd2
commit
459d5c1a49
|
|
@ -108,6 +108,8 @@ const Meeting: React.FC = () => {
|
||||||
const [currentVideoId, setCurrentVideoId] = useState('')
|
const [currentVideoId, setCurrentVideoId] = useState('')
|
||||||
let [currentSeconds, setCurrentSeconds] = useState(0)
|
let [currentSeconds, setCurrentSeconds] = useState(0)
|
||||||
const [currentEffective, setCurrentEffective] = useState(0)
|
const [currentEffective, setCurrentEffective] = useState(0)
|
||||||
|
const [isComputerAudio, setIsComputerAudio] = useState(true)
|
||||||
|
const [isFluencyPriority, setIsFluencyPriority] = useState(true)
|
||||||
const [open, setOpen] = useState(false)
|
const [open, setOpen] = useState(false)
|
||||||
const [modeOpen, setModeOpen] = useState(false)
|
const [modeOpen, setModeOpen] = useState(false)
|
||||||
const [meetingMode, setMeetingMode] = useState('')
|
const [meetingMode, setMeetingMode] = useState('')
|
||||||
|
|
@ -470,7 +472,7 @@ const Meeting: React.FC = () => {
|
||||||
const footerListTemplate = [...footerList]
|
const footerListTemplate = [...footerList]
|
||||||
footerListTemplate[footerListIndex.itemIndex][footerListIndex.rowIndex].title = '停止共享'
|
footerListTemplate[footerListIndex.itemIndex][footerListIndex.rowIndex].title = '停止共享'
|
||||||
setIsSharedScreenModal(false)
|
setIsSharedScreenModal(false)
|
||||||
await agora.setDesktopCapturerVideo(sharedScreenItem)
|
await agora.setDesktopCapturerVideo(sharedScreenItem, isComputerAudio, isFluencyPriority)
|
||||||
await allUserLook(user.screenShareId)
|
await allUserLook(user.screenShareId)
|
||||||
} else {
|
} else {
|
||||||
message.error('请选择应用!')
|
message.error('请选择应用!')
|
||||||
|
|
@ -972,9 +974,14 @@ const Meeting: React.FC = () => {
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<Checkbox onChange={() => {
|
<div>
|
||||||
|
<Checkbox onChange={(e) => {
|
||||||
}}>共享电脑音频</Checkbox>
|
setIsComputerAudio(e.target.checked)
|
||||||
|
}} checked={isComputerAudio}>共享电脑音频</Checkbox>
|
||||||
|
<Checkbox onChange={(e) => {
|
||||||
|
setIsFluencyPriority(e.target.checked)
|
||||||
|
}} checked={isFluencyPriority}>流畅度优先</Checkbox>
|
||||||
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<Button type="primary" onClick={() => { setIsSharedScreenModal(false) }} style={{ backgroundColor: '#31353A', marginRight: '14px' }}>取消</Button>
|
<Button type="primary" onClick={() => { setIsSharedScreenModal(false) }} style={{ backgroundColor: '#31353A', marginRight: '14px' }}>取消</Button>
|
||||||
<Button type="primary" className='m-ant-btn' onClick={() => clickSharedScreen()}>共享</Button>
|
<Button type="primary" className='m-ant-btn' onClick={() => clickSharedScreen()}>共享</Button>
|
||||||
|
|
|
||||||
|
|
@ -154,6 +154,7 @@ const agora = {
|
||||||
// 停止共享屏幕
|
// 停止共享屏幕
|
||||||
stopScreenCapture: () => {
|
stopScreenCapture: () => {
|
||||||
rtcEngine.stopScreenCapture();
|
rtcEngine.stopScreenCapture();
|
||||||
|
rtcEngine.enableLoopbackRecording(false)
|
||||||
},
|
},
|
||||||
// 取消或恢复发布本地音频流
|
// 取消或恢复发布本地音频流
|
||||||
muteLocalAudioStream: (mute: any) => {
|
muteLocalAudioStream: (mute: any) => {
|
||||||
|
|
@ -183,11 +184,22 @@ const agora = {
|
||||||
return rtcEngine.getScreenCaptureSources({ width: 300, height: 300 }, { width: 300, height: 300 }, true);
|
return rtcEngine.getScreenCaptureSources({ width: 300, height: 300 }, { width: 300, height: 300 }, true);
|
||||||
},
|
},
|
||||||
// 共享屏幕采集
|
// 共享屏幕采集
|
||||||
setDesktopCapturerVideo: async (targetSource: any) => {
|
setDesktopCapturerVideo: async (targetSource: any, isComputerAudio: boolean, isFluencyPriority: boolean) => {
|
||||||
// await rtcEngine.stopCameraCapture(option.sourceType)
|
|
||||||
const user = JSON.parse(storage.getItem('user') as string)
|
const user = JSON.parse(storage.getItem('user') as string)
|
||||||
agora.stopScreenCapture();
|
agora.stopScreenCapture();
|
||||||
rtcEngine.enableLoopbackRecording(true)
|
if (isComputerAudio) {
|
||||||
|
rtcEngine.enableLoopbackRecording(true)
|
||||||
|
}
|
||||||
|
let data = {};
|
||||||
|
if (isFluencyPriority) {
|
||||||
|
data = {
|
||||||
|
frameRate: 15,
|
||||||
|
dimensions: {
|
||||||
|
window: 3000,
|
||||||
|
height: 3000,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
targetSource.type ===
|
targetSource.type ===
|
||||||
ScreenCaptureSourceType.ScreencapturesourcetypeScreen
|
ScreenCaptureSourceType.ScreencapturesourcetypeScreen
|
||||||
|
|
@ -199,6 +211,7 @@ const agora = {
|
||||||
windowFocus: true,
|
windowFocus: true,
|
||||||
enableHighLight: true,
|
enableHighLight: true,
|
||||||
highLightColor: 0xFF99CC00,
|
highLightColor: 0xFF99CC00,
|
||||||
|
...data
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -209,6 +222,7 @@ const agora = {
|
||||||
windowFocus: true,
|
windowFocus: true,
|
||||||
enableHighLight: true,
|
enableHighLight: true,
|
||||||
highLightColor: 0xFF99CC00,
|
highLightColor: 0xFF99CC00,
|
||||||
|
...data
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue