mirror of
https://github.com/shaka-project/shaka-player.git
synced 2026-06-15 16:06:41 +03:00
7d61334759
* Update all UI components to use SVG icons instead of icon fonts * Adjust some icon sizes to 32px Replacing icon fonts with inline SVGs removes the loading delay caused by font fetching. Icons now appear immediately with zero delay. Close https://github.com/shaka-project/shaka-player/issues/2467
46 lines
942 B
JavaScript
46 lines
942 B
JavaScript
/*! @license
|
|
* Shaka Player
|
|
* Copyright 2016 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
|
|
goog.provide('shaka.ui.SmallPlayButton');
|
|
|
|
goog.require('shaka.ui.Controls');
|
|
goog.require('shaka.ui.PlayButton');
|
|
|
|
|
|
/**
|
|
* @extends {shaka.ui.PlayButton}
|
|
* @final
|
|
* @export
|
|
*/
|
|
shaka.ui.SmallPlayButton = class extends shaka.ui.PlayButton {
|
|
/**
|
|
* @param {!HTMLElement} parent
|
|
* @param {!shaka.ui.Controls} controls
|
|
*/
|
|
constructor(parent, controls) {
|
|
super(parent, controls);
|
|
|
|
this.button.classList.add('shaka-small-play-button');
|
|
this.button.classList.add('shaka-tooltip');
|
|
}
|
|
};
|
|
|
|
|
|
/**
|
|
* @implements {shaka.extern.IUIElement.Factory}
|
|
* @final
|
|
*/
|
|
shaka.ui.SmallPlayButton.Factory = class {
|
|
/** @override */
|
|
create(rootElement, controls) {
|
|
return new shaka.ui.SmallPlayButton(rootElement, controls);
|
|
}
|
|
};
|
|
|
|
shaka.ui.Controls.registerElement(
|
|
'play_pause', new shaka.ui.SmallPlayButton.Factory());
|