Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/boldbrush/cloudflare-streams-php
📦 BoldBrush Cloudflare Streams
https://github.com/boldbrush/cloudflare-streams-php
cf cloudflare cloudflare-api cloudflare-streams php streams
Last synced: about 2 months ago
JSON representation
📦 BoldBrush Cloudflare Streams
- Host: GitHub
- URL: https://github.com/boldbrush/cloudflare-streams-php
- Owner: boldbrush
- Created: 2020-04-15T06:16:34.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-05T20:44:15.000Z (about 4 years ago)
- Last Synced: 2024-09-04T16:24:48.598Z (4 months ago)
- Topics: cf, cloudflare, cloudflare-api, cloudflare-streams, php, streams
- Language: PHP
- Homepage:
- Size: 6.84 KB
- Stars: 4
- Watchers: 8
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# BoldBrush Cloudflare Streams
## Installation
```bash
$ composer require boldbrush/cloudflare-streams-php
```## Usage
```php
require '../vendor/autoload.php';use BoldBrush\Cloudflare\API;
/** @var API\Enpoints\Streams */
$api = API\Factory::make(
'',
'',
''
);
```
* account: set your account ID (can be found in your dashboard URL or when in a DNS zone)
* apiKey: use your Global API key, together with your email address, or use 'api_token' as the email and use a configured API Token.
* email: set your login email in combination with your Global API key, or set as 'api_token' combined with a configured API Token.Get List of streams:
```php
/** @var API\Response\Stream[] */
$streams = $api->getStreams();
```Get details of a stream:
```php
/** @var API\Response\Stream */
$stream = $api->getStream('');
```Upload a stream from URL:
```php
/** @var API\Response\Stream */
$stream = $api->copy('');
```Delete a stream:
```php
/** @var bool */
$success = $api->delete('');
```Get the embed snippet for a stream:
```php
/** @var string */
$html = $api->getEmbedSnippet('')
```