Skip to content

Commit

Permalink
chore: optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
guoxianzhe committed Dec 23, 2024
1 parent 7edb7d2 commit 4ee061d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
RtcConnection,
RtcStats,
UserOfflineReasonType,
VideoCanvas,
createAgoraRtcEngine,
} from 'agora-electron-sdk';
import React, { ReactElement } from 'react';
Expand All @@ -17,14 +16,7 @@ import {
BaseComponent,
BaseVideoComponentState,
} from '../../../components/BaseComponent';
import {
AgoraButton,
AgoraCard,
AgoraList,
AgoraText,
AgoraTextInput,
RtcSurfaceView,
} from '../../../components/ui';
import { AgoraButton, AgoraList, AgoraTextInput } from '../../../components/ui';
import Config from '../../../config/agora.config';
import { askMediaAccess } from '../../../utils/permissions';

Expand Down Expand Up @@ -446,8 +438,11 @@ export default class JoinMultipleChannel
renderItem={(item) => {
return this.renderVideo(
{ uid: item },
remoteUsers2.indexOf(item) === -1 ? channelId : channelId2,
remoteUsers2.indexOf(item) === -1 ? uid : uid2
{
channelId:
remoteUsers2.indexOf(item) === -1 ? channelId : channelId2,
localUid: remoteUsers2.indexOf(item) === -1 ? uid : uid2,
}
);
}}
/>
Expand All @@ -456,19 +451,6 @@ export default class JoinMultipleChannel
);
}

protected renderVideo(
user: VideoCanvas,
channelId?: string,
localUid?: number
): ReactElement | undefined {
return (
<AgoraCard title={`${channelId} - ${user.uid}`}>
<AgoraText>Click view to mirror</AgoraText>
<RtcSurfaceView canvas={user} connection={{ channelId, localUid }} />
</AgoraCard>
);
}

protected renderAction(): ReactElement | undefined {
const { joinChannelSuccess, joinChannelSuccess2 } = this.state;
return (
Expand Down
2 changes: 1 addition & 1 deletion ts/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,5 +193,5 @@ export const AgoraEnv: AgoraEnvType = {
enableWebCodecsDecoder: false,
encodeAlpha: false,
videoFallbackStrategy: VideoFallbackStrategy.PerformancePriority,
maxDecodeRetryCount: 100,
maxDecodeRetryCount: 50,
};

0 comments on commit 4ee061d

Please sign in to comment.