<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <link rel="stylesheet" href="style.css" type="text/css" charset="utf-8"/> <title>Stupeflix Factory Demo - 1</title> </head> <body> <h1>1. Spawn the editor</h1> <?php // get the stupeflix client and initialize it with your editor's secret key require_once 'stupeflix.php'; require_once 'key.php'; if ($EDITOR_ID == 'PUT-YOUR-EDITOR_ID-HERE') { die("Please fill in key information in key.php\n"); } $stupeflix = new StupeflixClient($FACTORY_HOST, $EDITOR_SECRET_KEY); // compute the server url $server_url = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; $parts = explode('?', $server_url); $server_url = $parts[0]; // set up your editor's parameters $params = array(); $params['action'] = $server_url . 'callback.php'; // the editor will POST on this url when an user select a video $params['target'] = '_parent'; // the 'action' url will be opened in the parent window $params = array_merge($params, $_GET); // current GET parameters are also passed to the editor for testing // they will be POSTed inchanged on the 'action' url // sign your editor's url and its parameters with your editor's secret key $editor_url = $stupeflix->signUrl('/editor/' . $EDITOR_ID . '/', $params);
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Stupeflix Factory Demo - 3</title> <link rel="stylesheet" href="style.css" type="text/css" charset="utf-8"/> <script type="text/javascript" charset="utf-8" src="flowplayer/flowplayer-3.1.1.min.js"></script> </head> <body> <h1>3. Get the video</h1> <?php require_once 'stupeflix.php'; require_once 'key.php'; // sign the video's url with your editor secret key $video_id = $_GET['video_id']; $stupeflix = new StupeflixClient($FACTORY_HOST, $EDITOR_SECRET_KEY); $video_url = $stupeflix->signUrl('/video/' . $video_id . '/'); // compute the flash player dimensions $hres = (int) $_GET['hres']; $vres = (int) $_GET['vres']; $player_dimensions = 'width: ' . $hres . 'px; height:' . ($vres + 25) . 'px;'; ?> <h2>Signed video's url:</h2> <div class="section"> <a href="<?php echo $video_url; ?> "><?php echo $video_url; ?>