Giter Club home page Giter Club logo

bunnystream-php-library's Introduction

Bunny Stream PHP Library

A simple PHP library to interact with the Bunny Stream API.

Requires

In order to interact with the API you need the API Access Information (Stream->API)

Installation

composer require serch3/bunnystream-php-library

How to use:

Quick start

<?php

require_once __DIR__ . '/vendor/autoload.php';

use Bunny\Stream\BunnyStream;


// Initiate the class:
$BunnyStream = new BunnyStream("{{Read/Write Key}}", "{{Video Library ID}}");

Videos:

Listing Videos:

$BunnyStream->List();

$BunnyStream->List($Collection, $Search, $OrderBy, $Items, $Page); //filtered results

Optional:

$Collection If set, the response will only contain videos that belong to this collection ID string

$Search if set, the response will be filtered to only contain videos that contain the search term string

$OrderBy Determines the ordering of the result within the response. 1(date) or 2(title) int

$Items Number of results per page. Default is 100 int

$Page Page number. Default is 1 int

returns Json string


Upload Video

$BunnyStream->upload($filename, $title)
);

$filename File to upload string

$title The title of the video array

Optional:

$collectionId The ID of the collection where the video will be put string

$videoId If set uploads the video for the given video ID instead of creating it string

returns VideoId


Delete Video

$BunnyStream->delete($guid);

$guid ID of the video string


Update Video Info

$BunnyStream->update($guid, $name)
);

$guid ID of the video string

$title Updated title of the video string

optional:

$collectionId ID of the Collection string


Get Video Details

$BunnyStream->get($guid);

$BunnyStream->get($guid)->framerate; //returns video framerate

$guid ID of the video string

returns PHP Object


Upload Thumbnail

$BunnyStream->uploadThumbnail($videoId, $url);

$videoId ID of the video string

$url path of the thumbnail string


Fetch Video

$BunnyStream->fetch($url, $videoId);

$url External video URL string

$videoId ID of the video. If not set, it will be automatically generated string

optional:

$headers The headers that will be sent together with the fetch request array


Add Caption

$BunnyStream->addCaption($source, $videoId, $srclang, $label);

$source path of the captions file string

$videoId ID of the video string

$srclang The unique srclang shortcode for the caption (e.g. en) string

$label The text description label for the caption string



Delete Caption

$BunnyStream->deleteCaption($videoId, $srclang);

$videoId ID of the video string

$srclang The unique srclang shortcode for the caption (e.g. en) string


Collections:

Listing Collections:

$BunnyStream->ListCollections();

$BunnyStream->ListCollections($Search, $OrderBy, $Items, $Page); //filtered results

Optional:

$Search if set, the response will be filtered to only contain collections that contain the search term string

$OrderBy Determines the ordering of the result within the response. 1(date) or 2(title) int

$Items Number of results per page. Default is 100 int

$Page Page number. Default is 1 int

returns Json string


Create Collection

$BunnyStream->createCollection($name);

$name The name of the collection string

returns collectionId


Delete Collection

$BunnyStream->deleteCollection($collectionId);

$collectionId ID of the Collection string


Update Collection

$BunnyStream->updateCollection($collectionId, $name))
);

$collectionId ID of the Collection string

$name Updated name for the collection string


Get Collection Details

$BunnyStream->getCollection($collectionId);

$BunnyStream->getCollection($collectionId)->name; //returns name

$collectionId ID of the Collection string

returns PHP Object


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.