Skip to content

Commit

Permalink
Merge pull request #5 from SultanDino/update-meta
Browse files Browse the repository at this point in the history
Add method to update video meta
  • Loading branch information
BJTheCod3r authored Mar 11, 2024
2 parents 42b82ee + 7715663 commit 61c818b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/CloudflareStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,20 @@ public function fetchVideo(string $id): array
return $this->http->get("{$this->baseUrl}/{$this->accountId}/stream/{$id}")->json();
}

/**
* Update video meta
*
* @param string $id
* @param array $meta
* @return array
*/
public function updateMeta(string $id, array $meta = []): array
{
return $this->http->post("{$this->baseUrl}/{$this->accountId}/stream/{$id}", [
'meta' => $meta
])->json();
}

/**
* Clip a video
*
Expand All @@ -265,7 +279,7 @@ public function clip(string $id, array $options = []): array
$payload = array_merge($payload, $options);
}

return $this->http->post("{$this->baseUrl}/{$this->accountId}/stream/clip", $payload);
return $this->http->post("{$this->baseUrl}/{$this->accountId}/stream/clip", $payload)->json();
}

/**
Expand Down

0 comments on commit 61c818b

Please sign in to comment.