Files
shaka-player/ui/big_play_button.js
T
Joey Parrish 22e8c29a0d Use CSS & container attributes to hide controls
This is now based solely on container attributes and CSS, as it used
to be, removing the need for a list of controls to hide in JavaScript.
This also does away with the "shaka-fade-out-on-mouse-out" CSS class.

Change-Id: Ic2f77c5b2f0691023279d9c99cfe3519f4b26cdd
2020-01-14 10:42:36 -08:00

42 lines
794 B
JavaScript

/** @license
* Copyright 2016 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
goog.provide('shaka.ui.BigPlayButton');
goog.require('shaka.ui.PlayButton');
/**
* @extends {shaka.ui.PlayButton}
* @final
* @export
*/
shaka.ui.BigPlayButton = class extends shaka.ui.PlayButton {
/**
* @param {!HTMLElement} parent
* @param {!shaka.ui.Controls} controls
*/
constructor(parent, controls) {
super(parent, controls);
this.button.classList.add('shaka-play-button');
this.button.classList.add('shaka-no-propagation');
this.updateIcon();
this.updateAriaLabel();
}
/** @override */
updateIcon() {
if (this.isPaused()) {
this.button.setAttribute('icon', 'play');
} else {
this.button.setAttribute('icon', 'pause');
}
}
};