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

VideoTrack.js 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* @flow */
  2. import React from 'react';
  3. import { connect } from '../../../redux';
  4. import AbstractVideoTrack from '../AbstractVideoTrack';
  5. import type { Props as AbstractVideoTrackProps } from '../AbstractVideoTrack';
  6. import Video from './Video';
  7. /**
  8. * The type of the React {@code Component} props of {@link VideoTrack}.
  9. */
  10. type Props = AbstractVideoTrackProps & {
  11. /**
  12. * CSS classes to add to the video element.
  13. */
  14. className: string,
  15. /**
  16. * The value of the id attribute of the video. Used by the torture tests
  17. * to locate video elements.
  18. */
  19. id: string
  20. };
  21. /**
  22. * Component that renders a video element for a passed in video track and
  23. * notifies the store when the video has started playing.
  24. *
  25. * @extends AbstractVideoTrack
  26. */
  27. class VideoTrack extends AbstractVideoTrack<Props> {
  28. /**
  29. * Default values for {@code VideoTrack} component's properties.
  30. *
  31. * @static
  32. */
  33. static defaultProps = {
  34. className: '',
  35. id: ''
  36. };
  37. /**
  38. * Renders the video element.
  39. *
  40. * @override
  41. * @returns {ReactElement}
  42. */
  43. render() {
  44. return (
  45. <Video
  46. autoPlay = { true }
  47. className = { this.props.className }
  48. id = { this.props.id }
  49. onVideoPlaying = { this._onVideoPlaying }
  50. videoTrack = { this.props.videoTrack } />
  51. );
  52. }
  53. _onVideoPlaying: () => void;
  54. }
  55. export default connect()(VideoTrack);