Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

Captions.web.js 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // @flow
  2. import React from 'react';
  3. import { connect } from '../../base/redux';
  4. import {
  5. _abstractMapStateToProps,
  6. AbstractCaptions,
  7. type AbstractCaptionsProps as Props
  8. } from './AbstractCaptions';
  9. /**
  10. * React {@code Component} which can display speech-to-text results from
  11. * Jigasi as subtitles.
  12. */
  13. class Captions
  14. extends AbstractCaptions<Props> {
  15. /**
  16. * Renders the transcription text.
  17. *
  18. * @param {string} id - The ID of the transcript message from which the
  19. * {@code text} has been created.
  20. * @param {string} text - Subtitles text formatted with the participant's
  21. * name.
  22. * @protected
  23. * @returns {React$Element} - The React element which displays the text.
  24. */
  25. _renderParagraph(id: string, text: string): React$Element<*> {
  26. return (
  27. <p key = { id }>
  28. <span>{ text }</span>
  29. </p>
  30. );
  31. }
  32. /**
  33. * Renders the subtitles container.
  34. *
  35. * @param {Array<React$Element>} paragraphs - An array of elements created
  36. * for each subtitle using the {@link _renderParagraph} method.
  37. * @protected
  38. * @returns {React$Element} - The subtitles container.
  39. */
  40. _renderSubtitlesContainer(
  41. paragraphs: Array<React$Element<*>>): React$Element<*> {
  42. return (
  43. <div className = 'transcription-subtitles' >
  44. { paragraphs }
  45. </div>
  46. );
  47. }
  48. }
  49. export default connect(_abstractMapStateToProps)(Captions);