camstreamerlib 1.7.5 → 1.7.6
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/CamOverlayAPI.d.ts +3 -4
- package/CamOverlayAPI.js +10 -12
- package/package.json +1 -1
package/CamOverlayAPI.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export declare type UploadImageResponse = {
|
|
|
36
36
|
export declare type Align = 'A_RIGHT' | 'A_LEFT' | 'A_CENTER';
|
|
37
37
|
export declare type TextFit = 'TFM_SCALE' | 'TFM_TRUNCATE' | 'TFM_OVERFLOW';
|
|
38
38
|
export declare type WriteTextParams = [string, string, number, number, number, number, Align, TextFit?];
|
|
39
|
-
declare type Service = {
|
|
39
|
+
export declare type Service = {
|
|
40
40
|
id: number;
|
|
41
41
|
enabled: number;
|
|
42
42
|
schedule: string;
|
|
@@ -44,7 +44,7 @@ declare type Service = {
|
|
|
44
44
|
identifier: string;
|
|
45
45
|
camera: number;
|
|
46
46
|
};
|
|
47
|
-
declare type
|
|
47
|
+
export declare type ServiceList = {
|
|
48
48
|
services: Service[];
|
|
49
49
|
};
|
|
50
50
|
export declare class CamOverlayAPI extends EventEmitter {
|
|
@@ -61,7 +61,7 @@ export declare class CamOverlayAPI extends EventEmitter {
|
|
|
61
61
|
constructor(options?: CamOverlayOptions);
|
|
62
62
|
connect(): Promise<void>;
|
|
63
63
|
createService(): Promise<number>;
|
|
64
|
-
updateServices(servicesJson:
|
|
64
|
+
updateServices(servicesJson: ServiceList): Promise<void>;
|
|
65
65
|
openWebsocket(digestHeader?: string): Promise<void>;
|
|
66
66
|
cairo(command: string, ...params: any[]): Promise<CairoResponse | CairoCreateResponse>;
|
|
67
67
|
writeText(...params: WriteTextParams): Promise<CairoResponse>;
|
|
@@ -83,4 +83,3 @@ export declare class CamOverlayAPI extends EventEmitter {
|
|
|
83
83
|
setEnabled(enabled: boolean): Promise<void>;
|
|
84
84
|
isEnabled(): Promise<boolean>;
|
|
85
85
|
}
|
|
86
|
-
export {};
|
package/CamOverlayAPI.js
CHANGED
|
@@ -267,18 +267,16 @@ class CamOverlayAPI extends EventEmitter {
|
|
|
267
267
|
}
|
|
268
268
|
setEnabled(enabled) {
|
|
269
269
|
return __awaiter(this, void 0, void 0, function* () {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
yield (0, HTTPRequest_1.httpRequest)(options, '');
|
|
281
|
-
}
|
|
270
|
+
const value = enabled ? 1 : 0;
|
|
271
|
+
const path = encodeURI(`/local/camoverlay/api/enabled.cgi?id_${this.serviceID}=${value}`);
|
|
272
|
+
const options = {
|
|
273
|
+
method: 'POST',
|
|
274
|
+
host: this.ip,
|
|
275
|
+
port: this.port,
|
|
276
|
+
path: path,
|
|
277
|
+
auth: this.auth,
|
|
278
|
+
};
|
|
279
|
+
yield (0, HTTPRequest_1.httpRequest)(options, '');
|
|
282
280
|
});
|
|
283
281
|
}
|
|
284
282
|
isEnabled() {
|