Skip to content

Commit

Permalink
fix(flat-rtc): disable share screen on track ended (#1588)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrious committed Jun 28, 2022
1 parent 4e372a2 commit f4d4926
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions services/rtc/flat-rtc-agora-web/src/rtc-share-screen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ export class RTCShareScreen extends FlatRTCShareScreen {
});

this.localVideoTrack = await AgoraRTC.createScreenVideoTrack({}, "disable");
this.localVideoTrack.once("track-ended", () => {
this.localVideoTrack = null;
resolve_EnablingShareScreen();
this._pTogglingShareScreen = undefined;
this.enable(false);
});

if (this._params$.value) {
const { roomUUID, token, uid } = this._params$.value;
Expand Down

0 comments on commit f4d4926

Please sign in to comment.