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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. import { BoxModel } from '../base/styles/components/styles/BoxModel';
  2. /**
  3. * The size (height and width) of the small (not tile view) thumbnails.
  4. */
  5. export const SMALL_THUMBNAIL_SIZE = 80;
  6. /**
  7. * The height of the filmstrip in narrow aspect ratio, or width in wide.
  8. */
  9. export const FILMSTRIP_SIZE = SMALL_THUMBNAIL_SIZE + BoxModel.margin;
  10. /**
  11. * The aspect ratio of a tile in tile view.
  12. */
  13. export const TILE_ASPECT_RATIO = 16 / 9;
  14. /**
  15. * The aspect ratio of a square tile in tile view.
  16. */
  17. export const SQUARE_TILE_ASPECT_RATIO = 1;
  18. /**
  19. * Width below which the overflow menu(s) will be displayed as drawer(s).
  20. */
  21. export const DISPLAY_DRAWER_THRESHOLD = 512;
  22. /**
  23. * Breakpoint past which the aspect ratio is switched in tile view.
  24. * Also, past this breakpoint, if there are two participants in the conference, we enforce
  25. * single column view.
  26. * If this is to be modified, please also change the related media query from the tile_view scss file.
  27. */
  28. export const ASPECT_RATIO_BREAKPOINT = 500;
  29. /**
  30. * Minimum height of tile for small screens.
  31. */
  32. export const TILE_MIN_HEIGHT_SMALL = 150;
  33. /**
  34. * Minimum height of tile for large screens.
  35. */
  36. export const TILE_MIN_HEIGHT_LARGE = 200;
  37. /**
  38. * Aspect ratio for portrait tiles.
  39. */
  40. export const TILE_PORTRAIT_ASPECT_RATIO = 1 / 1.3;
  41. /**
  42. * The default number of visible tiles for tile view.
  43. */
  44. export const TILE_VIEW_DEFAULT_NUMBER_OF_VISIBLE_TILES = 25;
  45. /**
  46. * The default number of columns for tile view.
  47. */
  48. export const DEFAULT_MAX_COLUMNS = 5;
  49. /**
  50. * An extended number of columns for tile view.
  51. */
  52. export const ABSOLUTE_MAX_COLUMNS = 7;
  53. /**
  54. * Display mode constant used when video is being displayed on the small video.
  55. *
  56. * @type {number}
  57. * @constant
  58. */
  59. export const DISPLAY_VIDEO = 0;
  60. /**
  61. * Display mode constant used when the user's avatar is being displayed on
  62. * the small video.
  63. *
  64. * @type {number}
  65. * @constant
  66. */
  67. export const DISPLAY_AVATAR = 1;
  68. /**
  69. * Maps the display modes to class name that will be applied on the thumbnail container.
  70. *
  71. * @type {Array<string>}
  72. * @constant
  73. */
  74. export const DISPLAY_MODE_TO_CLASS_NAME = [
  75. 'display-video',
  76. 'display-avatar-only'
  77. ];
  78. /**
  79. * The vertical margin of a tile.
  80. *
  81. * @type {number}
  82. */
  83. export const TILE_VERTICAL_MARGIN = 4;
  84. /**
  85. * The horizontal margin of a tile.
  86. *
  87. * @type {number}
  88. */
  89. export const TILE_HORIZONTAL_MARGIN = 4;
  90. /**
  91. * The horizontal margin of a vertical filmstrip tile container.
  92. *
  93. * @type {number}
  94. */
  95. export const TILE_VERTICAL_CONTAINER_HORIZONTAL_MARGIN = 2;
  96. /**
  97. * The vertical margin of the tile grid container.
  98. *
  99. * @type {number}
  100. */
  101. export const TILE_VIEW_GRID_VERTICAL_MARGIN = 14;
  102. /**
  103. * The horizontal margin of the tile grid container.
  104. *
  105. * @type {number}
  106. */
  107. export const TILE_VIEW_GRID_HORIZONTAL_MARGIN = 14;
  108. /**
  109. * The height of the whole toolbar.
  110. */
  111. export const TOOLBAR_HEIGHT = 72;
  112. /**
  113. * The height of the whole toolbar.
  114. */
  115. export const TOOLBAR_HEIGHT_MOBILE = 60;
  116. /**
  117. * The size of the horizontal border of a thumbnail.
  118. *
  119. * @type {number}
  120. */
  121. export const STAGE_VIEW_THUMBNAIL_HORIZONTAL_BORDER = 4;
  122. /**
  123. * The size of the vertical border of a thumbnail.
  124. *
  125. * @type {number}
  126. */
  127. export const STAGE_VIEW_THUMBNAIL_VERTICAL_BORDER = 4;
  128. /**
  129. * The size of the scroll.
  130. *
  131. * @type {number}
  132. */
  133. export const SCROLL_SIZE = 7;
  134. /**
  135. * The total vertical space between the thumbnails container and the edges of the window.
  136. *
  137. * NOTE: This will include margins, paddings and the space for the 'hide filmstrip' icon.
  138. *
  139. * @type {number}
  140. */
  141. export const VERTICAL_FILMSTRIP_VERTICAL_MARGIN = 26;
  142. /**
  143. * The min horizontal space between the thumbnails container and the edges of the window.
  144. *
  145. * @type {number}
  146. */
  147. export const VERTICAL_FILMSTRIP_MIN_HORIZONTAL_MARGIN = 10;
  148. /**
  149. * The total horizontal space between the thumbnails container and the edges of the window.
  150. *
  151. * NOTE: This will include margins, paddings and the space for the 'hide filmstrip' icon.
  152. *
  153. * @type {number}
  154. */
  155. export const HORIZONTAL_FILMSTRIP_MARGIN = 39;
  156. /**
  157. * Sets after how many ms to show the thumbnail context menu on long touch on mobile.
  158. *
  159. * @type {number}
  160. */
  161. export const SHOW_TOOLBAR_CONTEXT_MENU_AFTER = 600;
  162. /**
  163. * The margin for each side of the tile view. Taken away from the available
  164. * width for the tile container to display in.
  165. *
  166. * NOTE: Mobile specific.
  167. *
  168. * @private
  169. * @type {number}
  170. */
  171. export const TILE_MARGIN = 10;
  172. /**
  173. * The types of thumbnails for filmstrip.
  174. */
  175. export const THUMBNAIL_TYPE = {
  176. TILE: 'TILE',
  177. VERTICAL: 'VERTICAL',
  178. HORIZONTAL: 'HORIZONTAL'
  179. };
  180. /**
  181. * The popover position for the connection stats table.
  182. */
  183. export const STATS_POPOVER_POSITION = {
  184. [THUMBNAIL_TYPE.TILE]: 'right-start',
  185. [THUMBNAIL_TYPE.VERTICAL]: 'left-start',
  186. [THUMBNAIL_TYPE.HORIZONTAL]: 'top-end'
  187. };
  188. /**
  189. * The tooltip position for the indicators on the thumbnail.
  190. */
  191. export const INDICATORS_TOOLTIP_POSITION: {
  192. [x: string]: 'right' | 'left' | 'top';
  193. } = {
  194. [THUMBNAIL_TYPE.TILE]: 'right',
  195. [THUMBNAIL_TYPE.VERTICAL]: 'left',
  196. [THUMBNAIL_TYPE.HORIZONTAL]: 'top'
  197. };
  198. /**
  199. * The default (and minimum) width for the vertical filmstrip (user resizable).
  200. */
  201. export const DEFAULT_FILMSTRIP_WIDTH = 120;
  202. /**
  203. * The default aspect ratio for the local tile.
  204. */
  205. export const DEFAULT_LOCAL_TILE_ASPECT_RATIO = 16 / 9;
  206. /**
  207. * The width of the filmstrip at which it no longer goes above the stage view, but it pushes it.
  208. */
  209. export const FILMSTRIP_BREAKPOINT = 180;
  210. /**
  211. * The width of the filmstrip at which the display mode changes from column to grid.
  212. */
  213. export const FILMSTRIP_GRID_BREAKPOINT = 300;
  214. /**
  215. * How much before the breakpoint should we display the background.
  216. * (We display the opaque background before we resize the stage view to make sure
  217. * the resize is not visible behind the filmstrip).
  218. */
  219. export const FILMSTRIP_BREAKPOINT_OFFSET = 5;
  220. /**
  221. * The minimum height for the stage view
  222. * (used to determine the maximum height of the user-resizable top panel).
  223. */
  224. export const MIN_STAGE_VIEW_HEIGHT = 700;
  225. /**
  226. * The minimum width for the stage view
  227. * (used to determine the maximum width of the user-resizable vertical filmstrip).
  228. */
  229. export const MIN_STAGE_VIEW_WIDTH = 800;
  230. /**
  231. * Horizontal margin used for the vertical filmstrip.
  232. */
  233. export const VERTICAL_VIEW_HORIZONTAL_MARGIN = VERTICAL_FILMSTRIP_MIN_HORIZONTAL_MARGIN
  234. + SCROLL_SIZE + TILE_HORIZONTAL_MARGIN + STAGE_VIEW_THUMBNAIL_HORIZONTAL_BORDER;
  235. /**
  236. * The time after which a participant should be removed from active participants.
  237. */
  238. export const ACTIVE_PARTICIPANT_TIMEOUT = 1000 * 60;
  239. /**
  240. * The types of filmstrip.
  241. */
  242. export const FILMSTRIP_TYPE = {
  243. MAIN: 'main',
  244. STAGE: 'stage',
  245. SCREENSHARE: 'screenshare'
  246. };
  247. /**
  248. * The max number of participants to be displayed on the stage filmstrip.
  249. */
  250. export const MAX_ACTIVE_PARTICIPANTS = 6;
  251. /**
  252. * Top filmstrip default height.
  253. */
  254. export const TOP_FILMSTRIP_HEIGHT = 180;