sample-xmonitor-js 1.0.6 → 1.0.8

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.
Files changed (2) hide show
  1. package/lib/txrtc/index.js +23 -13
  2. package/package.json +1 -1
@@ -97,12 +97,17 @@ export class TxrtcScreenMonitor extends TxrtcMonitor {
97
97
  });
98
98
  }
99
99
  async start() {
100
- await super.start();
101
- await this.trtc.startScreenShare({
102
- option: { profile: '720p', ...this.setup.option },
103
- publish: true,
104
- view: this.options.element
105
- });
100
+ try {
101
+ await super.start();
102
+ await this.trtc.startScreenShare({
103
+ option: { profile: '720p', ...this.setup.option },
104
+ publish: true,
105
+ view: this.options.element
106
+ });
107
+ }
108
+ catch (e) {
109
+ this.dispatchEvent('error', null, e);
110
+ }
106
111
  }
107
112
  async stop() {
108
113
  await this.trtc.stopScreenShare();
@@ -120,13 +125,18 @@ export class TxrtcCameraMonitor extends TxrtcMonitor {
120
125
  });
121
126
  }
122
127
  async start() {
123
- await super.start();
124
- await this.trtc.startLocalAudio({ publish: true });
125
- await this.trtc.startLocalVideo({
126
- option: { profile: '480p', ...this.setup.option },
127
- publish: true,
128
- view: this.options.element
129
- });
128
+ try {
129
+ await super.start();
130
+ await this.trtc.startLocalAudio({ publish: true });
131
+ await this.trtc.startLocalVideo({
132
+ option: { profile: '480p', ...this.setup.option },
133
+ publish: true,
134
+ view: this.options.element
135
+ });
136
+ }
137
+ catch (e) {
138
+ this.dispatchEvent('error', null, e);
139
+ }
130
140
  }
131
141
  /**
132
142
  * 切换摄像头
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sample-xmonitor-js",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "",
5
5
  "main": "./lib/index",
6
6
  "files": [