<?php

require_once '../SDK/TokBoxCall.php';
require_once '../SDK/TokBoxUser.php';
try {
    $userObj = TokBoxUser::createGuest();
    $callid = TokBoxCall::createCall($userObj);
    //guest access to a call
    $callUrl = TokBoxCall::generateLink($callid);
    //generate call URL
} catch (Exception $e) {
    echo $e->getMessage();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
	<title>Testing Call Embed as Guest</title>
	
</head>
<body>
	<?php 
//print out URL, and embed code
echo "<a href=\"{$callUrl}\">{$callUrl}</a><br/>";
echo TokBoxCall::generateEmbedCode($callid, "425", "320", "../SDK/js/swfobject.js");
?>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
        <title>Sample Application - TokBox Developer API - Call Generator</title>
        <link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
	<?php 
require_once 'SDK/TokBoxCall.php';
if (isset($_GET['callid'])) {
    $callId = $_GET['callid'];
    $htmlCode = TokBoxCall::generateEmbedCode($callId, $width = "800", $height = "600");
    //This will generate the code necessary to embed the call widget onto your site. The call id is pulled from the GET parameter, which is passed in from index.php
    echo $htmlCode;
} else {
    echo "<h2>This video room is no longer active. You can create a new room <here></h2>";
}
?>
</body>
</html>
Exemple #3
0
</head>
<body>
	<div id="callbox">
<?php 
require_once 'Site_Config.php';
require_once 'SDK/TokBoxCall.php';
require_once 'SDK/TokBoxUser.php';
try {
    $userObj = TokBoxUser::createGuest();
    $jabberId = $userObj->getJabberId();
    $secret = $userObj->getSecret();
    $callId = TokBoxCall::createCall($userObj);
    //guest access to a call
    $inviteId = TokBoxCall::generateInvite($userObj, Site_Config::CALLEE_JABBERID, $callId);
} catch (Exception $e) {
    echo $e->getMessage();
}
//print out URL, and embed code
echo TokBoxCall::generateEmbedCode($callId);
?>
	</div>
	<div id="inviteRow">
		<form>
<?php 
echo "\t\t<input type=\"button\" name=\"inviteUser\" value=\"" . Site_Config::CALLEE_DISPLAYNAME . "\" onClick=\"sendInvite('" . Site_Config::CALLEE_USERID . "','" . Site_Config::CALLEE_DISPLAYNAME . "','" . Site_Config::CALLEE_JABBERID . "','" . $inviteId . "');\">\n";
?>
		</form>
	</div>

</body>
</html>
    //guest access to a call
    $jid = $userObj->getJabberId();
    $userid = substr($jid, 0, strpos($jid, '@'));
    $inviteid = TokBoxCall::generateInvite($userObj, $callid, "*****@*****.**");
} catch (Exception $e) {
    echo "Please report this error:" . $e->getMessage() . " to an administrator";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
	<title>Proctor 1</title>
	<script type="text/javascript" src="js/TokBoxScript.js"></script>
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript">
		$(document).ready(function() {
			setTimeout("sendInvite('565954','Student for Proctor 1','*****@*****.**', '<?php 
echo $inviteid;
?>
');", 10000);
		});
	</script>
</head>
<body>
	<?php 
echo TokBoxCall::generateEmbedCode($callid, 600, 450, 'js/swfobject.js');
?>
</body>
</html>