bluebillywig / bb-sapi-php-sdk
v1.0.4
2023-04-26 09:20 UTC
Requires
- bluebillywig/vmsrpc: ^0.97.6
- composer/ca-bundle: ^1.3
- guzzlehttp/guzzle: ^7.5
Requires (Dev)
- dev-master
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- dev-add-unit-test-channel-mediacliplist
- dev-channel-list-and-abs-mediaclip-src
- dev-added-thumbnail-path-parsing
- dev-readme-update-with-install
- dev-add-linting-to-pr-check
- dev-fix-for-wrong-mediaclip-nested-entity-name
- dev-started-on-unit-tests
- dev-license-date-update-and-various-fixes
- dev-11895-ability-to-edit-mediaclip
- dev-fix-mediaclip-upload-fail
- dev-introduce-entity-helpers
- dev-change-promise-chaining-to-coroutines
- dev-added-docstring-to-sdk-methods
- dev-allow-for-nested-entity-recursion
This package is auto-updated.
Last update: 2024-10-26 12:25:55 UTC
README
This PHP SDK provides abstractions to interact with the Blue Billywig Server API.
Installation
Installation can be done through composer:
composer require bluebillywig/bb-sapi-php-sdk
Usage
In order to use this SDK, three things are prerequisite:
- A publication is created and active in the Blue Billywig Online Video Platform (OVP).
- An account is created within the publication in the OVP.
- An API Key was created using the account in the OVP.
Once the aforementioned prerequisites are in place the SDK can be used in any PHP script:
<?php use BlueBillywig\Sdk; use GuzzleHttp\Promise\Coroutine; $publication = "my-publication"; // The publication name (https://<publication name>.bbvms.com) in which the account and API key were created. $tokenId = 1; // The ID of the generated API key. $sharedSecret = "my-shared-secret"; // The randomly generated shared secret. $sdk = Sdk::withRPCTokenAuthentication($publication, $tokenId, $sharedSecret); $mediaClipPath = "/path/to/a/mediaclip.mp4"; // Asynchronous $promise = Coroutine::of(function () use ($sdk) { $response = (yield $sdk->mediaclip->initializeUploadAsync($mediaClipPath)); $response->assertIsOk(); yield $sdk->mediaclip->helper->executeUploadAsync($mediaClipPath, $response->getDecodedBody()); }); $promise->wait(); // Synchronous $response = $sdk->mediaclip->initializeUpload($mediaClipPath); $response->assertIsOk(); $sdk->mediaclip->helper->executeUpload($mediaClipPath, $response->getDecodedBody());