This commit is contained in:
yj 2024-09-09 15:01:42 +08:00
parent b4618bbf38
commit 954da4a220
2 changed files with 18 additions and 31 deletions

View File

@ -14,7 +14,7 @@ import { agora } from '@/utils/package/agora'
import { onInvoke, onSignalr, offSignalr, onStart } from '@/utils/package/signalr'; import { onInvoke, onSignalr, offSignalr, onStart } from '@/utils/package/signalr';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import durationPlugin from 'dayjs/plugin/duration'; import durationPlugin from 'dayjs/plugin/duration';
import { VideoSourceType } from 'agora-electron-sdk'; import { VideoSourceType, VideoStreamType } from 'agora-electron-sdk';
import Avatar from '@/components/Avatar'; import Avatar from '@/components/Avatar';
import SharedFilesModel from '@/components/SharedFilesModel'; import SharedFilesModel from '@/components/SharedFilesModel';
import StupWizard from '@/components/StupWizard'; import StupWizard from '@/components/StupWizard';
@ -248,6 +248,16 @@ const Meeting: React.FC = () => {
} }
}, [isShare, roomUserList]); }, [isShare, roomUserList]);
useEffect(() => {
roomUserList.forEach(async (item: any) => {
if (item.uid === currentVideoId) {
await agora.setRemoteVideoStreamType(item.uid, VideoStreamType.VideoStreamHigh)
} else {
await agora.setRemoteVideoStreamType(item.uid, VideoStreamType.VideoStreamLow)
}
});
}, [currentVideoId]);
useEffect(() => { useEffect(() => {
onSignalr(async (item: any) => { onSignalr(async (item: any) => {
switch (item.key) { switch (item.key) {

View File

@ -129,19 +129,6 @@ export const agora = {
// // 用户音量提示回调。 // // 用户音量提示回调。
onAudioVolumeIndication: async (_connection: any, speakers: any, _speakerNumber: any, _totalVolume: any,) => { onAudioVolumeIndication: async (_connection: any, speakers: any, _speakerNumber: any, _totalVolume: any,) => {
await onAudioVolumeIndication(speakers) await onAudioVolumeIndication(speakers)
},
onVideoSizeChanged: async (connection: any,
sourceType: VideoSourceType,
uid: number,
width: number,
height: number,
rotation: number) => {
console.log(connection,
sourceType,
uid,
width,
height,
rotation);
} }
}); });
}, },
@ -245,23 +232,13 @@ export const agora = {
publishCameraTrack: true,//设置是否发布摄像头采集的视频 publishCameraTrack: true,//设置是否发布摄像头采集的视频
publishScreenTrack: false,//设置是否发布屏幕采集的视频 publishScreenTrack: false,//设置是否发布屏幕采集的视频
}) })
// if (bool) { },
// setTimeout(() => { // 设置接收大小流
// rtcEngine.setRemoteVideoStreamType( setRemoteVideoStreamType: async (uid: number, type: VideoStreamType) => {
// Number(option.uid), await rtcEngine.setRemoteVideoStreamType(
// VideoStreamType.VideoStreamHigh, Number(uid),
// ) type,
// console.log(111111); )
// setTimeout(() => {
// rtcEngine.setRemoteVideoStreamType(
// Number(option.uid),
// VideoStreamType.VideoStreamLow,
// )
// console.log(222222);
// }, 10000);
// }, 10000);
// // VideoStreamType.VideoStreamHigh,
// }
}, },
// 共享屏幕单独用户 // 共享屏幕单独用户
joinChannelEx: async (uid: any) => { joinChannelEx: async (uid: any) => {