Skip to content

Commit

Permalink
fix(agora): fix rtc element being destroyed
Browse files Browse the repository at this point in the history
  • Loading branch information
crimx committed Aug 22, 2022
1 parent 6732791 commit 61df7f1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
10 changes: 8 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion service-providers/agora-rtc/agora-rtc-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"dependencies": {
"@netless/flat-services": "workspace:*",
"agora-rtc-sdk-ng": "^4.12.2",
"agora-rtc-sdk-ng": "4.13.0",
"side-effect-manager": "^1.2.1",
"value-enhancer": "^1.3.2"
}
Expand Down
12 changes: 0 additions & 12 deletions service-providers/agora-rtc/agora-rtc-web/src/agora-rtc-web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ export class AgoraRTCWeb extends IServiceVideoChat {

this.shareScreen.destroy();

this.sideEffect.flushAll();

await this.leaveRoom();
}

Expand Down Expand Up @@ -373,7 +371,6 @@ export class AgoraRTCWeb extends IServiceVideoChat {
if (uid === this.shareScreenUID) {
if (mediaType === "video") {
try {
await client.unsubscribe(user, mediaType);
this.shareScreen.setRemoteVideoTrack(null);
} catch (e) {
console.error(e);
Expand All @@ -383,7 +380,6 @@ export class AgoraRTCWeb extends IServiceVideoChat {
}

try {
await client.unsubscribe(user, mediaType);
const avatar = this._remoteAvatars.get(uid);
if (avatar) {
if (mediaType === "audio") {
Expand All @@ -395,14 +391,6 @@ export class AgoraRTCWeb extends IServiceVideoChat {
} catch (e) {
console.error(e);
}

if (!user.videoTrack && !user.audioTrack) {
const avatar = this._remoteAvatars.get(uid);
if (avatar) {
avatar.destroy();
this._remoteAvatars.delete(uid);
}
}
};
client.on("user-unpublished", handler);
return () => client.off("user-unpublished", handler);
Expand Down

0 comments on commit 61df7f1

Please sign in to comment.