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.

Toolbar.web.js 2.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. import React from 'react';
  2. import { connect } from 'react-redux';
  3. import { MEDIA_TYPE } from '../../base/media';
  4. import { Container } from '../../base/react';
  5. import { ColorPalette } from '../../base/styles';
  6. import {
  7. AbstractToolbar,
  8. mapStateToProps
  9. } from './AbstractToolbar';
  10. import { styles } from './styles';
  11. import ToolbarButton from './ToolbarButton';
  12. /**
  13. * Implements the conference toolbar on Web.
  14. *
  15. * @extends AbstractToolbar
  16. */
  17. class Toolbar extends AbstractToolbar {
  18. /**
  19. * Implements React's {@link Component#render()}.
  20. *
  21. * @inheritdoc
  22. * @returns {ReactElement}
  23. */
  24. render() {
  25. const audioButtonStyles = this._getMuteButtonStyles(MEDIA_TYPE.AUDIO);
  26. const videoButtonStyles = this._getMuteButtonStyles(MEDIA_TYPE.VIDEO);
  27. return (
  28. <Container
  29. style = { styles.toolbarContainer }
  30. visible = { this.props.visible }>
  31. <div style = { styles.toolbarButtonsContainer }>
  32. <ToolbarButton
  33. iconName = { audioButtonStyles.iconName }
  34. iconStyle = { audioButtonStyles.iconStyle }
  35. // eslint-disable-next-line react/jsx-handler-names
  36. onClick = { this._toggleAudio }
  37. style = { audioButtonStyles.buttonStyle } />
  38. <ToolbarButton
  39. iconName = 'phone'
  40. iconStyle = { styles.icon }
  41. onClick = { this._onHangup }
  42. style = {{
  43. ...styles.toolbarButton,
  44. backgroundColor: ColorPalette.jitsiRed
  45. }} />
  46. <ToolbarButton
  47. iconName = { videoButtonStyles.iconName }
  48. iconStyle = { videoButtonStyles.iconStyle }
  49. // eslint-disable-next-line react/jsx-handler-names
  50. onClick = { this._toggleVideo }
  51. style = { videoButtonStyles.buttonStyle } />
  52. </div>
  53. </Container>
  54. );
  55. }
  56. }
  57. /**
  58. * Additional properties for various icons, which are now platform-dependent.
  59. * This is done to have common logic of generating styles for web and native.
  60. * TODO As soon as we have common font sets for web and native, this will no
  61. * longer be required.
  62. */
  63. Object.assign(Toolbar.prototype, {
  64. audioIcon: 'microphone',
  65. audioMutedIcon: 'microphone-slash',
  66. videoIcon: 'video-camera',
  67. // TODO Currently, for web version we're using default FontAwesome font set,
  68. // which doesn't have 'slashed' version of 'video-camera' icon. But this
  69. // should be changed as soon as we start to use custom Jitsi icons.
  70. videoMutedIcon: 'video-camera'
  71. });
  72. /**
  73. * Toolbar component's property types.
  74. *
  75. * @static
  76. */
  77. Toolbar.propTypes = AbstractToolbar.propTypes;
  78. export default connect(mapStateToProps)(Toolbar);