DemoRecordPreset.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. include 'DemoBase.php';
  3. global $client;
  4. $body = [
  5. 'Vhost' => 'vhost',
  6. 'App' => 'app',
  7. 'Bucket' => 'bb',
  8. 'RecordTob' => [
  9. [
  10. 'Format' => 'hls',
  11. 'Duration' => 100,
  12. 'Splice' => -1,
  13. 'RecordObject' => '/xx/xx',
  14. ],
  15. ]
  16. ];
  17. $response = $client->createRecordPreset(['json' => $body]);
  18. echo $response;
  19. echo '<br>';
  20. $body = [
  21. "Preset" => "preset",
  22. 'Vhost' => 'vhost',
  23. 'App' => 'app',
  24. 'Bucket' => 'bb2',
  25. 'RecordTob' => [
  26. [
  27. 'Format' => 'hls',
  28. 'Duration' => 100,
  29. 'Splice' => -1,
  30. 'RecordObject' => '/xx/xx',
  31. ],
  32. ]
  33. ];
  34. $response = $client->updateRecordPreset(['json' => $body]);
  35. echo $response;
  36. echo '<br>';
  37. $body = [
  38. 'Vhost' => 'vhost',
  39. 'App' => 'app',
  40. 'Preset' => 'xx',
  41. ];
  42. $response = $client->deleteRecordPreset(['json' => $body]);
  43. echo $response;
  44. echo '<br>';
  45. $body = [
  46. 'Vhost' => 'vhost',
  47. ];
  48. $response = $client->listVhostRecordPreset(['json' => $body]);
  49. echo $response;
  50. echo '<br>';