@netless/window-manager 0.4.47 → 0.4.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netless/window-manager",
3
- "version": "0.4.47",
3
+ "version": "0.4.49",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",
@@ -83,8 +83,8 @@ export class MainViewProxy {
83
83
  }
84
84
 
85
85
  public start() {
86
- if (this.started) return;
87
86
  this.sizeChangeHandler(this.mainViewSize);
87
+ if (this.started) return;
88
88
  this.addCameraListener();
89
89
  this.addCameraReaction();
90
90
  this.started = true;
@@ -114,7 +114,7 @@ export class MainViewProxy {
114
114
  };
115
115
 
116
116
  public sizeChangeHandler = debounce((size: Size) => {
117
- if (size && this.viewMode === ViewMode.Broadcaster) {
117
+ if (size) {
118
118
  this.moveCameraToContian(size);
119
119
  this.moveCamera(this.mainViewCamera);
120
120
  }
package/src/index.ts CHANGED
@@ -590,8 +590,8 @@ export class WindowManager extends InvisiblePlugin<WindowMangerAttributes, any>
590
590
  * 设置 ViewMode
591
591
  */
592
592
  public setViewMode(mode: ViewMode): void {
593
- if (mode === ViewMode.Broadcaster) {
594
- if (this.canOperate) {
593
+ if (mode === ViewMode.Broadcaster || mode === ViewMode.Follower) {
594
+ if (this.canOperate && mode === ViewMode.Broadcaster) {
595
595
  this.appManager?.mainViewProxy.setCameraAndSize();
596
596
  }
597
597
  this.appManager?.mainViewProxy.start();