polotno-node 2.6.5 → 2.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -1
- package/instance.js +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -245,9 +245,16 @@ const url = await instance.run(async (json) => {
|
|
|
245
245
|
|
|
246
246
|
**This part is currently under development and API will change.**
|
|
247
247
|
|
|
248
|
+
You may need to have ffmpeg available in your system to make it work.
|
|
249
|
+
Also you need to manually dependencies:
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
npm install fluent-ffmpeg axios
|
|
253
|
+
```
|
|
254
|
+
|
|
248
255
|
```js
|
|
249
256
|
import { createInstance } from 'polotno-node';
|
|
250
|
-
import { jsonToVideo } from 'polotno/video';
|
|
257
|
+
import { jsonToVideo } from 'polotno-node/video';
|
|
251
258
|
|
|
252
259
|
// create working instance
|
|
253
260
|
const instance = await createInstance({
|
package/instance.js
CHANGED
|
@@ -124,6 +124,10 @@ module.exports.createInstance = async ({
|
|
|
124
124
|
const result = await page.evaluate(func, ...args);
|
|
125
125
|
const error = await page.evaluate(() => window._polotnoError);
|
|
126
126
|
if (error) {
|
|
127
|
+
// clear error
|
|
128
|
+
await page.evaluate(() => {
|
|
129
|
+
window._polotnoError = null;
|
|
130
|
+
});
|
|
127
131
|
const message = error.toString();
|
|
128
132
|
const isFontError = message.indexOf('Timeout for loading font') >= 0;
|
|
129
133
|
const skipError = isFontError && args[1]?.skipFontError;
|