playable
Version:
Video player based on HTML5Video
97 lines • 3.44 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var player_api_decorator_1 = (0, tslib_1.__importDefault)(require("../../../core/player-api-decorator"));
var top_block_view_1 = (0, tslib_1.__importDefault)(require("./top-block.view"));
var TopBlock = /** @class */ (function () {
function TopBlock(dependencies) {
this._isBlockFocused = false;
this.isHidden = false;
this._bindViewCallbacks();
this._initUI(this._getElements(dependencies));
}
TopBlock.prototype._bindViewCallbacks = function () {
this._setFocusState = this._setFocusState.bind(this);
this._removeFocusState = this._removeFocusState.bind(this);
};
TopBlock.prototype._initUI = function (elements) {
var config = {
elements: elements,
callbacks: {
onBlockMouseMove: this._setFocusState,
onBlockMouseOut: this._removeFocusState,
},
};
this.view = new TopBlock.View(config);
};
TopBlock.prototype._getElements = function (dependencies) {
var title = dependencies.title, liveIndicator = dependencies.liveIndicator;
return {
title: title.getElement(),
liveIndicator: liveIndicator.getElement(),
};
};
TopBlock.prototype._setFocusState = function () {
this._isBlockFocused = true;
};
TopBlock.prototype._removeFocusState = function () {
this._isBlockFocused = false;
};
Object.defineProperty(TopBlock.prototype, "isFocused", {
get: function () {
return this._isBlockFocused;
},
enumerable: false,
configurable: true
});
TopBlock.prototype.getElement = function () {
return this.view.getElement();
};
TopBlock.prototype.hide = function () {
this.isHidden = true;
this.view.hide();
};
TopBlock.prototype.show = function () {
this.isHidden = false;
this.view.show();
};
TopBlock.prototype.showTitle = function () {
this.view.showTitle();
};
TopBlock.prototype.hideTitle = function () {
this.view.hideTitle();
};
TopBlock.prototype.showLiveIndicator = function () {
this.view.showLiveIndicator();
};
TopBlock.prototype.hideLiveIndicator = function () {
this.view.hideLiveIndicator();
};
TopBlock.prototype.showContent = function () {
this.view.showContent();
};
TopBlock.prototype.hideContent = function () {
this.view.hideContent();
};
TopBlock.prototype.destroy = function () {
this.view.destroy();
};
TopBlock.moduleName = 'topBlock';
TopBlock.View = top_block_view_1.default;
TopBlock.dependencies = ['title', 'liveIndicator'];
(0, tslib_1.__decorate)([
(0, player_api_decorator_1.default)()
], TopBlock.prototype, "showTitle", null);
(0, tslib_1.__decorate)([
(0, player_api_decorator_1.default)()
], TopBlock.prototype, "hideTitle", null);
(0, tslib_1.__decorate)([
(0, player_api_decorator_1.default)()
], TopBlock.prototype, "showLiveIndicator", null);
(0, tslib_1.__decorate)([
(0, player_api_decorator_1.default)()
], TopBlock.prototype, "hideLiveIndicator", null);
return TopBlock;
}());
exports.default = TopBlock;
//# sourceMappingURL=top-block.js.map