Update an existing streaming profile
public update_streaming_profile ( $name, array $options = [] ) : |
||
$name | the name of the prodile | |
$options | array | additional options |
return |
function test_update_delete_streaming_profile() { $name = self::$api_test . "_streaming_profile_delete"; try { $result = $this->api->create_streaming_profile($name, array("representations" => array(array("transformation" => array("bit_rate" => "5m", "height" => 1200, "width" => 1200, "crop" => "limit"))))); } catch (Cloudinary\Api\AlreadyExists $e) { } $result = $this->api->update_streaming_profile($name, array("representations" => array(array("transformation" => array("bit_rate" => "5m", "height" => 1000, "width" => 1000, "crop" => "scale"))))); $this->assertArrayHasKey("representations", $result["data"]); $reps = $result["data"]["representations"]; $this->assertTrue(is_array($reps)); // "transformation is returned as an array $this->assertTrue(is_array($reps[0]["transformation"])); $tr = $reps[0]["transformation"][0]; $expected = array("bit_rate" => "5m", "height" => 1000, "width" => 1000, "crop" => "scale"); $this->assertEquals($expected, $tr); $result = $this->api->delete_streaming_profile($name); $result = $this->api->list_streaming_profiles($name); $this->assertArrayNotHasKey($name, array_map(function ($profile) { return $profile["name"]; }, $result["data"])); }