Source: ui/big_play_button.js

  1. /*! @license
  2. * Shaka Player
  3. * Copyright 2016 Google LLC
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. goog.provide('shaka.ui.BigPlayButton');
  7. goog.require('shaka.ui.PlayButton');
  8. goog.requireType('shaka.ui.Controls');
  9. /**
  10. * @extends {shaka.ui.PlayButton}
  11. * @final
  12. * @export
  13. */
  14. shaka.ui.BigPlayButton = class extends shaka.ui.PlayButton {
  15. /**
  16. * @param {!HTMLElement} parent
  17. * @param {!shaka.ui.Controls} controls
  18. */
  19. constructor(parent, controls) {
  20. super(parent, controls);
  21. this.button.classList.add('shaka-play-button');
  22. this.button.classList.add('shaka-no-propagation');
  23. }
  24. /** @override */
  25. updateIcon() {
  26. if (this.isEnded()) {
  27. this.button.setAttribute('icon', 'replay');
  28. } else if (this.isPaused()) {
  29. this.button.setAttribute('icon', 'play');
  30. } else {
  31. this.button.setAttribute('icon', 'pause');
  32. }
  33. }
  34. };