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 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. // @flow
  2. import {
  3. CLAP_SOUND_FILES,
  4. LAUGH_SOUND_FILES,
  5. LIKE_SOUND_FILES,
  6. BOO_SOUND_FILES,
  7. SURPRISE_SOUND_FILES,
  8. SILENCE_SOUND_FILES
  9. } from './sounds';
  10. /**
  11. * Reactions menu height on mobile web (px).
  12. */
  13. export const REACTIONS_MENU_HEIGHT = 144;
  14. /**
  15. * The payload name for the datachannel/endpoint reaction event.
  16. */
  17. export const ENDPOINT_REACTION_NAME = 'endpoint-reaction';
  18. /**
  19. * The (name of the) command which transports the state (represented by
  20. * {State} for the local state at the time of this writing) of a {MuteReactions}
  21. * (instance) between moderator and participants.
  22. */
  23. export const MUTE_REACTIONS_COMMAND = 'mute-reactions';
  24. /**
  25. * The prefix for all reaction sound IDs. Also the ID used in config to disable reaction sounds.
  26. */
  27. export const REACTION_SOUND = 'REACTION_SOUND';
  28. /**
  29. * The audio ID prefix of the audio element for which the {@link playAudio} action is
  30. * triggered when a new laugh reaction is received.
  31. *
  32. * @type { string }
  33. */
  34. export const LAUGH_SOUND_ID = `${REACTION_SOUND}_LAUGH_`;
  35. /**
  36. * The audio ID prefix of the audio element for which the {@link playAudio} action is
  37. * triggered when a new clap reaction is received.
  38. *
  39. * @type {string}
  40. */
  41. export const CLAP_SOUND_ID = `${REACTION_SOUND}_CLAP_`;
  42. /**
  43. * The audio ID prefix of the audio element for which the {@link playAudio} action is
  44. * triggered when a new like reaction is received.
  45. *
  46. * @type {string}
  47. */
  48. export const LIKE_SOUND_ID = `${REACTION_SOUND}_LIKE_`;
  49. /**
  50. * The audio ID prefix of the audio element for which the {@link playAudio} action is
  51. * triggered when a new boo reaction is received.
  52. *
  53. * @type {string}
  54. */
  55. export const BOO_SOUND_ID = `${REACTION_SOUND}_BOO_`;
  56. /**
  57. * The audio ID prefix of the audio element for which the {@link playAudio} action is
  58. * triggered when a new surprised reaction is received.
  59. *
  60. * @type {string}
  61. */
  62. export const SURPRISE_SOUND_ID = `${REACTION_SOUND}_SURPRISE_`;
  63. /**
  64. * The audio ID prefix of the audio element for which the {@link playAudio} action is
  65. * triggered when a new silence reaction is received.
  66. *
  67. * @type {string}
  68. */
  69. export const SILENCE_SOUND_ID = `${REACTION_SOUND}_SILENCE_`;
  70. /**
  71. * The audio ID of the audio element for which the {@link playAudio} action is
  72. * triggered when a new raise hand event is received.
  73. *
  74. * @type {string}
  75. */
  76. export const RAISE_HAND_SOUND_ID = 'RAISE_HAND_SOUND';
  77. export type ReactionEmojiProps = {
  78. /**
  79. * Reaction to be displayed.
  80. */
  81. reaction: string,
  82. /**
  83. * Id of the reaction.
  84. */
  85. uid: number
  86. }
  87. export const SOUNDS_THRESHOLDS = [ 1, 4, 10 ];
  88. export const REACTIONS = {
  89. like: {
  90. message: ':thumbs_up:',
  91. emoji: '👍',
  92. shortcutChar: 'T',
  93. soundId: LIKE_SOUND_ID,
  94. soundFiles: LIKE_SOUND_FILES
  95. },
  96. clap: {
  97. message: ':clap:',
  98. emoji: '👏',
  99. shortcutChar: 'C',
  100. soundId: CLAP_SOUND_ID,
  101. soundFiles: CLAP_SOUND_FILES
  102. },
  103. laugh: {
  104. message: ':grinning_face:',
  105. emoji: '😀',
  106. shortcutChar: 'L',
  107. soundId: LAUGH_SOUND_ID,
  108. soundFiles: LAUGH_SOUND_FILES
  109. },
  110. surprised: {
  111. message: ':face_with_open_mouth:',
  112. emoji: '😮',
  113. shortcutChar: 'O',
  114. soundId: SURPRISE_SOUND_ID,
  115. soundFiles: SURPRISE_SOUND_FILES
  116. },
  117. boo: {
  118. message: ':slightly_frowning_face:',
  119. emoji: '🙁',
  120. shortcutChar: 'B',
  121. soundId: BOO_SOUND_ID,
  122. soundFiles: BOO_SOUND_FILES
  123. },
  124. silence: {
  125. message: ':face_without_mouth:',
  126. emoji: '😶',
  127. shortcutChar: 'S',
  128. soundId: SILENCE_SOUND_ID,
  129. soundFiles: SILENCE_SOUND_FILES
  130. }
  131. };