sample-xmonitor-js 1.0.3 → 1.0.4

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.
@@ -32,6 +32,8 @@ export declare class TxrtcCameraMonitor extends TxrtcMonitor {
32
32
  /**
33
33
  * 切换摄像头
34
34
  */
35
- switch(option: LocalVideoConfig['option']): Promise<void>;
35
+ switch(option: LocalVideoConfig['option'] & {
36
+ deviceId?: string;
37
+ }): Promise<void>;
36
38
  stop(): Promise<any>;
37
39
  }
@@ -124,7 +124,8 @@ export class TxrtcCameraMonitor extends TxrtcMonitor {
124
124
  * 切换摄像头
125
125
  */
126
126
  async switch(option) {
127
- if (option?.cameraId || option?.useFrontCamera) {
127
+ option.cameraId = option.cameraId || option.deviceId;
128
+ if (option.cameraId || option.useFrontCamera) {
128
129
  await this.trtc.updateLocalVideo({ option, publish: true, view: this.options.element });
129
130
  }
130
131
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sample-xmonitor-js",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "",
5
5
  "main": "./lib/index",
6
6
  "files": [