Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

EmbedMeetingDialog.js 1.9KB

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. 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; autoplay" 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. aria-label = { t('dialog.embedMeeting') }
  41. className = 'embed-meeting-code'
  42. readOnly = { true }
  43. value = { getEmbedCode() } />
  44. <CopyButton
  45. aria-label = { t('addPeople.copyLink') }
  46. className = 'embed-meeting-copy'
  47. displayedText = { t('dialog.copy') }
  48. textOnCopySuccess = { t('dialog.copied') }
  49. textOnHover = { t('dialog.copy') }
  50. textToCopy = { getEmbedCode() } />
  51. </div>
  52. </Dialog>
  53. );
  54. }
  55. const mapStateToProps = state => {
  56. return {
  57. url: getInviteURL(state)
  58. };
  59. };
  60. export default translate(connect(mapStateToProps)(EmbedMeeting));