Skip to content

🎥 Make videos programmatically with React

intial breakdown of test

Alex Fernandeze4e84128ad0c
diff --git a/packages/lambda-php/src/PHPClient.php b/packages/lambda-php/src/PHPClient.php
index 1a376bb4d2..2669e27a21 100644
--- a/packages/lambda-php/src/PHPClient.php
+++ b/packages/lambda-php/src/PHPClient.php
@@ -1,5 +1,7 @@
<?php
+namespace Remotion;
+
use Aws\Lambda\LambdaClient;
class PHPClient
@@ -10,7 +12,6 @@ class PHPClient
string $region,
string $serveUrl,
string $functionName,
- string $bucketName,
array $credential) {
$this->client = LambdaClient::factory([
'version' => 'latest',
@@ -19,6 +20,77 @@ class PHPClient
]);
}
+ public function constructInternals(
+ array $data,
+ string $composition = 'main',
+ string $type = 'start',
+ string $codec = 'h264',
+ string $version = '3.3.78',
+ string $imageFormat = 'jpeg',
+ int $crf = 1,
+ array $envVariables = [],
+ int $quality = 80,
+ int $maxRetries = 1,
+ string $privacy = 'public',
+ string $logLevel = 'info',
+ ? string $frameRange = null,
+ ? string $outName = null,
+ int $timeoutInMilliseconds = 30000,
+ array $chromiumOptions = [],
+ float $scale = 1,
+ int $everyNthFrame = 1,
+ int $numberOfGifLoops = 0,
+ int $concurrencyPerLambda = 1,
+ array $downloadBehavior = [
+ 'type' => 'play-in-browser',
+ ],
+ bool $muted = false,
+ bool $overwrite = false,
+ ? int $audioBitrate = null,
+ ? int $videoBitrate = null,
+ ? string $webhook = null,
+ ? int $forceHeight = null,
+ ? int $forceWidth = null,
+ ? string $audioCodec = null,
+ ) {
+
+ return [
+ "serveUrl" => $serveUrl,
+ "inputProps" => $input,
+ "composition" => $composition,
+ "type" => $type,
+ "codec" => $codec,
+ "version" => $version,
+ "imageFormat" => $imageFormat,
+ "crf" => $crf,
+ "envVariables" => $envVariables,
+ "quality" => $quality,
+ "maxRetries" => $maxRetries,
+ "privacy" => $privacy,
+ "logLevel" => $logLevel,
+ "frameRange" => $frameRange,
+ "outName" => $outName,
+ "timeoutInMilliseconds" => $timeoutInMilliseconds,
+ "chromiumOptions" => $chromiumOptions,
+ "scale" => $scale,
+ "everyNthFrame" => $everyNthFrame,
+ "numberOfGifLoops" => $numberOfGifLoops,
+ "concurrencyPerLambda" => $concurrencyPerLambda,
+ "downloadBehavior" => $downloadBehavior,
+ "muted" => $muted,
+ "overwrite" => $overwrite,
+ "audioBitrate" => $audioBitrate,
+ "videoBitrate" => $videoBitrate,
+ "webhook" => $webhook,
+ "forceHeight" => $forceHeight,
+ "forceWidth" => $forceWidth,
+ "bucketName" => $bucketName,
+ "audioCodec" => $audioCodec,
+ "forceBucketName" => $bucketName,
+ ];
+
+ }
+
public function invokeLambda(
array $data,
string $composition = 'main',
diff --git a/packages/lambda-php/src/PHPClientTest.php b/packages/lambda-php/src/PHPClientTest.php
index c1f9411ecb..6eeb3488d5 100644
--- a/packages/lambda-php/src/PHPClientTest.php
+++ b/packages/lambda-php/src/PHPClientTest.php
@@ -1,5 +1,7 @@
<?php
+use Remotion\PHPClient;
+
class PHPClientTest extends PHPUnit\Framework\TestCase
{
@@ -8,6 +10,11 @@ class PHPClientTest extends PHPUnit\Framework\TestCase
// $calculator = new Calculator();
//$result = $calculator->add(2, 3);
// $this->assertEquals(5, 5);
+ $client = new PHPClient(
+ "us-east-1",
+ "react-svg",
+ "remotion-render",
+ null);
print(json_encode(array(
"data" => "",
)));