Skip to content

Commit

Permalink
Option for getting output of specific frames
Browse files Browse the repository at this point in the history
Just need to use to options for rendering specific frame images
* @param {object} [opts.startFrame] - Optional lottie-web initialSegment set segment for exporting specific frame
 * @param {object} [opts.endFrame] - Optional lottie-web initialSegment set segment for exporting specific frame
  • Loading branch information
affankhan43 authored Dec 29, 2020
1 parent fa74590 commit c0bcd90
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ const injectLottie = `
* @param {string} [opts.inject.style] - Optionally injected into a <style> tag within the document <head>
* @param {string} [opts.inject.body] - Optionally injected into the document <body>
* @param {object} [opts.browser] - Optional puppeteer instance to reuse
* @param {object} [opts.startFrame] - Optional lottie-web initialSegment set segment for exporting specific frame
* @param {object} [opts.endFrame] - Optional lottie-web initialSegment set segment for exporting specific frame
*
* @return {Promise}
*/
Expand All @@ -69,6 +71,8 @@ module.exports = async (opts) => {
rendererSettings = { },
style = { },
inject = { },
startFrame = 0,
startFrame = 1000000,
puppeteerOptions = { },
ffmpegOptions = {
crf: 20,
Expand Down Expand Up @@ -217,7 +221,8 @@ ${inject.body || ''}
loop: false,
autoplay: false,
rendererSettings: ${JSON.stringify(rendererSettings)},
animationData
animationData,
initialSegment:[${startFrame},${endFrame}+1] //By default startframe=0 and endframe=1000000
})
duration = animation.getDuration()
Expand Down

0 comments on commit c0bcd90

Please sign in to comment.