示例#1
0
 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) ..";
 $processed = False;
 while (!$processed) {
     sleep(3);
     $item = $client->getItem($item->id);
     if ($item->workflow->status == "Completed") {
         echo "\nItem Embed Code: " . $item->embed_code;
         # use the vwflow player's embed code for integration in your site or CMS
         echo "\nItem type: " . $item->type;
         echo "\nDuration: " . $item->duration . " seconds";
         # Get download & streaming URLs (not recommended, use the embed code instead)
         echo "\nHLS Streaming URL: http://{$account}.fstreams.{$cdn}.rambla.be/{$account}/_definst_/smil:" . $item->path . "/playlist.m3u8";
         echo "\nDownload URL: http://{$account}.{$cdn}.rambla.be" . $item->direct_path;
         # Get available snapshots, and select a new snapshot (poster, thumbnail image) for the video
         $new_snapshot_id = null;
         foreach ($item->snapshots as $snapshot) {
             if ($snapshot->id == $item->snapshot_id) {
                 echo "\nURL of selected snapshot: " . $snapshot->download;
             } else {
                 echo "\nURL of available snapshot: " . $snapshot->download;