@wizpanda/super-gif
Advanced tools
Comparing version 0.0.2 to 0.0.3
export declare class SuperGif { | ||
private gifImgElement; | ||
private options; | ||
private stream; | ||
private hdr; | ||
@@ -42,6 +41,6 @@ private loadErrorCause; | ||
private clear; | ||
private doParse; | ||
private parseStream; | ||
private setSizes; | ||
private drawError; | ||
private doLoadError; | ||
private handleError; | ||
private doHdr; | ||
@@ -48,0 +47,0 @@ private doGCE; |
@@ -161,9 +161,9 @@ "use strict"; | ||
// callbacks are involved. | ||
SuperGif.prototype.doParse = function () { | ||
SuperGif.prototype.parseStream = function (stream) { | ||
try { | ||
var parser = new parser_1.SuperGifParser(this.stream, this.handler); | ||
var parser = new parser_1.SuperGifParser(stream, this.handler); | ||
parser.parse(); | ||
} | ||
catch (err) { | ||
this.doLoadError('parse'); | ||
this.handleError('parse'); | ||
} | ||
@@ -191,3 +191,3 @@ }; | ||
}; | ||
SuperGif.prototype.doLoadError = function (originOfError) { | ||
SuperGif.prototype.handleError = function (originOfError) { | ||
this.loadErrorCause = originOfError; | ||
@@ -367,3 +367,4 @@ this.hdr = { | ||
if (request.status !== 200) { | ||
_this.doLoadError('xhr - response'); | ||
_this.handleError('xhr - response'); | ||
return; | ||
} | ||
@@ -374,7 +375,9 @@ var data = request.response; | ||
} | ||
_this.stream = new stream_1.SuperGifStream(data); | ||
setTimeout(_this.doParse.bind(_this), 0); | ||
var stream = new stream_1.SuperGifStream(data); | ||
setTimeout(function () { | ||
_this.parseStream(stream); | ||
}, 0); | ||
}; | ||
request.onerror = function () { | ||
_this.doLoadError('xhr'); | ||
_this.handleError('xhr'); | ||
}; | ||
@@ -381,0 +384,0 @@ request.send(); |
{ | ||
"name": "@wizpanda/super-gif", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "GIF parser & player in Typescript to work with node_modules (converted from https://github.com/buzzfeed/libgif-js)", | ||
@@ -9,3 +9,3 @@ "main": "dist/super-gif.js", | ||
"build": "tsc", | ||
"version": "npm run build", | ||
"version": "npm run build && npm publish --access public", | ||
"postversion": "git push && git push --tags", | ||
@@ -12,0 +12,0 @@ "test": "echo \"Error: no test specified\" && exit 1" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
827
62268