function pushVideos($videosDir, $tags = 'phpBulkImport', $ignoreList = '.,..') { //This is where we actually process everything $ignoreList = explode(',', $ignoreList); //We require the Ziggeo SDK Entry file require_once 'Ziggeo.php'; $arguments = array('tags' => $tags); //console output styling echo "\n"; echo "******************************************************\n"; echo " Pushing multiple videos to Ziggeo servers \n"; echo "******************************************************\n"; echo "\n"; //Data for output.. $count = 0; $ziggeo = new Ziggeo(APP_TOKEN, PRIVATE_KEY); //Get all files in the mentioned folder $files = @scandir($videosDir); //If you are getting errors, remove @ to see what is the cause.. if ($files) { //we run it like this, which will remove . and .. and other files if you have specified any with full name $files = array_diff($files, $ignoreList); } if (!$files) { echo 'No videos found to execute the push'; exit; } $c = count($files); foreach ($files as $file) { //Setting up the arguments to pass over.. of course we can do this differently, this is just for example, but remember that each video has a different name while other parameters would be shared! $tmp_arguments = $arguments; $tmp_arguments['file'] = $videosDir . '/' . $file; //the actual passing of the videos to Ziggeo from our PC / Mac $ziggeo->videos()->create($tmp_arguments); //This is just for display purposes upon the upload $count++; echo "Pushed: " . $count . ". \"" . $file . "\"\n"; } //console output styling echo "\n"; echo "******************************************************\n"; echo " Push complete - please check your Ziggeo dashboard \n"; echo "******************************************************\n"; echo "\n"; }
</div> <div class="container" id="video_name_container" style="display:none"> <div class="form-container"> <div class="overlay"> <div class="form-group"> <input type="name" class="form-control" id="fullname" placeholder="Full Name"> </div> <div class="center"><a href="#" id="use_name" class="btn btn-default btn-xs btn-primary">Submit</a></div> <p class="footnote"><a href="#" id="skip_name">Skip »</a></p> </div> </div> </div> <div class="container" id="video_recorder_container" style="display:none"> </div> <? } ?> <?php foreach ($ziggeo->videos()->index() as $video) { ?> <div class="container"> <ziggeo ziggeo-width=288 ziggeo-height=216 ziggeo-limit=60 ziggeo-video="<?= $video->token ?>"> </ziggeo> <?php if (is_array($video->tags) && count($video->tags) > 0) { ?> <?php $name = str_replace("_", " ", $video->tags[0]); ?> <?php if ($settings["name_google"]) { ?> <p><a href="http://google.com#q=<?= urlencode($name) ?>" target="_blank"><?= $name ?> »</a></p> <?php } else { ?> <p><?= $name ?></p> <?php } ?> <? } ?> </div>
$arguments = array(); //OK we have some tags set, we should add them to the videos if (isset($_POST['tags'])) { $arguments['tags'] = $_POST['tags']; } //Data for output.. $count = 0; $names = ''; $ziggeo = new Ziggeo(APP_TOKEN, PRIVATE_KEY); $c = count($_FILES['files']['name']); for ($i = 0; $i < $c; $i++) { //Setting up the arguments to pass over.. of course we can do this differently, this is just for example, but remember that each video has a different name while other parameters would be shared! $tmp_arguments = $arguments; $tmp_arguments['file'] = $_FILES['files']['tmp_name'][$i]; //the actual passing of the videos to Ziggeo from our PC / Mac $ziggeo->videos()->create($tmp_arguments); //This is just for display purposes upon the upload $count++; $names .= '<li>' . $_FILES['files']['name'][$i] . '</li>'; } ?> <!DOCTYPE html> <html> <head> <title>Finished - Ziggeo PHP SDK and multiple video file uploading</title> </head> <body> <p><?php echo $count; ?> Video files have been uploaded to your Ziggeo account</p>
<?php require_once dirname(__FILE__) . "/../Ziggeo.php"; $opts = getopt("", array("token:", "privatekey:", "vtoken:")); $ziggeo = new Ziggeo($opts["token"], $opts["privatekey"]); $ziggeo->videos()->update($opts["vtoken"], array("approved" => TRUE));
<?php require_once dirname(__FILE__) . "/../Ziggeo.php"; $opts = getopt("", array("token:", "privatekey:")); $ziggeo = new Ziggeo($opts["token"], $opts["privatekey"]); while (TRUE) { $idx = $ziggeo->videos()->index(); if (count($idx) === 0) { break; } foreach ($idx as $video) { echo "Deleting " . $video->token . " / " . @$video->key . "\n"; $ziggeo->videos()->delete($video->token); } }
<?php require_once dirname(__FILE__) . "/../Ziggeo.php"; $opts = getopt("", array("token:", "privatekey:", "file:")); $ziggeo = new Ziggeo($opts["token"], $opts["privatekey"]); $ziggeo->videos()->create(array("file" => $opts["file"]));
<?php require_once dirname(__FILE__) . "/../Ziggeo.php"; $opts = getopt("", array("token:", "privatekey:")); $ziggeo = new Ziggeo($opts["token"], $opts["privatekey"]); $idx = $ziggeo->videos()->index(); foreach ($idx as $video) { echo "Listing " . $video->token . " / " . @$video->key . "\n"; }
<?php require_once dirname(__FILE__) . "/../Ziggeo.php"; $opts = getopt("", array("token:", "privatekey:", "video:")); $ziggeo = new Ziggeo($opts["token"], $opts["privatekey"]); var_dump($ziggeo->videos()->get($opts["video"]));