Skip to content

Commit

Permalink
fix(desktop): share screen not rendering on first join (#1739)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrious authored Oct 20, 2022
1 parent 96428e0 commit 938e2ce
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export class AgoraRTCElectronShareScreen extends IServiceShareScreen {
this._el$ = new Val(config.element ?? null);

this._sideEffect.addDisposer(
combine([this._active$, this._params$]).subscribe(([active, params]) => {
if (this._el$.value && params) {
combine([this._active$, this._params$, this._el$]).subscribe(([active, params, el]) => {
if (el && params) {
const uid = Number(params.uid);
try {
if (active) {
Expand All @@ -57,11 +57,11 @@ export class AgoraRTCElectronShareScreen extends IServiceShareScreen {
// the `desktop` will have a black screen.
// this is because the SDK has `mute` the remote screen sharing stream
this.client.muteRemoteVideoStream(uid, false);
this.client.setupRemoteVideo(uid, this._el$.value);
this.client.setupRemoteVideo(uid, el);
this.client.setupViewContentMode(uid, 1, undefined);
} else {
this.client.destroyRender(uid, undefined);
this.client.destroyRenderView(uid, undefined, this._el$.value);
this.client.destroyRenderView(uid, undefined, el);
}
this.events.emit("remote-changed", active);
} catch (e) {
Expand Down

0 comments on commit 938e2ce

Please sign in to comment.