Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

VideoTrack.js 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import React from 'react';
  2. import { connect } from 'react-redux';
  3. import AbstractVideoTrack from '../AbstractVideoTrack';
  4. import Video from './Video';
  5. /**
  6. * Component that renders a video element for a passed in video track.
  7. *
  8. * @extends AbstractVideoTrack
  9. */
  10. class VideoTrack extends AbstractVideoTrack {
  11. /**
  12. * Default values for {@code VideoTrack} component's properties.
  13. *
  14. * @static
  15. */
  16. static defaultProps = {
  17. ...AbstractVideoTrack.defaultProps,
  18. className: '',
  19. id: ''
  20. };
  21. /**
  22. * {@code VideoTrack} component's property types.
  23. *
  24. * @static
  25. */
  26. static propTypes = {
  27. ...AbstractVideoTrack.propTypes,
  28. /**
  29. * CSS classes to add to the video element.
  30. */
  31. className: React.PropTypes.string,
  32. /**
  33. * The value of the id attribute of the video. Used by the torture tests
  34. * to locate video elements.
  35. */
  36. id: React.PropTypes.string
  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. }
  55. export default connect()(VideoTrack);