-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
Hi,
I just received a new camera which should support Onvif. It does, but initially an error is triggered.
I did some digging around and found a workaround by patching node_modules/onvif/lib/events.js
.
Apparently the package "onvif" does not correctly parse the response and not parse date.
This patch worked:
function _terminationTime(response) {
if (typeof response.currentTime === "string") {
response.currentTime = new Date(Date.parse(response.currentTime));
}
if (typeof response.terminationTime === "string") {
response.terminationTime = new Date(Date.parse(response.terminationTime));
}
return new Date(Date.now() - response.currentTime.getTime() + response.terminationTime.getTime());
}
Metadata
Metadata
Assignees
Labels
No labels