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.
- package/lib/txrtc/index.js +23 -13
- package/package.json +1 -1
package/lib/txrtc/index.js
CHANGED
|
@@ -97,12 +97,17 @@ export class TxrtcScreenMonitor extends TxrtcMonitor {
|
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
99
|
async start() {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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
|
* 切换摄像头
|