Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

constants.js 5.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. // @flow
  2. import { BoxModel } from '../base/styles';
  3. import { LAYOUTS } from '../video-layout/constants';
  4. /**
  5. * The size (height and width) of the small (not tile view) thumbnails.
  6. */
  7. export const SMALL_THUMBNAIL_SIZE = 80;
  8. /**
  9. * The height of the filmstrip in narrow aspect ratio, or width in wide.
  10. */
  11. export const FILMSTRIP_SIZE = SMALL_THUMBNAIL_SIZE + BoxModel.margin;
  12. /**
  13. * The aspect ratio of a tile in tile view.
  14. */
  15. export const TILE_ASPECT_RATIO = 16 / 9;
  16. /**
  17. * The aspect ratio of a square tile in tile view.
  18. */
  19. export const SQUARE_TILE_ASPECT_RATIO = 1;
  20. /**
  21. * Width below which the overflow menu(s) will be displayed as drawer(s).
  22. */
  23. export const DISPLAY_DRAWER_THRESHOLD = 512;
  24. /**
  25. * Breakpoint past which a single column view is enforced in tile view.
  26. */
  27. export const SINGLE_COLUMN_BREAKPOINT = 300;
  28. /**
  29. * Breakpoint past which a two column view is enforced in tile view.
  30. */
  31. export const TWO_COLUMN_BREAKPOINT = 1000;
  32. /**
  33. * Breakpoint past which the aspect ratio is switched in tile view.
  34. * Also, past this breakpoint, if there are two participants in the conference, we enforce
  35. * single column view.
  36. * If this is to be modified, please also change the related media query from the tile_view scss file.
  37. */
  38. export const ASPECT_RATIO_BREAKPOINT = 500;
  39. /**
  40. * The default number of columns for tile view.
  41. */
  42. export const DEFAULT_MAX_COLUMNS = 5;
  43. /**
  44. * An extended number of columns for tile view.
  45. */
  46. export const ABSOLUTE_MAX_COLUMNS = 7;
  47. /**
  48. * An array of attributes of the video element that will be used for adding a listener for every event in the list.
  49. * The latest event will be stored in redux. This is currently used by torture only.
  50. */
  51. export const VIDEO_TEST_EVENTS = [
  52. 'onAbort',
  53. 'onCanPlay',
  54. 'onCanPlayThrough',
  55. 'onEmptied',
  56. 'onEnded',
  57. 'onError',
  58. 'onLoadedData',
  59. 'onLoadedMetadata',
  60. 'onLoadStart',
  61. 'onPause',
  62. 'onPlay',
  63. 'onPlaying',
  64. 'onRateChange',
  65. 'onStalled',
  66. 'onSuspend',
  67. 'onWaiting'
  68. ];
  69. /**
  70. * Display mode constant used when video is being displayed on the small video.
  71. *
  72. * @type {number}
  73. * @constant
  74. */
  75. export const DISPLAY_VIDEO = 0;
  76. /**
  77. * Display mode constant used when the user's avatar is being displayed on
  78. * the small video.
  79. *
  80. * @type {number}
  81. * @constant
  82. */
  83. export const DISPLAY_AVATAR = 1;
  84. /**
  85. * Maps the display modes to class name that will be applied on the thumbnail container.
  86. *
  87. * @type {Array<string>}
  88. * @constant
  89. */
  90. export const DISPLAY_MODE_TO_CLASS_NAME = [
  91. 'display-video',
  92. 'display-avatar-only'
  93. ];
  94. /**
  95. * The vertical margin of a tile.
  96. *
  97. * @type {number}
  98. */
  99. export const TILE_VERTICAL_MARGIN = 4;
  100. /**
  101. * The horizontal margin of a tile.
  102. *
  103. * @type {number}
  104. */
  105. export const TILE_HORIZONTAL_MARGIN = 4;
  106. /**
  107. * The vertical margin of the tile grid container.
  108. *
  109. * @type {number}
  110. */
  111. export const TILE_VIEW_GRID_VERTICAL_MARGIN = 12;
  112. /**
  113. * The horizontal margin of the tile grid container.
  114. *
  115. * @type {number}
  116. */
  117. export const TILE_VIEW_GRID_HORIZONTAL_MARGIN = 12;
  118. /**
  119. * The height of the whole toolbar.
  120. */
  121. export const TOOLBAR_HEIGHT = 72;
  122. /**
  123. * The height of the whole toolbar.
  124. */
  125. export const TOOLBAR_HEIGHT_MOBILE = 60;
  126. /**
  127. * The size of the horizontal border of a thumbnail.
  128. *
  129. * @type {number}
  130. */
  131. export const STAGE_VIEW_THUMBNAIL_HORIZONTAL_BORDER = 4;
  132. /**
  133. * The size of the vertical border of a thumbnail.
  134. *
  135. * @type {number}
  136. */
  137. export const STAGE_VIEW_THUMBNAIL_VERTICAL_BORDER = 4;
  138. /**
  139. * The size of the scroll.
  140. *
  141. * @type {number}
  142. */
  143. export const SCROLL_SIZE = 7;
  144. /**
  145. * The total vertical space between the thumbnails container and the edges of the window.
  146. *
  147. * NOTE: This will include margins, paddings and the space for the 'hide filmstrip' icon.
  148. *
  149. * @type {number}
  150. */
  151. export const VERTICAL_FILMSTRIP_VERTICAL_MARGIN = 60;
  152. /**
  153. * The min horizontal space between the thumbnails container and the edges of the window.
  154. *
  155. * @type {number}
  156. */
  157. export const VERTICAL_FILMSTRIP_MIN_HORIZONTAL_MARGIN = 10;
  158. /**
  159. * The total horizontal space between the thumbnails container and the edges of the window.
  160. *
  161. * NOTE: This will include margins, paddings and the space for the 'hide filmstrip' icon.
  162. *
  163. * @type {number}
  164. */
  165. export const HORIZONTAL_FILMSTRIP_MARGIN = 39;
  166. /**
  167. * Sets after how many ms to show the thumbnail context menu on long touch on mobile.
  168. *
  169. * @type {number}
  170. */
  171. export const SHOW_TOOLBAR_CONTEXT_MENU_AFTER = 600;
  172. /**
  173. * The margin for each side of the tile view. Taken away from the available
  174. * height and width for the tile container to display in.
  175. *
  176. * NOTE: Mobile specific.
  177. *
  178. * @private
  179. * @type {number}
  180. */
  181. export const TILE_MARGIN = 10;
  182. /**
  183. * The popover position for the connection stats table.
  184. */
  185. export const STATS_POPOVER_POSITION = {
  186. [LAYOUTS.TILE_VIEW]: 'right-start',
  187. [LAYOUTS.VERTICAL_FILMSTRIP_VIEW]: 'left-start',
  188. [LAYOUTS.HORIZONTAL_FILMSTRIP_VIEW]: 'top-end'
  189. };
  190. /**
  191. * The tooltip position for the indicators on the thumbnail.
  192. */
  193. export const INDICATORS_TOOLTIP_POSITION = {
  194. [LAYOUTS.TILE_VIEW]: 'right',
  195. [LAYOUTS.VERTICAL_FILMSTRIP_VIEW]: 'left',
  196. [LAYOUTS.HORIZONTAL_FILMSTRIP_VIEW]: 'top'
  197. };