Open JooZef315 opened 6 days ago
Spotted a few eroors in the code. a) You only need Stream (Multicast) and Protocol (RTSP) for Get StreamUri(). You do not need them for GetSnapshotUri
b) The await on getStreamuri does nothing. The library is a "function with callback" type of library, unless you pass the library through Promisify and then you can use await and would not have a callback. If you were trying to wait for it to finish, and then resolve a promise, you'd call resolve after console.log(data)
this may not explain why it fails though
Spotted a few eroors in the code. a) You only need Stream (Multicast) and Protocol (RTSP) for Get StreamUri(). You do not need them for GetSnapshotUri
b) The await on getStreamuri does nothing. The library is a "function with callback" type of library, unless you pass the library through Promisify and then you can use await and would not have a callback. If you were trying to wait for it to finish, and then resolve a promise, you'd call resolve after console.log(data)
this may not explain why it fails though
thank you for replying @RogerHardiman,
refactored it to this, but still the same error
cam.getSnapshotUri(
{ profileToken: cam.activeSource.profileToken },
function (err, data) {
console.log(data);
}
);
I am connecting to a camera with its public Ip as it is not on my local network,
data returns
{ uri: undefined }
what did i miss? or isn't it possible to take a snapshot with that connection?