Example #1
0
<?php

require_once 'VWflow.php';
$email = "xxx";
# email used to log into vwflow.com
$pwd = "xxx";
# password used to log into vwflow.com
$local_video_path = "/path/to/video.mp4";
# path to the video/audio/image to be uploaded
$account = "xxxxx";
# the name of your vwflow account (only used to create download and streaming paths, not necessary if you use the player embed code)
$cdn = "cdn01";
# rambla sub-cdn (only used to create download and streaming paths, not necessary if you use the player embed code)
try {
    $client = new VWflow($email, $pwd);
    # create item
    echo "\nCreating Item ..";
    $item = $client->createItem($local_video_path, "Video Title", "Video Description", array("Tag 1", "Tag 2"));
    echo "\nItem ID: " . $item->id;
    echo "\nItem URL: " . $item->url;
    # update item
    echo "\n\nUpdating Item ..";
    $item->name = "My Title";
    $item->description = "My Description";
    $item->tags = array("My First Tag", "My Second Tag");
    $item = $client->updateItem($item);
    echo "\nItem Name: " . $item->name;
    echo "\nItem Description: " . $item->description;
    foreach ($item->tags as $tag) {
        echo "\nTag: " . $tag;
    }
Example #2
0
<?php

require_once 'VWflow.php';
$email = "xxx";
# email used to log into vwflow.com
$pwd = "xxx";
# password used to log into vwflow.com
try {
    $client = new VWflow($email, $pwd);
    echo "\nGetting Item List ..";
    # get all items
    $response = $client->getItems();
    # get for all completed & public video items, created after Fri, 04 Mar 2016 14:01:58 +0000
    // $response = $client->getItems(array("type" => "video", "privacy" => "public", "workflow_status" => "Completed", "created_after" => "1457100118"));
    # get all items tagged with 'news' or 'scoop' (or 'Scoop', or 'SCOOP')
    // $response = $client->getItems("tags" => "news,scoop");
    # search (case insensitive) for all items with 'test' in their name, description, tags or custom metadata
    // $response = $client->getItems(array("search" => "test"));
    echo "\nResponse contains " . $response->count . " items, iterating over them..";
    # iterate over items, echo properties to be used in Wordpress
    foreach ($response->results as $item) {
        echo "\n\nFound new Item with ID: " . $item->id;
        echo "\nItem Name: " . $item->name;
        echo "\nItem Description: " . $item->description;
        echo "\nCreated: " . $item->created;
        echo "\nDuration: " . $item->duration;
        echo "\nEmbed Code: " . $item->embed_code;
        foreach ($item->tags as $tag) {
            echo "\nTag: " . $tag;
        }
        foreach ($item->snapshots as $snapshot) {