예제 #1
0
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;
    }
    # poll item until workflow is complete (= alternative to receiving HTTP POST on completion)
    echo "\n\nGetting Item (waiting until workflow is completed) ..";