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

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