Skip to content

🎥 Make videos programmatically with React

code experiments

Alex Fernandez98e6558b3f51
diff --git a/packages/goclient-example/main.go b/packages/goclient-example/main.go
index 8ffccc99e6..b7c99d1807 100644
--- a/packages/goclient-example/main.go
+++ b/packages/goclient-example/main.go
@@ -21,6 +21,7 @@ func main() {
region := os.Getenv("REMOTION_APP_REGION")
bucketName := os.Getenv("REMOTION_APP_BUCKET")
+ println(serveUrl)
input := &goclient.RemotionOptions{
ServeUrl: serveUrl,
FunctionName: functionName,
@@ -45,17 +46,19 @@ func main() {
EveryNthFrame: 1,
NumberOfGifLoops: 0,
ConcurrencyPerLambda: 1,
- DownloadBehavior: map[string]interface{}{},
- Muted: false,
- Overwrite: false,
- AudioBitrate: nil,
- VideoBitrate: nil,
- Webhook: nil,
- ForceHeight: nil,
- ForceWidth: nil,
- BucketName: nil,
- AudioCodec: nil,
- ForceBucketName: bucketName,
+ DownloadBehavior: map[string]interface{}{
+ "type": "play-in-browser",
+ },
+ Muted: false,
+ Overwrite: false,
+ AudioBitrate: nil,
+ VideoBitrate: nil,
+ Webhook: nil,
+ ForceHeight: nil,
+ ForceWidth: nil,
+ BucketName: nil,
+ AudioCodec: nil,
+ ForceBucketName: bucketName,
}
_, error := goclient.Render(input)
if error != nil {
diff --git a/packages/goclient/models.go b/packages/goclient/models.go
index 414a6c1369..798cef9aae 100644
--- a/packages/goclient/models.go
+++ b/packages/goclient/models.go
@@ -38,18 +38,17 @@ type RemotionOptions struct {
}
type internalOptions struct {
- ServeUrl string
- InputProps interface{} `json:"inputProps"`
- Composition string `json:"composition"`
- FunctionName string `json:"functionName"`
- Region string `json:"region"`
- Type string `json:"type"`
- Codec string `json:"codec"`
- Version string `json:"version"`
- ImageFormat string `json:"imageFormat"`
- Crf int `json:"crf"`
- EnvVariables []interface{} `json:"envVariables"`
- Quality int `json:"quality"`
+ serveUrl string
+ inputProps interface{}
+ composition string
+ region string
+ Type string
+ Codec string
+ Version string
+ ImageFormat string
+ Crf int
+ EnvVariables []interface{}
+ Quality int
MaxRetries int `json:"maxRetries"`
Privacy string `json:"privacy"`
LogLevel string `json:"logLevel"`
diff --git a/packages/goclient/utils.go b/packages/goclient/utils.go
index f6ec204c56..20db96ec33 100644
--- a/packages/goclient/utils.go
+++ b/packages/goclient/utils.go
@@ -58,17 +58,46 @@ func randomHash(options ...bool) string {
func constructInternals(options *RemotionOptions) internalOptions {
- inputProps, err := serializeInputProps(options.InputProps, options.Region, options.Type, options.ForceBucketName)
+ inputProps, err := serializeInputProps(options.InputProps, options.Region, "video-or-audio", options.ForceBucketName)
if err != nil {
log.Fatal("Failed to open file:", err)
}
internalParams := &internalOptions{
- ServeUrl: options.ServeUrl,
- Region: options.Region,
- Composition: options.Composition,
- InputProps: inputProps,
+ serveUrl: options.ServeUrl,
+ inputProps: inputProps,
+ composition: options.Composition,
+ region: options.Region,
+ Type: options.Type,
+ Codec: options.Codec,
+ Version: options.Version,
+ ImageFormat: options.ImageFormat,
+ Crf: options.Crf,
+ EnvVariables: options.EnvVariables,
+ Quality: options.Quality,
+ MaxRetries: options.MaxRetries,
+ Privacy: options.Privacy,
+ LogLevel: options.LogLevel,
+ FrameRange: options.FrameRange,
+ OutName: options.OutName,
+ TimeoutInMilliseconds: options.TimeoutInMilliseconds,
+ ChromiumOptions: options.ChromiumOptions,
+ Scale: options.Scale,
+ EveryNthFrame: options.EveryNthFrame,
+ NumberOfGifLoops: options.NumberOfGifLoops,
+ ConcurrencyPerLambda: options.ConcurrencyPerLambda,
+ DownloadBehavior: options.DownloadBehavior,
+ Muted: options.Muted,
+ Overwrite: options.Overwrite,
+ AudioBitrate: options.AudioBitrate,
+ VideoBitrate: options.VideoBitrate,
+ Webhook: options.Webhook,
+ ForceHeight: options.ForceHeight,
+ ForceWidth: options.ForceWidth,
+ BucketName: options.BucketName,
+ AudioCodec: options.AudioCodec,
+ ForceBucketName: options.ForceBucketName,
}
return *internalParams