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.ts 4.0KB

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