The HW Blog

Want to be updated? @opencoconut | Feed

Introducing a New PHP Library

Bruno Celeste (@brunoceleste)

June 13, 2013 Features

We have just released a brand new PHP library which is much simpler and flexible to use than the previous one. We also uploaded the lib to packagist.org so it's super easy to install.

Installation

If you don't have composer yet:

curl -sS https://getcomposer.org/installer | php

Edit the composer.json file:

{
    "require": {
        "coconut/coconut": "1.*"
    }
}

Now install all the depencies by executing composer:

php composer.phar install

Getting Started

// auto load the dependencies
require_once "vendor/autoload.php";

// login with your Coconut API key
$hw = new Coconut("HW-API-Key", $api_key);

$hw->create("hls/job", array(
  "video_id" => 1234,
  "format_ids" => "HLS_416x234_110K, HLS_416x234_200K, HLS_360p_600K, HLS_360p_1000K, HLS_720p_1500K",
  "ping_url" => "http://mysite.com/ping/coconut",
  "output_url" => "s3://key:skey@bucket/path/hls/"
));

For more usage example, have a look at the PHP library page.



Any Comment? Send us a message on Twitter @opencoconut
If you have questions or feedbacks, you can also contact us via our contact page