francis94c / vimeo-livestream
PHP Client Library for Vimeo Live Stream
dev-master
2020-09-23 10:36 UTC
Requires
- php: >=7.1.3
- ext-curl: *
- ext-json: *
Requires (Dev)
- mikecao/flight: ^1.3
- phpunit/phpunit: ^8.2
This package is auto-updated.
Last update: 2025-03-23 20:34:10 UTC
README
vimeo-livestream
PHP Client Library for Vimeo Live Stream.
Current Features Include
- Create New Event.
- Update an Event.
- Get Associated Accounts.
- Get Specific Accounts.
- Update Event Poster.
- Delete Event.
Installation
This Live Stream API is available on Packagist as francis94c/vimeo-livestream
$ composer require francis94c/vimeo-livestream:dev-master
Usage
Creating a LiveStream Instance.
use LiveStream\LiveStream; $livestream = new LiveStream('[YOUR_API_KEY]');
Before you proceed, note that $livestream
function calls that return null, indicates that the requested resource was not found. In summary, a 404 HTTP Response Code was received as a result of the call.
Every other HTTP Response Code except 200 & 201 will throw an Exception.
Get Accounts
Get all LiveStream accounts linked to the current API key.
$accounts = $livestream->getAccounts(); // Returns an array of account resources.
Get Specific Account
Get a specific LiveStream Account.
$account = $livestream->getAccount(23456 /*Account ID*/); // Returns \LiveStream\Resources\Account.
Create an Event
use LiveStream\Resources\Event; $event = new Event("A Career Master Class" /*fullName*/); // See https://livestream.com/developers/docs/api/#event-object $event->setShortName("Master Class"); /*Or*/ $event->shortName = 'Master Class'; $event->setStartTime("2020-07-20 23:56:20"); /*Or*/ $event->startTime = /*Time in ISO8601 date time format*/
Update an Event
use LiveStream\Resources\Event; $event = new Event("Physics Live Class on Motions."); $event->setDescription("Motion") ->setStartTime(date('Y-m-d H:i:s')) ->setEndTime(date('Y-m-d H:i:s')) ->setShortName("Physics Short Name") ->setIsDraft(false) ->addTag('a') ->addTag('a') ->setId(3456343); $livestream = new LiveStream('abc'); $livestream->updateEvent(5637245, $event);
Get RTMP Key
$key = $livestream->getRtmpKey(3456 /*Account ID*/, 4567, /*Event ID*/); // Returns \LiveStream\Resources\RTMPKey. echo $key->id . ' --- ' . $key->rtmpUrl; // OR echo $key->getId() . ' --- ' . $key->getRtmpUrl();
Reset RTMP Key
$key = $livestream->resetRtmpKey(3456 /*Account ID*/, 4567, /*Event ID*/);