Skip to content

🎥 Make videos programmatically with React

clear up input props confusion

Jonny Burgere0aab8f68aca
diff --git a/packages/example/testlambda.mjs b/packages/example/testlambda.mjs
index ba7f19cb89..0cf17d3ef3 100644
--- a/packages/example/testlambda.mjs
+++ b/packages/example/testlambda.mjs
@@ -41,3 +41,16 @@ execSync(
stdio: 'inherit',
}
);
+
+const functionName = execSync(`pnpm exec remotion lambda functions ls -q`);
+
+execSync(`php src/render.php`, {
+ env: {
+ // eslint-disable-next-line no-undef
+ ...process.env,
+ REMOTION_APP_FUNCTION_NAME: functionName.toString('utf8'),
+ REMOTION_APP_SERVE_URL: 'testbed-v6',
+ },
+ cwd: '../lambda-php-example',
+ stdio: 'inherit',
+});
diff --git a/packages/lambda-php-example/src/render.php b/packages/lambda-php-example/src/render.php
index fc7175314d..972d62de82 100644
--- a/packages/lambda-php-example/src/render.php
+++ b/packages/lambda-php-example/src/render.php
@@ -32,7 +32,7 @@ $params = new RenderParams();
$params->setComposition('react-svg');
// Set input props
-$params->setData(['message' => 'yo whats up']);
+$params->setInputProps(['message' => 'yo whats up']);
// Execute the render and get the response
diff --git a/packages/lambda-php/src/PHPClient.php b/packages/lambda-php/src/PHPClient.php
index b9e1e33670..c06f11154d 100644
--- a/packages/lambda-php/src/PHPClient.php
+++ b/packages/lambda-php/src/PHPClient.php
@@ -40,7 +40,7 @@ class PHPClient
null
);
- $render->setInputProps($input);
+ $render->internal_setSerializedInputProps($input);
$render->setServeUrl($this->getServeUrl());
$render->setRegion($this->getRegion());
diff --git a/packages/lambda-php/src/RenderParams.php b/packages/lambda-php/src/RenderParams.php
index 71b4c63ced..af2d3e8633 100644
--- a/packages/lambda-php/src/RenderParams.php
+++ b/packages/lambda-php/src/RenderParams.php
@@ -194,7 +194,7 @@ class RenderParams
*
* @return self
*/
- public function setInputProps($inputProps)
+ public function internal_setSerializedInputProps($inputProps)
{
$this->inputProps = $inputProps;
@@ -250,6 +250,7 @@ class RenderParams
}
/**
+ * Backwards compatible version of setInputProps()
* Set the value of data
*
* @return self
@@ -261,6 +262,17 @@ class RenderParams
return $this;
}
+ /**
+ * Set the value of inputProps
+ * @return
+ */
+ public function setInputProps($data)
+ {
+ $this->data = $data;
+
+ return $this;
+ }
+
/**
* Get the value of composition
*/