agsh / onvif

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

Problems with PTZ-supported camera #52

Closed anhldbk closed 8 years ago

anhldbk commented 8 years ago

I've run your sample code with a PTZ-supported camera:

var
  http = require('http'),
  Cam = require('onvif').Cam;

new Cam({
  hostname: <CAMERA_HOST>,
  username: <USERNAME>,
  password: <PASSWORD>
}, function(err) {
  this.absoluteMove({x: 1, y: 1, zoom: 1});
  this.getStreamUri({protocol:'RTSP'}, function(err, stream) {
    http.createServer(function (req, res) {
      res.writeHead(200, {'Content-Type': 'text/html'});
      res.end('<html><body>' +
        '<embed type="application/x-vlc-plugin" target="' + stream.uri + '"></embed>' +
        '</body></html>');
    }).listen(3030);
  });
});

There's an exception:

..../node_modules/onvif/lib/ptz.js:333
            '<ProfileToken>' + (options.profileToken || this.activeSource.profileToken) + '</ProfileToken>' +
                                                                         ^

TypeError: Cannot read property 'profileToken' of undefined
anhldbk commented 8 years ago

Sorry! I've found the solution here with issue #8

RogerHardiman commented 8 years ago

Hi Thank you for the issue report.

Could you tell me what the fix was please? (and add the working code to this issue report).

Then I can see what fix worked for you.

Thanks