-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathONVIFClient.js
More file actions
38 lines (38 loc) · 1.08 KB
/
ONVIFClient.js
File metadata and controls
38 lines (38 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const RTSPClient_1 = require("./RTSPClient");
// RTSP client with ONVIF extensions.
class ONVIFClient extends RTSPClient_1.default {
constructor(username, password) {
super(username, password, { Require: "onvif-replay" });
}
async playFrom(from, to) {
const obj = {
Session: this.session,
Immediate: 'yes',
Range: `clock=${from.toISOString()}-`
};
if (to) {
obj.Range += to.toISOString();
}
await this.request("PLAY", obj);
return this;
}
async playReverse(from, to) {
const obj = {
Session: this.session,
'Rate-Control': 'no',
Scale: '-1.0'
};
if (from) {
obj.Range = `clock=${from.toISOString()}-`;
if (to) {
obj.Range += to.toISOString();
}
}
await this.request("PLAY", obj);
return this;
}
}
exports.default = ONVIFClient;
//# sourceMappingURL=ONVIFClient.js.map