You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Constants.js 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /**
  2. * The value for the "var" attribute of feature tag in disco-info packets.
  3. */
  4. export const DISCO_REMOTE_CONTROL_FEATURE
  5. = 'http://jitsi.org/meet/remotecontrol';
  6. /**
  7. * Types of remote-control events.
  8. * @readonly
  9. * @enum {string}
  10. */
  11. export const EVENTS = {
  12. mousemove: 'mousemove',
  13. mousedown: 'mousedown',
  14. mouseup: 'mouseup',
  15. mousedblclick: 'mousedblclick',
  16. mousescroll: 'mousescroll',
  17. keydown: 'keydown',
  18. keyup: 'keyup',
  19. permissions: 'permissions',
  20. start: 'start',
  21. stop: 'stop',
  22. supported: 'supported'
  23. };
  24. /**
  25. * Types of remote-control requests.
  26. * @readonly
  27. * @enum {string}
  28. */
  29. export const REQUESTS = {
  30. start: 'start'
  31. };
  32. /**
  33. * Actions for the remote control permission events.
  34. * @readonly
  35. * @enum {string}
  36. */
  37. export const PERMISSIONS_ACTIONS = {
  38. request: 'request',
  39. grant: 'grant',
  40. deny: 'deny',
  41. error: 'error'
  42. };
  43. /**
  44. * The type of remote control messages.
  45. */
  46. export const REMOTE_CONTROL_MESSAGE_NAME = 'remote-control';
  47. /**
  48. * The remote control event.
  49. * @typedef {object} RemoteControlEvent
  50. * @property {EVENTS | REQUESTS} type - the type of the message
  51. * @property {number} x - avaibale for type === mousemove only. The new x
  52. * coordinate of the mouse
  53. * @property {number} y - For mousemove type - the new y
  54. * coordinate of the mouse and for mousescroll - represents the vertical
  55. * scrolling diff value
  56. * @property {number} button - 1(left), 2(middle) or 3 (right). Supported by
  57. * mousedown, mouseup and mousedblclick types.
  58. * @property {KEYS} key - Represents the key related to the event. Supported by
  59. * keydown and keyup types.
  60. * @property {KEYS[]} modifiers - Represents the modifier related to the event.
  61. * Supported by keydown and keyup types.
  62. * @property {PERMISSIONS_ACTIONS} action - Supported by type === permissions.
  63. * Represents the action related to the permissions event.
  64. *
  65. * Optional properties. Supported for permissions event for action === request:
  66. * @property {string} userId - The user id of the participant that has sent the
  67. * request.
  68. * @property {string} userJID - The full JID in the MUC of the user that has
  69. * sent the request.
  70. * @property {string} displayName - the displayName of the participant that has
  71. * sent the request.
  72. * @property {boolean} screenSharing - true if the SS is started for the local
  73. * participant and false if not.
  74. */