Cloudinary\Api::update_streaming_profile PHP Method

update_streaming_profile() public method

Update an existing streaming profile
public update_streaming_profile ( $name, array $options = [] ) : Response
$name the name of the prodile
$options array additional options
return Cloudinary\Api\Response
    function update_streaming_profile($name, $options = array())
    {
        $uri = array("streaming_profiles/" . $name);
        $params = $this->prepare_streaming_profile_params($options);
        return $this->call_api("put", $uri, $params, $options);
    }

Usage Example

Example #1
0
 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"]));
 }