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

VideoTrack.js 1.5KB

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