Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option for getting output of specific frames #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
startFrame = 1000000,
endFrame = 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