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

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