Advertisement
Guest User

Untitled

a guest
Jan 6th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. const onvif = require('node-onvif');
  2. const fs = require('fs');
  3.  
  4. // Create an OnvifDevice object
  5. let device = new onvif.OnvifDevice({
  6. xaddr: 'http://192.168.11.42:80/onvif/device_service',
  7. user : 'admin',
  8. pass : 'Supervisor'
  9. });
  10.  
  11.  
  12. // Initialize the OnvifDevice object
  13. device.init().then(() => {
  14. // Get the data of the snapshot
  15. token = device.getCurrentProfile().token;
  16. let params = {
  17. 'ProfileToken': token
  18. };
  19. device.services.media.getSnapshotUri(params).then((result) => {
  20. console.log(result['data'].GetSnapshotUriResponse.MediaUri.Uri);})
  21. }).catch((error) => {
  22. console.error(error);
  23. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement