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