GuilhermeC18/node-onvif

Callback when PTZ move is finished

ahmadsholehin opened this issue · 0 comments

I'm trying to move the camera and then take a snapshot, something like below:

const cameraDevice = new onvif.OnvifDevice( params );

cameraDevice
  .init()
  .then( () => {
    cameraDevice.services.ptz
      .absoluteMove( {
        ProfileToken: cameraDevice.getCurrentProfile().token,
        Position: { x: 0.5, y: -0.5, z: 0.1 },
        Speed: { x: 1, y: 1, z: 1 },
      } )
      .then( () => {
        console.log( 'Snap: this should only be called when PTZ has finished moving' );
      } )
  } )

However, I'm the promise for absoluteMove is resolving almost immediately, not when the camera has finished moving, like how I expected.

Anyone knows any workaround to this?