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.
This Live Stream API is available on Packagist as francis94c/vimeo-livestream
$ composer require francis94c/vimeo-livestream:dev-master
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 all LiveStream accounts linked to the current API key.
$accounts = $livestream->getAccounts(); // Returns an array of account resources.
Get a specific LiveStream Account.
$account = $livestream->getAccount(23456 /*Account ID*/); // Returns \LiveStream\Resources\Account.
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*/
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);
$key = $livestream->getRtmpKey(3456 /*Account ID*/, 4567, /*Event ID*/); // Returns \LiveStream\Resources\RTMPKey.
echo $key->id . ' --- ' . $key->rtmpUrl;
// OR
echo $key->getId() . ' --- ' . $key->getRtmpUrl();
$key = $livestream->resetRtmpKey(3456 /*Account ID*/, 4567, /*Event ID*/);