camera.js 889 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. const axios = require('axios')
  2. const service = axios.create()
  3. const baseUrl = 'http://localhost:5513/'
  4. const timeout = 60000
  5. function get(config = {
  6. url: '',
  7. }) {
  8. return service.get(baseUrl + config.url, {
  9. headers: config.headers || {},
  10. timeout: config.timeout || timeout
  11. })
  12. }
  13. module.exports = {
  14. liveShow(){
  15. return get({
  16. url: '?CMD=LiveViewWnd_Show'
  17. })
  18. },
  19. liveHide(){
  20. return get({
  21. url: '?CMD=LiveViewWnd_Hide'
  22. })
  23. },
  24. capture(){
  25. return get({
  26. url: '?CMD=LiveView_Capture'
  27. })
  28. },
  29. setParams(params){
  30. return get({
  31. url: `?slc=set&param1=${params.key}&param2=${params.value}`
  32. })
  33. },
  34. }
  35. /*
  36. *
  37. * 设置 iso
  38. * 光圈 aperture
  39. * 拍摄模式 mode
  40. * 快门速度 shutterSpeed
  41. * 白平衡 whitebalance
  42. * 曝光补偿 ExposureCompensation
  43. * 对焦模式 focusmode
  44. *
  45. *
  46. 曝光度:exposure
  47. 压缩:compression
  48. 测光点:metering
  49. * */