"use strict";
var __reflect = (this && this.__reflect) || function (p, c, t) {
    p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;
};
Object.defineProperty(exports, "__esModule", { value: true });
// import { MovieClip } from './../../libs/svga/MovieClip';
// import { Parser } from './../../libs/svga/parser';
var SVGACtrl = (function () {
    function SVGACtrl() {
        this.SVGAPool = [];
    }
    Object.defineProperty(SVGACtrl, "instance", {
        get: function () { return SVGACtrl._instance || (SVGACtrl._instance = new SVGACtrl()); },
        enumerable: true,
        configurable: true
    });
    SVGACtrl.prototype.load = function (path) {
        var _this = this;
        return new Promise(function (resolve, reject) {
            var parser = new window['SVGA'].Parser();
            parser.load(path, function (videoItem) {
                var mv = new window['SVGA'].EgretMovieClip(videoItem);
                _this.SVGAPool.push(mv);
                resolve(mv);
                var fun;
                mv.addEventListener(egret.Event.COMPLETE, fun = function () {
                    console.log("svga加载完成");
                    mv.removeEventListener(egret.Event.COMPLETE, fun, this);
                    mv.stop();
                    mv.startAniRange(30, 60);
                }, _this);
            }, function (error) {
                reject(error.message);
            });
        });
    };
    SVGACtrl.prototype.play = function () {
    };
    return SVGACtrl;
}());
exports.default = SVGACtrl;
__reflect(SVGACtrl.prototype, "\"e:/zqty/egret/src/ctrls/svgaCtrl\".SVGACtrl");
//# sourceMappingURL=svgaCtrl.js.map