UNPKG

playable

Version:

Video player based on HTML5Video

88 lines 3.79 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var view_1 = (0, tslib_1.__importDefault)(require("../core/view")); var templates_1 = require("./templates"); var htmlToElement_1 = (0, tslib_1.__importDefault)(require("../core/htmlToElement")); var interaction_indicator_scss_1 = (0, tslib_1.__importDefault)(require("./interaction-indicator.scss")); var SECONDS_COUNT = 5; var InteractionIndicatorView = /** @class */ (function (_super) { (0, tslib_1.__extends)(InteractionIndicatorView, _super); function InteractionIndicatorView() { var _this = _super.call(this) || this; _this._$rootElement = (0, htmlToElement_1.default)((0, templates_1.containerTemplate)({ styles: _this.styleNames, })); _this._playIcon = (0, templates_1.playIconTemplate)({ styles: _this.styleNames, }); _this._pauseIcon = (0, templates_1.pauseIconTemplate)({ styles: _this.styleNames, }); _this._forwardIcon = (0, templates_1.forwardIconTemplate)({ texts: { SECONDS_COUNT: SECONDS_COUNT, }, styles: _this.styleNames, }); _this._rewindIcon = (0, templates_1.rewindIconTemplate)({ texts: { SECONDS_COUNT: SECONDS_COUNT, }, styles: _this.styleNames, }); _this._increaseVolumeIcon = (0, templates_1.increaseVolumeIconTemplate)({ styles: _this.styleNames, }); _this._decreaseVolumeIcon = (0, templates_1.decreaseVolumeIconTemplate)({ styles: _this.styleNames, }); _this._muteIcon = (0, templates_1.muteIconTemplate)({ styles: _this.styleNames, }); return _this; } InteractionIndicatorView.prototype.activatePlayIcon = function () { this._$rootElement.innerHTML = this._playIcon; }; InteractionIndicatorView.prototype.activatePauseIcon = function () { this._$rootElement.innerHTML = this._pauseIcon; }; InteractionIndicatorView.prototype.activateForwardIcon = function () { this._$rootElement.innerHTML = this._forwardIcon; }; InteractionIndicatorView.prototype.activateRewindIcon = function () { this._$rootElement.innerHTML = this._rewindIcon; }; InteractionIndicatorView.prototype.activateIncreaseVolumeIcon = function () { this._$rootElement.innerHTML = this._increaseVolumeIcon; }; InteractionIndicatorView.prototype.activateDecreaseVolumeIcon = function () { this._$rootElement.innerHTML = this._decreaseVolumeIcon; }; InteractionIndicatorView.prototype.activateMuteVolumeIcon = function () { this._$rootElement.innerHTML = this._muteIcon; }; InteractionIndicatorView.prototype.deactivateIcon = function () { this._$rootElement.innerHTML = ''; }; InteractionIndicatorView.prototype.hide = function () { this._$rootElement.classList.add(this.styleNames.hidden); }; InteractionIndicatorView.prototype.show = function () { this._$rootElement.classList.remove(this.styleNames.hidden); }; InteractionIndicatorView.prototype.getElement = function () { return this._$rootElement; }; InteractionIndicatorView.prototype.destroy = function () { if (this._$rootElement.parentNode) { this._$rootElement.parentNode.removeChild(this._$rootElement); } this._$rootElement = null; }; return InteractionIndicatorView; }(view_1.default)); InteractionIndicatorView.extendStyleNames(interaction_indicator_scss_1.default); exports.default = InteractionIndicatorView; //# sourceMappingURL=interaction-indicator.view.js.map