agsh / onvif

ONVIF node.js implementation
http://agsh.github.io/onvif/
MIT License
693 stars 236 forks source link

disconnect event #176

Closed ahmetcumhurarslan closed 3 years ago

ahmetcumhurarslan commented 3 years ago

i am listening motion detection event to start recording. but when camera disconnects and reconnects i cannot understand this and continue to listen for nothing. is there any callback or way to detect the camera connection?

chriswiggins commented 3 years ago

You can listen for the 'connect' event on your cam object:

var cam = new Cam({...options});
cam.on('connect', () => { console.log('Connected') });