Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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('')
```