Encoding the captured frames as a GIF can take a long time. Especially when there are many frames. Users may want to abort the GIF encoding after it starts.
The gif.js library supports this with an abort() function. But the CCapture object doesn't expose the gif.js encoder to the caller. This prevents gif.js's abort() function from being callable.
This pull request modifies the CCGIFEncoder's save() function to return the gif.js abort() function:
This PR is mostly to share my workaround I've been using. Rather than expecting it to be merged. If there are better suggestions to achieve the functionality, they can be shared here.
Adds support for aborting GIF encoding.
Encoding the captured frames as a GIF can take a long time. Especially when there are many frames. Users may want to abort the GIF encoding after it starts.
The gif.js library supports this with an abort() function. But the CCapture object doesn't expose the gif.js encoder to the caller. This prevents gif.js's
abort()
function from being callable.This pull request modifies the
CCGIFEncoder
'ssave()
function to return the gif.jsabort()
function: