diff options
Diffstat (limited to 'app/client/live/whammy.js')
| -rw-r--r-- | app/client/live/whammy.js | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/app/client/live/whammy.js b/app/client/live/whammy.js index 08a0ce9..762abca 100644 --- a/app/client/live/whammy.js +++ b/app/client/live/whammy.js @@ -541,12 +541,20 @@ module.exports = (function(){ WhammyVideo.prototype.compile = function(outputAsArray, callback){ this.encodeFrames(function(){ - - var webm = new toWebM(this.frames.map(function(frame){ - var webp = parseWebP(parseRIFF(atob(frame.image.slice(23)))); - webp.duration = frame.duration; - return webp; - }), outputAsArray); + var width = 0 + var height = 0 + var webm = new toWebM( + this.frames.map(function(frame){ + var webp = parseWebP(parseRIFF(atob(frame.image.slice(23)))); + webp.duration = frame.duration; + if (! webp || !webp.width || !webp.height) return null + if (! width) width = webp.width + else if (width !== webp.width) return null + if (! height) height = webp.height + else if (height !== webp.height) return null + return webp; + }).filter(function(frame){ return !!frame }) + , outputAsArray); callback(webm); }.bind(this)); |
