コード例 #1
0
ファイル: addCall.php プロジェクト: akhil-chaurasia/tokboxapi
/*
 * This script handles the generation of a guest user who then generates a call id
 * for the party room which is being created. It then puts the relevant information
 * into the database to present in other pages.
 *
 * @author Melih Onvural melih@tokbox.com
 */
if (isset($_POST['submit'])) {
    require_once 'SDK/TokBoxCall.php';
    require_once 'SDK/TokBoxUser.php';
    require_once 'Site_Config.php';
    @($subject = trim($_POST['subject']));
    if (!isset($subject) || strlen($subject) == 0) {
        $subject = "Open Chat";
    }
    $inList = isset($_POST['inList']) ? 1 : 0;
    try {
        $userObj = TokBoxUser::createGuest();
        //generates a guest user who is needed to generate a call
        $callid = TokBoxCall::createCall($userObj, true);
        //generates a persistent (hence the true) call id
        $dbConn = @mysql_connect(Site_Config::DB_HOST, Site_Config::DB_USER, Site_Config::DB_PASSWORD) or die(mysql_error());
        mysql_select_db(Site_Config::DB_DATABASE, $dbConn) or die(mysql_error());
        $query = "INSERT INTO calls(callid, subject, created, list) VALUES('{$callid}', '{$subject}', NOW(), '{$inList}')";
        mysql_query($query, $dbConn) or die(mysql_error());
    } catch (Exception $e) {
        trigger_error($e->getMessage());
    }
}
header("Location:" . Site_Config::VIDEO_CALL_ROOM . "?callid=" . $callid);
コード例 #2
0
ファイル: index.php プロジェクト: akhil-chaurasia/tokboxapi
<?php

require_once 'SDK/TokBoxUser.php';
TokBoxUser::loginUser();
コード例 #3
0
ファイル: main.php プロジェクト: akhil-chaurasia/tokboxapi
<?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">
コード例 #4
0
<?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");
コード例 #5
0
 function get_tokbox_user_profile($apiObj, $jabberId)
 {
     $profile = TokBoxUser::getUserProfile($apiObj, $jabberId);
     if (is_array($profile)) {
         return $profile;
     }
     return null;
 }
コード例 #6
0
ファイル: index.php プロジェクト: akhil-chaurasia/tokboxapi
?>
 
        </div>
	<div class="details">
		<p><b>Coco Crisp &amp; 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
コード例 #7
0
<?php

if (isset($_POST['submit'])) {
    require_once 'SDK/TokBoxUser.php';
    require_once 'Callback.php';
    $firstname = $_POST['firstname'];
    $lastname = $_POST['lastname'];
    $email = $_POST['email'];
    $apiObj = TokBoxUser::registerUser($email, $lastname, $firstname);
    Callback::generateCookie($apiObj->getJabberId(), $apiObj->getSecret());
}
?>
<!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="registerForm">
			<form name="registerForm" action="register.php" method="POST">
				<table cellpadding="2" cellspacing="5">
					<tr>
						<td>First Name:</td>
						<td><input type="text" name="firstname" /></td>
					</tr>
					<tr>
						<td>Last Name:</td>