polotno-node 2.4.2 → 2.5.0
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 +22 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -231,6 +231,28 @@ const url = await instance.run(async (json) => {
|
|
|
231
231
|
}, json);
|
|
232
232
|
```
|
|
233
233
|
|
|
234
|
+
## Video export
|
|
235
|
+
|
|
236
|
+
**This part is currently under development and API will change.**
|
|
237
|
+
|
|
238
|
+
```js
|
|
239
|
+
import { createInstance } from 'polotno-node';
|
|
240
|
+
import { jsonToVideo } from 'polotno/video';
|
|
241
|
+
|
|
242
|
+
// create working instance
|
|
243
|
+
const instance = await createInstance({
|
|
244
|
+
key: '...key...',
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
// load sample json
|
|
248
|
+
const json = JSON.parse(fs.readFileSync('./test-data/video.json'));
|
|
249
|
+
const page = await instance.createPage();
|
|
250
|
+
|
|
251
|
+
await jsonToVideo(page, json, { out: 'out.mp4' });
|
|
252
|
+
|
|
253
|
+
await instance.close();
|
|
254
|
+
```
|
|
255
|
+
|
|
234
256
|
## Your own client
|
|
235
257
|
|
|
236
258
|
By default `polotno-node` ships with the default Polotno Editor with its (hopefully) last version. If you use experimental API such as `unstable_registerShapeModel` and `unstable_registerShapeComponent`, the rendering may fail if you use unknown elements types.
|