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.

EmbedMeetingDialog.js 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // @flow
  2. import React from 'react';
  3. import { connect } from 'react-redux';
  4. import CopyButton from '../../base/buttons/CopyButton';
  5. import { getInviteURL } from '../../base/connection';
  6. import { Dialog } from '../../base/dialog';
  7. import { translate } from '../../base/i18n';
  8. type Props = {
  9. /**
  10. * Invoked to obtain translated strings.
  11. */
  12. t: Function,
  13. /**
  14. * The URL of the conference.
  15. */
  16. url: string
  17. };
  18. /**
  19. * Allow users to embed a jitsi meeting in an iframe.
  20. *
  21. * @returns {React$Element<any>}
  22. */
  23. function EmbedMeeting({ t, url }: Props) {
  24. /**
  25. * Get the embed code for a jitsi meeting.
  26. *
  27. * @returns {string} The iframe embed code.
  28. */
  29. const getEmbedCode = () =>
  30. `<iframe allow="camera; microphone; fullscreen; display-capture" src="${url}"`
  31. + ' style="height: 100%; width: 100%; border: 0px;"></iframe>';
  32. return (
  33. <Dialog
  34. hideCancelButton = { true }
  35. submitDisabled = { true }
  36. titleKey = { 'embedMeeting.title' }
  37. width = 'small'>
  38. <div className = 'embed-meeting-dialog'>
  39. <textarea
  40. className = 'embed-meeting-code'
  41. readOnly = { true }
  42. value = { getEmbedCode() } />
  43. <CopyButton
  44. className = 'embed-meeting-copy'
  45. displayedText = { t('dialog.copy') }
  46. textOnCopySuccess = { t('dialog.copied') }
  47. textOnHover = { t('dialog.copy') }
  48. textToCopy = { getEmbedCode() } />
  49. </div>
  50. </Dialog>
  51. );
  52. }
  53. const mapStateToProps = state => {
  54. return {
  55. url: getInviteURL(state)
  56. };
  57. };
  58. export default translate(connect(mapStateToProps)(EmbedMeeting));