VideoInputDevice.js 789 B

1234567891011121314151617181920212223242526272829
  1. /**
  2. * @deprecated Moving to @zxing/browser
  3. *
  4. * Video input device metadata containing the id and label of the device if available.
  5. */
  6. export class VideoInputDevice {
  7. /**
  8. * Creates an instance of VideoInputDevice.
  9. *
  10. * @param {string} deviceId the video input device id
  11. * @param {string} label the label of the device if available
  12. */
  13. constructor(deviceId, label, groupId) {
  14. this.deviceId = deviceId;
  15. this.label = label;
  16. /** @inheritdoc */
  17. this.kind = 'videoinput';
  18. this.groupId = groupId || undefined;
  19. }
  20. /** @inheritdoc */
  21. toJSON() {
  22. return {
  23. kind: this.kind,
  24. groupId: this.groupId,
  25. deviceId: this.deviceId,
  26. label: this.label,
  27. };
  28. }
  29. }