JSON2Video provides you with SDKs for the most popular programming languages to make the implementation even easier. We currently support PHP and NodeJS, but other SDKs are in the short-term pipeline: Python, Go and other.
SDK basic concepts
All our SDKs have common concepts you should understand:
-
SDKs are Object-oriented
There are 2 main classes to use:MovieandScene -
Movie class
Represents the movie JSON schema and allows to define the output video properties and the calls to the API (renderandgetStatus). -
Scene class
Represents the scene JSON schema and defines the different scenes in the Movie object. -
Elements are created as JSON objects
Elements do not have a dedicated class or object. Instead, they are created as simple JSON objects. -
Hyphens become underscores in property names
Property names in the Movie and Scene schemes that include hyphens (likebackground-color), the hyphen is always translated to underscores (like in$scene->background_color).
Steps for creating a video with the SDKs
1. Create and setup the Movie object
- Create the
Movieobject - Set your API key (that will be sent in the
x-api-keyheader) - Define your desired resolution and quality (optional)
2. Create one or more Scenes
- Create one or more
Sceneobjects - Add elements to them with the
addElementmethod - Add the scenes to the movie with the
addScenemethod
3. Send the render request
- Post the movie to be rendered with the
rendermethod
4. Check the render status
- Check the status of your rendering job calling the
getStatusmethod every few seconds