UNPKG

playable

Version:

Video player based on HTML5Video

48 lines 1.83 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var preview_thumbnail_view_1 = (0, tslib_1.__importDefault)(require("./preview-thumbnail.view")); var PreviewThumbnail = /** @class */ (function () { function PreviewThumbnail(_a) { var previewService = _a.previewService; this._previewService = previewService; this._initUI(); } PreviewThumbnail.prototype._initUI = function () { this.view = new PreviewThumbnail.View(); }; PreviewThumbnail.prototype.getElement = function () { return this.view.getElement(); }; PreviewThumbnail.prototype.showAt = function (second) { var config = this._previewService.getAt(second); if (!config) { this.view.showAsEmpty(); return; } this.view.showWithPreview(); if (this._currentFrames) { if (this._currentFrames[0].spriteUrl !== config[0].spriteUrl) { this.view.clearLowQualityPreview(); } if (this._currentFrames[1].spriteUrl !== config[1].spriteUrl) { this.view.clearHighQualityPreview(); } } this.view.setLowQualityPreview(config[0]); this.view.setHighQualityPreview(config[1]); this._currentFrames = config; }; PreviewThumbnail.prototype.setTime = function (time) { this.view.setTime(time); }; PreviewThumbnail.prototype.destroy = function () { this.view.destroy(); }; PreviewThumbnail.moduleName = 'previewThumbnail'; PreviewThumbnail.View = preview_thumbnail_view_1.default; PreviewThumbnail.dependencies = ['previewService']; return PreviewThumbnail; }()); exports.default = PreviewThumbnail; //# sourceMappingURL=preview-thumbnail.js.map