### Installing JSON2Video PHP SDK with Composer Source: https://github.com/json2video/json2video-php-sdk/blob/main/README.md This command demonstrates how to install the JSON2Video PHP SDK as a dependency in your project using the Composer package manager. Run this command in your project's root directory. ```shell composer require json2video/json2video-php-sdk ``` -------------------------------- ### Creating a Simple 'Hello World' Video with JSON2Video SDK in PHP Source: https://github.com/json2video/json2video-php-sdk/blob/main/README.md This example demonstrates the basic steps to create a video using the JSON2Video PHP SDK. It initializes a movie, sets the API key and quality, creates a scene with a background color and a text element, adds the scene to the movie, triggers the rendering process, and waits for the video to be generated. ```php setAPIKey(YOUR_API_KEY); // Set movie quality: low, medium, high $movie->quality = 'high'; $movie->draft = true; // Create a new scene $scene = new Scene; // Set the scene background color $scene->background_color = '#4392F1'; // Add a text element printing "Hello world" in a fancy way (basic/006) // The element is 10 seconds long and starts 2 seconds from the scene start // Element's vertical position is 50 pixels from the top $scene->addElement([ 'type' => 'text', 'style' => '003', 'text' => 'Hello world', 'duration' => 10, 'start' => 2 ]); // Add the scene to the movie $movie->addScene($scene); // Call the API and start rendering the movie $result = $movie->render(); var_dump($result); //$result = $movie->getStatus('cLiLZ7fKeMvjb4b8'); //var_dump($result); // Wait for the render to finish $movie->waitToFinish(); ?> ``` -------------------------------- ### Importing JSON2Video SDK with require_once in PHP Source: https://github.com/json2video/json2video-php-sdk/blob/main/README.md This snippet shows how to include the JSON2Video PHP SDK library using the `require_once` method and import the necessary `Movie` and `Scene` classes into the current namespace. ```php