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.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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. * The payload name for the datachannel/endpoint reaction event
  12. */
  13. export const ENDPOINT_REACTION_NAME = 'endpoint-reaction';
  14. /**
  15. * The prefix for all reaction sound IDs. Also the ID used in config to disable reaction sounds.
  16. */
  17. export const REACTION_SOUND = 'REACTION_SOUND';
  18. /**
  19. * The audio ID prefix of the audio element for which the {@link playAudio} action is
  20. * triggered when a new laugh reaction is received.
  21. *
  22. * @type { string }
  23. */
  24. export const LAUGH_SOUND_ID = `${REACTION_SOUND}_LAUGH_`;
  25. /**
  26. * The audio ID prefix of the audio element for which the {@link playAudio} action is
  27. * triggered when a new clap reaction is received.
  28. *
  29. * @type {string}
  30. */
  31. export const CLAP_SOUND_ID = `${REACTION_SOUND}_CLAP_`;
  32. /**
  33. * The audio ID prefix of the audio element for which the {@link playAudio} action is
  34. * triggered when a new like reaction is received.
  35. *
  36. * @type {string}
  37. */
  38. export const LIKE_SOUND_ID = `${REACTION_SOUND}_LIKE_`;
  39. /**
  40. * The audio ID prefix of the audio element for which the {@link playAudio} action is
  41. * triggered when a new boo reaction is received.
  42. *
  43. * @type {string}
  44. */
  45. export const BOO_SOUND_ID = `${REACTION_SOUND}_BOO_`;
  46. /**
  47. * The audio ID prefix of the audio element for which the {@link playAudio} action is
  48. * triggered when a new surprised reaction is received.
  49. *
  50. * @type {string}
  51. */
  52. export const SURPRISE_SOUND_ID = `${REACTION_SOUND}_SURPRISE_`;
  53. /**
  54. * The audio ID prefix of the audio element for which the {@link playAudio} action is
  55. * triggered when a new silence reaction is received.
  56. *
  57. * @type {string}
  58. */
  59. export const SILENCE_SOUND_ID = `${REACTION_SOUND}_SILENCE_`;
  60. /**
  61. * The audio ID of the audio element for which the {@link playAudio} action is
  62. * triggered when a new raise hand event is received.
  63. *
  64. * @type {string}
  65. */
  66. export const RAISE_HAND_SOUND_ID = 'RAISE_HAND_SOUND';
  67. export type ReactionEmojiProps = {
  68. /**
  69. * Reaction to be displayed.
  70. */
  71. reaction: string,
  72. /**
  73. * Id of the reaction.
  74. */
  75. uid: number
  76. }
  77. export const SOUNDS_THRESHOLDS = [ 1, 4, 10 ];
  78. export const REACTIONS = {
  79. like: {
  80. message: ':thumbs_up:',
  81. emoji: '👍',
  82. shortcutChar: 'T',
  83. soundId: LIKE_SOUND_ID,
  84. soundFiles: LIKE_SOUND_FILES
  85. },
  86. clap: {
  87. message: ':clap:',
  88. emoji: '👏',
  89. shortcutChar: 'C',
  90. soundId: CLAP_SOUND_ID,
  91. soundFiles: CLAP_SOUND_FILES
  92. },
  93. laugh: {
  94. message: ':grinning_face:',
  95. emoji: '😀',
  96. shortcutChar: 'L',
  97. soundId: LAUGH_SOUND_ID,
  98. soundFiles: LAUGH_SOUND_FILES
  99. },
  100. surprised: {
  101. message: ':face_with_open_mouth:',
  102. emoji: '😮',
  103. shortcutChar: 'O',
  104. soundId: SURPRISE_SOUND_ID,
  105. soundFiles: SURPRISE_SOUND_FILES
  106. },
  107. boo: {
  108. message: ':slightly_frowning_face:',
  109. emoji: '🙁',
  110. shortcutChar: 'B',
  111. soundId: BOO_SOUND_ID,
  112. soundFiles: BOO_SOUND_FILES
  113. },
  114. silence: {
  115. message: ':face_without_mouth:',
  116. emoji: '😶',
  117. shortcutChar: 'S',
  118. soundId: SILENCE_SOUND_ID,
  119. soundFiles: SILENCE_SOUND_FILES
  120. }
  121. };