1. 1 : /**
  2. 2 : * @file big-play-button.js
  3. 3 : */
  4. 4 : import Button from './button.js';
  5. 5 : import Component from './component.js';
  6. 6 :
  7. 7 : /**
  8. 8 : * The initial play button that shows before the video has played. The hiding of the
  9. 9 : * `BigPlayButton` get done via CSS and `Player` states.
  10. 10 : *
  11. 11 : * @extends Button
  12. 12 : */
  13. 13 : class BigPlayButton extends Button {
  14. 14 :
  15. 15 : /**
  16. 16 : * Builds the default DOM `className`.
  17. 17 : *
  18. 18 : * @return {string}
  19. 19 : * The DOM `className` for this object. Always returns 'vjs-big-play-button'.
  20. 20 : */
  21. 21 : buildCSSClass() {
  22. 22 : return 'vjs-big-play-button';
  23. 23 : }
  24. 24 :
  25. 25 : /**
  26. 26 : * This gets called when a `BigPlayButton` "clicked". See {@link ClickableComponent}
  27. 27 : * for more detailed information on what a click can be.
  28. 28 : *
  29. 29 : * @param {EventTarget~Event} event
  30. 30 : * The `keydown`, `tap`, or `click` event that caused this function to be
  31. 31 : * called.
  32. 32 : *
  33. 33 : * @listens tap
  34. 34 : * @listens click
  35. 35 : */
  36. 36 : handleClick(event) {
  37. 37 : this.player_.play();
  38. 38 : }
  39. 39 : }
  40. 40 :
  41. 41 : /**
  42. 42 : * The text that should display over the `BigPlayButton`s controls. Added to for localization.
  43. 43 : *
  44. 44 : * @type {string}
  45. 45 : * @private
  46. 46 : */
  47. 47 : BigPlayButton.prototype.controlText_ = 'Play Video';
  48. 48 :
  49. 49 : Component.registerComponent('BigPlayButton', BigPlayButton);
  50. 50 : export default BigPlayButton;