()
| 2145 | }; |
| 2146 | |
| 2147 | function doneRecording() { |
| 2148 | endTime = Date.now(); |
| 2149 | |
| 2150 | var gifBlob = new Blob([new Uint8Array(gifEncoder.stream().bin)], { |
| 2151 | type: 'image/gif' |
| 2152 | }); |
| 2153 | self.ondataavailable(gifBlob); |
| 2154 | |
| 2155 | // todo: find a way to clear old recorded blobs |
| 2156 | gifEncoder.stream().bin = []; |
| 2157 | } |
| 2158 | |
| 2159 | this.stop = function() { |
| 2160 | if (lastAnimationFrame) { |