优化加入房间
This commit is contained in:
parent
bcd3adaf26
commit
54fb4ca40f
|
|
@ -49,17 +49,17 @@ const Meeting: React.FC = () => {
|
||||||
const [footerList, setFooterList] = useState<any>([
|
const [footerList, setFooterList] = useState<any>([
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
title: '静音',
|
title: '解除静音',
|
||||||
icon: ImageUrl.icon22,
|
icon: ImageUrl.icon22,
|
||||||
iconActive: ImageUrl.icon22Active,
|
iconActive: ImageUrl.icon22Active,
|
||||||
active: false,
|
active: true,
|
||||||
select: false,
|
select: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '关闭视频',
|
title: '开启视频',
|
||||||
icon: ImageUrl.icon23,
|
icon: ImageUrl.icon23,
|
||||||
iconActive: ImageUrl.icon23Active,
|
iconActive: ImageUrl.icon23Active,
|
||||||
active: false,
|
active: true,
|
||||||
select: false,
|
select: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,9 @@ export const agora = {
|
||||||
await rtcEngine.initialize({
|
await rtcEngine.initialize({
|
||||||
appId: data,
|
appId: data,
|
||||||
});
|
});
|
||||||
await agora.setDeviceManager(bool)
|
if (bool) {
|
||||||
|
await agora.setDeviceManager()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 获取rtcEngine
|
// 获取rtcEngine
|
||||||
|
|
@ -46,7 +48,7 @@ export const agora = {
|
||||||
return rtcEngine
|
return rtcEngine
|
||||||
},
|
},
|
||||||
// 获取当前设备是否存在不存在就获取默认设备
|
// 获取当前设备是否存在不存在就获取默认设备
|
||||||
setDeviceManager: async (bool: boolean = false) => {
|
setDeviceManager: async () => {
|
||||||
const setting = await JSON.parse(storage.getItem('setting') as string)
|
const setting = await JSON.parse(storage.getItem('setting') as string)
|
||||||
// 摄像头
|
// 摄像头
|
||||||
if (setting.videoDeviceId) {
|
if (setting.videoDeviceId) {
|
||||||
|
|
@ -99,15 +101,13 @@ export const agora = {
|
||||||
}
|
}
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
storage.setItem('setting', JSON.stringify(setting))
|
storage.setItem('setting', JSON.stringify(setting))
|
||||||
if (bool) {
|
const settingData = await JSON.parse(storage.getItem('setting') as string)
|
||||||
const setting = await JSON.parse(storage.getItem('setting') as string)
|
if (settingData.videoDeviceId) agora.setVideoDeviceManager(settingData.videoDeviceId) //指定摄像头头采集设备
|
||||||
if (setting.videoDeviceId) agora.setVideoDeviceManager(setting.videoDeviceId) //指定摄像头头采集设备
|
if (settingData.playBackDeviceId) agora.setPlaybackDevice(settingData.playBackDeviceId) //指定播放设备
|
||||||
if (setting.playBackDeviceId) agora.setPlaybackDevice(setting.playBackDeviceId) //指定播放设备
|
if (settingData.playBackVolume) agora.setPlaybackDeviceVolume(settingData.playBackVolume) // 设置播放设备音量
|
||||||
if (setting.playBackVolume) agora.setPlaybackDeviceVolume(setting.playBackVolume) // 设置播放设备音量
|
if (settingData.ecordingDeviceId) agora.setRecordingDevice(settingData.ecordingDeviceId) // 设置音频采集设备
|
||||||
if (setting.ecordingDeviceId) agora.setRecordingDevice(setting.ecordingDeviceId) // 设置音频采集设备
|
if (settingData.ecordingVolume) agora.setRecordingDeviceVolume(settingData.ecordingVolume) // 设置音频设备音量
|
||||||
if (setting.ecordingVolume) agora.setRecordingDeviceVolume(setting.ecordingVolume) // 设置音频设备音量
|
if (settingData.isAINoiseReduction) agora.setAINSMode(settingData.isAINoiseReduction, settingData.aINoiseReduction) // 设置ai降噪
|
||||||
if (setting.isAINoiseReduction) agora.setAINSMode(setting.isAINoiseReduction, setting.aINoiseReduction) // 设置ai降噪
|
|
||||||
}
|
|
||||||
}, 1000);
|
}, 1000);
|
||||||
},
|
},
|
||||||
// 事件回调
|
// 事件回调
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue