sample-xmonitor-js 1.0.8 → 1.0.10
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/Monitor.d.ts +1 -1
- package/lib/Monitor.js +2 -2
- package/lib/txrtc/index.d.ts +4 -1
- package/lib/txrtc/index.js +3 -2
- package/package.json +1 -1
package/lib/Monitor.d.ts
CHANGED
package/lib/Monitor.js
CHANGED
|
@@ -100,7 +100,7 @@ export default class Monitor {
|
|
|
100
100
|
this.watcher = new Watcher(this);
|
|
101
101
|
}
|
|
102
102
|
isPaused() {
|
|
103
|
-
return this.element.paused;
|
|
103
|
+
return this.element instanceof HTMLVideoElement && this.element.paused;
|
|
104
104
|
}
|
|
105
105
|
shot() {
|
|
106
106
|
return this.watcher.shot(this.options.setup?.sharpness).then(img => {
|
|
@@ -113,7 +113,7 @@ export default class Monitor {
|
|
|
113
113
|
*/
|
|
114
114
|
start() {
|
|
115
115
|
}
|
|
116
|
-
send(message) {
|
|
116
|
+
send(message, options) {
|
|
117
117
|
throw new NotSupportError('不支持发送消息');
|
|
118
118
|
}
|
|
119
119
|
/**
|
package/lib/txrtc/index.d.ts
CHANGED
|
@@ -17,8 +17,11 @@ export default class TxrtcMonitor extends Monitor {
|
|
|
17
17
|
/**
|
|
18
18
|
* 发送自定义消息
|
|
19
19
|
* @param message
|
|
20
|
+
* @param options
|
|
20
21
|
*/
|
|
21
|
-
send(message: string
|
|
22
|
+
send(message: string, options?: {
|
|
23
|
+
cmdId: number;
|
|
24
|
+
}): void;
|
|
22
25
|
stop(): Promise<any>;
|
|
23
26
|
static getMonitor(device: Device, object: MObject, element: HTMLDivElement, setup?: Setup): TxrtcMonitor;
|
|
24
27
|
}
|
package/lib/txrtc/index.js
CHANGED
|
@@ -63,10 +63,11 @@ export default class TxrtcMonitor extends Monitor {
|
|
|
63
63
|
/**
|
|
64
64
|
* 发送自定义消息
|
|
65
65
|
* @param message
|
|
66
|
+
* @param options
|
|
66
67
|
*/
|
|
67
|
-
send(message) {
|
|
68
|
+
send(message, options = { cmdId: 1 }) {
|
|
68
69
|
this.trtc.sendCustomMessage({
|
|
69
|
-
|
|
70
|
+
...options,
|
|
70
71
|
data: new TextEncoder().encode(message).buffer
|
|
71
72
|
});
|
|
72
73
|
}
|