Skip to content

🎥 Make videos programmatically with React

implement php

Jonny Burgeraeeec6eda00f
diff --git a/packages/it-tests/src/monorepo/php-package.test.ts b/packages/it-tests/src/monorepo/php-package.test.ts
index 3938b66bda..fba56ab730 100644
--- a/packages/it-tests/src/monorepo/php-package.test.ts
+++ b/packages/it-tests/src/monorepo/php-package.test.ts
@@ -113,7 +113,9 @@ class Semantic
preferLossless: false,
indent: false,
forcePathStyle: false,
- metadata: null,
+ metadata: {
+ Author: 'Remotion',
+ },
});
const jsonOutput = toParse.substring(0, toParse.lastIndexOf('}') + 1);
const parsedJson = JSON.parse(jsonOutput);
diff --git a/packages/lambda-php/.phpunit.result.cache b/packages/lambda-php/.phpunit.result.cache
index 1d245126cb..e5b1066fa0 100644
--- a/packages/lambda-php/.phpunit.result.cache
+++ b/packages/lambda-php/.phpunit.result.cache
@@ -1 +1 @@
-{"version":1,"defects":{"Remotion\\LambdaPhp\\Tests\\PHPClientTest::testClient":8},"times":{"Remotion\\LambdaPhp\\Tests\\PHPClientTest::testClient":0.045,"Remotion\\LambdaPhp\\Tests\\PHPRenderProgressTest::testClient":0.028}}
\ No newline at end of file
+{"version":1,"defects":{"Remotion\\LambdaPhp\\Tests\\PHPClientTest::testClient":5},"times":{"Remotion\\LambdaPhp\\Tests\\PHPClientTest::testClient":0.017,"Remotion\\LambdaPhp\\Tests\\PHPRenderProgressTest::testClient":0.018}}
\ No newline at end of file
diff --git a/packages/lambda-php/src/RenderParams.php b/packages/lambda-php/src/RenderParams.php
index 2317b1dff3..9c4aeb112d 100644
--- a/packages/lambda-php/src/RenderParams.php
+++ b/packages/lambda-php/src/RenderParams.php
@@ -19,6 +19,7 @@ class RenderParams
protected $imageFormat = 'jpeg';
protected $crf = null;
protected $envVariables = [];
+ protected $metadata = [];
protected $maxRetries = 1;
protected $jpegQuality = 80;
protected $privacy = 'privacy';
@@ -93,7 +94,8 @@ class RenderParams
?string $encodingBufferSize = null,
?string $maxRate = null,
?bool $preferLossless = false,
- ?bool $forcePathStyle = false
+ ?bool $forcePathStyle = false,
+ ?array $metadata = null
)
{
if ($chromiumOptions === null) {
@@ -108,6 +110,7 @@ class RenderParams
$this->imageFormat = $imageFormat;
$this->crf = $crf;
$this->envVariables = $envVariables;
+ $this->metadata = $metadata;
$this->maxRetries = $maxRetries;
$this->jpegQuality = $jpegQuality;
$this->privacy = $privacy;
@@ -198,6 +201,12 @@ class RenderParams
$parameters['envVariables'] = new stdClass();
}
+ if ($this->getMetadata() !== null) {
+ $parameters['metadata'] = $this->getMetadata();
+ } else {
+ $parameters['metadata'] = new stdClass();
+ }
+
if ($this->getPixelFormat() !== null) {
$parameters['pixelFormat'] = $this->getPixelFormat();
}
@@ -418,6 +427,14 @@ class RenderParams
return $this->envVariables;
}
+ /**
+ * Get the value of metadata
+ */
+ public function getMetadata()
+ {
+ return $this->metadata;
+ }
+
/**
* Set the value of envVariables
*
@@ -430,6 +447,12 @@ class RenderParams
return $this;
}
+ public function setMetadata($metadata)
+ {
+ $this->metadata = $metadata;
+ return $this;
+ }
+
/**
* Get the value of maxRetries
diff --git a/packages/lambda-php/tests/PHPClientTest.php b/packages/lambda-php/tests/PHPClientTest.php
index 56ce2ba127..e501a05929 100644
--- a/packages/lambda-php/tests/PHPClientTest.php
+++ b/packages/lambda-php/tests/PHPClientTest.php
@@ -21,8 +21,12 @@ class PHPClientTest extends TestCase
data: [
'hi' => 'there'
],
+
);
$params->setComposition("react-svg");
+ $params->setMetadata([
+ 'Author' => 'Remotion'
+ ]);
$internalParams = $client->constructInternals($params);