polotno-node
Advanced tools
Comparing version 2.9.12 to 2.9.13
{ | ||
"name": "polotno-node", | ||
"version": "2.9.12", | ||
"version": "2.9.13", | ||
"description": "Polotno workflow from NodeJS", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -53,2 +53,3 @@ const fs = require('fs'); | ||
const videoToDataURL = async (url, tempFolder) => { | ||
console.log('Downloading video: ' + url.slice(0, 50) + '...'); | ||
const filename = Math.random().toString(36).substring(7); | ||
@@ -60,2 +61,3 @@ const destination = path.join(tempFolder.name, filename + '.mp4'); | ||
const dataURL = await fileToDataUrl(webmFile); | ||
console.log('Downloading video finished: ' + url.slice(0, 50) + '...'); | ||
return { | ||
@@ -75,6 +77,2 @@ dataURL, | ||
function printProgress(progress) { | ||
console.log('Rendering frame: ' + progress + '%'); | ||
} | ||
module.exports.jsonToVideo = async function jsonToVideo(inst, json, attrs) { | ||
@@ -175,2 +173,3 @@ const tempFolder = tmp.dirSync(); | ||
} | ||
const startTime = Date.now(); | ||
const dataURL = await page.evaluate( | ||
@@ -202,4 +201,5 @@ async (json, attrs, currentTime) => { | ||
if (attrs.onProgress) { | ||
const frameTime = Date.now() - startTime; | ||
const progress = finishedFramesNumber / framesNumber; | ||
attrs.onProgress(progress); | ||
attrs.onProgress(progress, frameTime); | ||
} | ||
@@ -206,0 +206,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1229552
5498