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