issetbv/video-publisher-api-client

PHP的VideoPublisher API客户端

1.0.3 2016-01-18 12:32 UTC

This package is not auto-updated.

Last update: 2024-09-14 18:58:35 UTC


README

Author Build Status Coverage Status Quality Score Software License Packagist Version Total Downloads

描述

这是http://my.videopublisher.io/ API的客户端。使用它来简化在PHP中使用API。

示例

API需要一个消费者密钥和私有密钥,这些可以在info@my.videopublisher.io请求。

<?php

include 'src/VideoPublisher/AutoLoader.php';

use VideoPublisher\VideoPublisherClient;
use VideoPublisher\Authentication\KeyPairAuthentication;

//Create an authentication, only consumer/private keypair authentication is supported at this time
$authentication = new KeyPairAuthentication('your_consumer_key', 'your_private_key');
//Create the client. On the next request a token will be requested. 
//This token will be cache in 'your_local_token_cache_folder'.
//Make sure this cache folder is writeable by the application.
$client = new VideoPublisherClient($authentication, 'your_local_token_cache_folder');

//Request a list of all your published streams. 
//This will return an array of VideoPublisher\Domain\SimpleStream objects
$list = $client->listStreams();

//Request a specific stream by Uuid. Uuids can be fetched from SimpleStream objects 
//or from http://my.videopublisher.io/ webinterface.
//Example: http://my.videopublisher.io/publish/1A1A1A1A-1A1A-1A1A-1A1A-1A1A1A1A
//This will return an VideoPublisher\Domain\Stream object 
$client->getStream('1A1A1A1A-1A1A-1A1A-1A1A-1A1A1A1A');