public static function setUpBeforeClass()
 {
     Vzaar::$url = API_ENVS::get()["url"];
     Vzaar::$token = API_ENVS::get()["user1"]["rw_token"];
     Vzaar::$secret = API_ENVS::get()["user1"]["login"];
 }
示例#2
0
 * token. All samples in /test folder provided just for the reference.
 *
 * This PHP implementation been tested under Linux/Apache and Windows/IIS.
 */
require_once 'Vzaar.php';
require_once 'User.php';
require_once 'Video.php';
require_once 'VideoList.php';
require_once 'AccountType.php';
//require_once 'HttpRequest.php';
/**
 * This API call returns the user's public details along with it's relevant metadata
 */
Vzaar::$token = 'token';
//
Vzaar::$secret = 'secret';
Vzaar::$enableHttpVerbose = false;
date_default_timezone_set("Europe/London");
/**
 * Public API
 */
//var_dump(Vzaar::getVideoDetails(17069));
//var_dump(Vzaar::getVideoDetails(36356, true));
//var_dump(Vzaar::getAccountDetails(1));
//var_dump(Vzaar::getVideoList('vzaar-user', true, 10));
//var_dump(Vzaar::searchVideoList('vzaar-user', 'true', 's3'));
//var_dump(Vzaar::getUserDetails('vzaar-user'));
//var_dump(Vzaar::getVideoDetails(21791,true));
//var_dump(Vzaar::getUploadSignature());
//print_r(Vzaar::getUploadSignature());
//print_r(Vzaar::uploadSubtitle('en', 4699267, 'subtitle'));
<?php

// Include the vzaar library
require 'vzaar/src/Vzaar.php';
// Authenticate with vzaar using environmet variables
Vzaar::$token = $_ENV['VZAAR_TOKEN'];
Vzaar::$secret = $_ENV['VZAAR_SECRET'];
<?php

require_once '../../src/Vzaar.php';
Vzaar::$token = "u2nd3DVI71jQ7dTtz9mHA953XeIQeodmZvSE6AbTX8s34";
Vzaar::$secret = "skitsanos";
header('Content-type: text/html');
if (isset($_POST['guid'])) {
    $apireply = Vzaar::processVideo($_POST['guid'], $_POST['title'], $_POST['description'], 's3_upload', Profile::Original);
    echo $apireply;
} else {
    echo 'GUID is missing';
}
示例#5
0
<?php

require_once 'Vzaar.php';
Vzaar::$token = 'YurxlhhEDLkce4psktKGVIxooQlSDF7T4HUWdYp6ZQ';
//
Vzaar::$secret = 'krevision';
$api_reply = Vzaar::getUploadSignature();
echo json_encode($api_reply['vzaar-api']);
<?php

date_default_timezone_set("Europe/London");
require_once '../src/Vzaar.php';
Vzaar::$token = "token";
Vzaar::$secret = "secret";
$title = "My video";
$description = "Sample description";
if (isset($_POST['url'])) {
    $video_id = Vzaar::uploadLink($_POST['url'], $title, $description);
    print "Video id: " . $video_id;
}
?>

<html>
    <head>
        <title>Link Upload Form</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    </head>

    <body>
        <form method="post" enctype="multipart/form-data">
            URL to download the video from:
            <input name="url" type="text"/>
            <br/>
            <input type="submit" value="Upload Video"/>
        </form>
    </body>
</html>
<?php

require '../../src/Vzaar.php';
Vzaar::$token = 'u2nd3DVI71jQ7dTtz9mHA953XeIQeodmZvSE6AbTX8';
Vzaar::$secret = 'skitsanos';
$rawReply = Vzaar::getUploadSignature();
$api_reply = $rawReply['vzaar-api'];
echo json_encode($api_reply);
<?php

namespace Vzaar;

require_once 'Vzaar.php';
Vzaar::$token = '';
//
Vzaar::$secret = '';
$api_reply = Vzaar::getUploadSignature();
echo json_encode($api_reply['vzaar-api']);
示例#9
0
<?php

date_default_timezone_set("Europe/London");
require_once '../src/Vzaar.php';
if (isset($_GET['secret']) && isset($_GET['token'])) {
    Vzaar::$token = $_GET['token'];
    Vzaar::$secret = $_GET['secret'];
    echo 'API reply: ' . Vzaar::whoAmI();
} else {
    echo 'Call whoAmI service as following: whoami.php?token=YOUR_API_TOKEN&secret=YOUR_VZAAR_USERNAME';
}
<?php

/*
 * @author skitsanos
 */
require_once '../src/Vzaar.php';
Vzaar::$secret = 'YOUR_VZAAR_USERNAME';
Vzaar::$token = 'API_TOKEN';
if (isset($_GET['id'])) {
    $res = Vzaar::deleteVideo($_GET['id']);
    print_r($res);
}
?>
<form method='get'>
Video Id: <input type='text' name='id' value='0'/>
<input type='submit'/>
</form>
示例#11
0
<?php

/*
 * SWFUpload Test
 * @author skitsanos
 */
require_once '../../src/Vzaar.php';
Vzaar::$token = "qQi7utyEliiPQqiU6sH2u33Z6y80yMZoIYx684Ct9w";
Vzaar::$secret = "atletesprofessional";
Vzaar::$enableFlashSupport = true;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>SWFUpload Demos</title>
    <link href="http://demo.swfupload.org/v220/css/default.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>

    <script type="text/javascript" src="swfupload.js"></script>
    <script type="text/javascript" src="swfupload.queue.js"></script>
    <script type="text/javascript" src="fileprogress.js"></script>
    <script type="text/javascript" src="handlers.js"></script>

    <script type="text/javascript">
        var vzaar_signature = <?php 
echo json_encode(Vzaar::getUploadSignature());
?>
;
        var swfu;
        var s3Response = {};