This commit is contained in:
parent
009875711f
commit
a4b5e86cbf
|
|
@ -218,6 +218,18 @@ const Meeting: React.FC = () => {
|
|||
const item = roomUserList.find((item: any) => item.screenShareId === String(isShare))
|
||||
setIsShareUser(item || null)
|
||||
}
|
||||
function moveObjectToFront(arr: any, objToMove: any) {
|
||||
const index = arr.findIndex((item: any) => {
|
||||
return item.uid === objToMove.uid;
|
||||
});
|
||||
|
||||
if (index !== -1) {
|
||||
const movedObj = arr.splice(index, 1)[0];
|
||||
arr.unshift(movedObj);
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
setRoomUserList(moveObjectToFront(roomUserList, userInfo))
|
||||
}, [isShare, roomUserList]);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ const agora = {
|
|||
const setting = JSON.parse(storage.getItem('setting') as string)
|
||||
if (setting.videoDeviceId) {
|
||||
agora.getVideoDeviceManager().then(async (res) => {
|
||||
let item = res.find((item: any) => item.deviceId === setting.videoDeviceId);
|
||||
let item = res.list.find((item: any) => item.deviceId === setting.videoDeviceId);
|
||||
if (item) {
|
||||
agora.setVideoDeviceManager(setting.videoDeviceId) //通过设备 ID 指定视频采集设备。
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue