Skip to content

Commit

Permalink
fix(service-providers): incorrect window size (#1791)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrious authored Nov 28, 2022
1 parent e3ac690 commit f4c4101
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions packages/flat-stores/src/classroom-store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ export class ClassroomStore {
deviceStateStorage: false,
classroomStorage: false,
onStageUsersStorage: false,
shareScreenInfo: observable.ref,
});

this.sideEffect.addDisposer(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,9 @@ export class AgoraRTCElectronShareScreen extends IServiceShareScreen {
screenId: info.windowId,
name: `${info.ownerName} - ${info.name}`,
image: info.image,
width: info.width,
height: info.height,
// There's no other way to get the original window size :/
width: info.originWidth,
height: info.originHeight,
};
}
};
Expand Down Expand Up @@ -187,18 +188,17 @@ export class AgoraRTCElectronShareScreen extends IServiceShareScreen {
this._pTogglingShareScreen = new Promise<void>(resolve => {
this.client.once("videoSourceJoinedSuccess", () => {
this.client.videoSourceSetVideoProfile(43, false);
const { width, height } = screenInfo;
if (screenInfo.type === "display") {
this.client.videoSourceStartScreenCaptureByScreen(
screenInfo.screenId as ScreenSymbol,
{ ...rect, width, height },
{ ...videoSourceParams, width, height },
rect,
videoSourceParams,
);
} else {
this.client.videoSourceStartScreenCaptureByWindow(
screenInfo.screenId as number,
{ ...rect, width, height },
{ ...videoSourceParams, width, height },
rect,
videoSourceParams,
);
}
resolve();
Expand Down

0 comments on commit f4c4101

Please sign in to comment.