<?php require_once '../SDK/TokBoxCall.php'; require_once '../SDK/TokBoxUser.php'; require_once '../Test_Config.php'; try { $apiObj = TokBoxUser::createUser(Test_Config::TEST_JABBERID, Test_Config::TEST_ACCESS_SECRET); $callid = TokBoxCall::createCall($apiObj); //guest access to a call $callUrl = TokBoxCall::generateLink($callid); //generate call URL } catch (Exception $e) { echo $e->getMessage(); } //print out URL, and embed code echo "<a href=\"{$callUrl}\">{$callUrl}</a><br/>"; echo TokBoxCall::generateEmbedCode($callid, "425", "320", "../SDK/js/swfobject.js");
<?php require_once 'SDK/TokBoxVideo.php'; require_once 'SDK/TokBoxUser.php'; $tokboxId = explode(":", $_COOKIE['tokboxId']); $jabberId = $tokboxId[0]; $accessSecret = $tokboxId[1]; $apiObj = TokBoxUser::createUser($jabberId, $accessSecret); $vmailRecvs = TokBoxVideo::getVmailRecv($apiObj); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>TokBox VMail Sample Application</title> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="container"> <div id="header"><h1>TokBox VMail</h1></div> <div id="nav"><a href="logout.php">Log Out</a></div> <div id="main"> <?php if (isset($_GET['msgId'])) { echo TokBoxVideo::generatePlayerEmbedCode($_GET['msgId']); } else { echo "Select a video from the right to view it here"; } ?> </div> <div id="sidebar">
?> </div> <div class="details"> <p><b>Coco Crisp & Red Bunny</b><br/> Happily announce their plans to marry, and invite you to leave them a video message</p> <p><b>Date:</b> Sunday, May 11 @ 5:00pm</p> <p><b>Location:</b>SF City Hall</p> </div> <div class="balloon"> <a href="recorderPopup.php" target="_blank"><img src="images/balloon.png" border="0" alt="Leave a message" /></a> </div> <?php //Here we are instantiating the user's API object so that we can make requests on behalf //of the user JABBERID with secrect ACCESS_SECRET $apiObj = TokBoxUser::createUser(Site_Config::JABBERID, Site_Config::ACCESS_SECRET); $vmailRecvs = TokBoxVideo::getVmailRecv($apiObj); //grabs the feed of video mails received by the user ob_start(); foreach ($vmailRecvs as $vmailRecv) { $senders = $vmailRecv->getVmailSenders(); $sender = $senders[0]; //grabs the sender of the video mail echo "<div class=\"video\">"; echo "<img src=\"" . $vmailRecv->getVmailImgUrl() . "\">"; //grabs the image URL of the video mail echo "Message from " . $sender->getFullName(); //grabs the full echo "<br/>"; echo '<a href="playerPopup.php?mid=' . $vmailRecv->getVmailMessageId() . '">Click to play message</a>'; //gets the message ID which is used by the player widget to play the video