DemoSubmitDirectEditTask.php 969 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. // your custom editParam
  9. // below just an example, not complete
  10. $editParam = [
  11. 'Upload' => [
  12. 'Uploader' => 'your uploader',
  13. 'VideoName' => 'your videoName',
  14. ],
  15. 'Output' => [
  16. 'Fps' => 25,
  17. 'Height' => 720,
  18. 'Width' => 1280,
  19. 'Quality' => 'medium',
  20. ],
  21. 'Segments' => [[
  22. 'BackGround' => '0xFFFFFFFF',
  23. 'Duration' => 3,
  24. 'Elements' => [],
  25. 'Volume' => 1,
  26. ]],
  27. 'GlobalElements' => []
  28. ];
  29. $body = [
  30. 'EditParam' => $editParam,
  31. 'CallbackArgs' => 'test args',
  32. 'CallbackUri' => 'test callbackUri'
  33. ];
  34. $response = $client->submitDirectEditTaskAsync(['json' => $body]);
  35. echo $response;
  36. // get results
  37. $response = $client->getDirectEditResult(['json' => ['ReqIds' => ['123']]]);
  38. echo $response;