bluebillywig/bb-sapi-php-sdk
最新稳定版本:v1.0.4
Composer 安装命令:
composer require bluebillywig/bb-sapi-php-sdk
包简介
README 文档
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());
统计信息
- 总下载量: 917
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-04-05