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

VideoTrack.js 1.5KB

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