Skip to content

Example Code not working #3

@Fyb3roptik

Description

@Fyb3roptik
vid := "1234"
s3 := "s3://accesskey:secretkey@mybucket"

config := coconut.Config{
  Vars: coconut.Vars{
    "vid": vid,
    "s3": s3,
  },
  Source: "http://yoursite.com/media/video.mp4",
  Webhook: "http://mysite.com/webhook/coconut?videoId=$vid",
  Outputs: coconut.Outputs{
    "mp4": "$s3/videos/video_$vid.mp4",
    "webm": "$s3/videos/video_$vid.webm",
    "jpg:300x": "$s3/previews/thumbs_#num#.jpg, number=3",
  }
}

if job, err := coconut.NewJob(config, "api-key"); err != nil {
  fmt.Println("Error:", err)
} else {
  fmt.Println("Job created:", job.Id)
}

Outputs should have a comma after it like this

vid := "1234"
s3 := "s3://accesskey:secretkey@mybucket"

config := coconut.Config{
  Vars: coconut.Vars{
    "vid": vid,
    "s3": s3,
  },
  Source: "http://yoursite.com/media/video.mp4",
  Webhook: "http://mysite.com/webhook/coconut?videoId=$vid",
  Outputs: coconut.Outputs{
    "mp4": "$s3/videos/video_$vid.mp4",
    "webm": "$s3/videos/video_$vid.webm",
    "jpg:300x": "$s3/previews/thumbs_#num#.jpg, number=3",
  },
}

if job, err := coconut.NewJob(config, "api-key"); err != nil {
  fmt.Println("Error:", err)
} else {
  fmt.Println("Job created:", job.Id)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions