您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

VideoInputPreview.js 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import React, { Component } from 'react';
  2. import { VideoTrack } from '../../base/media';
  3. const VIDEO_ERROR_CLASS = 'video-preview-has-error';
  4. /**
  5. * React component for displaying video. This component defers to lib-jitsi-meet
  6. * logic for rendering the video.
  7. *
  8. * @extends Component
  9. */
  10. class VideoInputPreview extends Component {
  11. /**
  12. * VideoInputPreview component's property types.
  13. *
  14. * @static
  15. */
  16. static propTypes = {
  17. /**
  18. * An error message to display instead of a preview. Displaying an error
  19. * will take priority over displaying a video preview.
  20. */
  21. error: React.PropTypes.string,
  22. /**
  23. * The JitsiLocalTrack to display.
  24. */
  25. track: React.PropTypes.object
  26. };
  27. /**
  28. * Implements React's {@link Component#render()}.
  29. *
  30. * @inheritdoc
  31. * @returns {ReactElement}
  32. */
  33. render() {
  34. const { error } = this.props;
  35. const errorClass = error ? VIDEO_ERROR_CLASS : '';
  36. const className = `video-input-preview ${errorClass}`;
  37. return (
  38. <div className = { className }>
  39. <VideoTrack
  40. className = 'video-input-preview-display flipVideoX'
  41. triggerOnPlayingUpdate = { false }
  42. videoTrack = {{ jitsiTrack: this.props.track }} />
  43. <div className = 'video-input-preview-error'>
  44. { error || '' }
  45. </div>
  46. </div>
  47. );
  48. }
  49. }
  50. export default VideoInputPreview;