DemoSubmitTemplateTask.php 795 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. require('../../vendor/autoload.php');
  3. use Volc\Service\VEdit;
  4. $client = VEdit::getInstance();
  5. // $client->setAccessKey($ak);
  6. // $client->setSecretKey($sk);
  7. // async
  8. // below just an example, not complete
  9. $param = [
  10. [
  11. 'Name' => 'img1',
  12. 'Type' => 'image',
  13. 'Position' => 's0e0',
  14. 'Source' => 'your source 1'
  15. ],
  16. [
  17. 'Name' => 'img2',
  18. 'Type' => 'image',
  19. 'Position' => 's1e0',
  20. 'Source' => 'your source 2'
  21. ]
  22. ];
  23. $body = [
  24. 'TemplateId' => 'templateId',
  25. 'Space' => 'your space',
  26. 'VideoName' => ['your title'],
  27. 'Params' => [$param],
  28. 'CallbackArgs' => 'your callback args',
  29. 'CallbackUri' => 'your callback uri'
  30. ];
  31. $response = $client->submitTemplateTaskAsync(['json' => $body]);
  32. echo $response;