Re:Usage of Flash Embeded Kaltura Widgets in Rich Faces
richfaces76 May 17, 2010 12:43 PMHi,
Could any body advise me whether I can use this code implementation in rich faces project?I was using Kaltura Widgets which is making use of Flash and PHP for the widget and wanted to know whether I can use rich faces for this before making use of rich faces library etc..
<html>
<head>
<//!--include external scripts-->
<?php require_once("kaltura_client_v3/KalturaClient.php"); ?>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
</head>
<body>
<?php
//define constants
define("KALTURA_PARTNER_ID", 245592);
define("KALTURA_PARTNER_SERVICE_SECRET", "26a08bde59e067ed07ed3ddcb046ec84");
define("KALTURA_PARTNER_ADMIN_SECRET", "ab838a5d0c0c1cdb57cdd4f563d8b1c2");
//define session variables
$partnerUserID = 2;
//construct Kaltura objects for session initiation
$config = new KalturaConfiguration(KALTURA_PARTNER_ID);
$client = new KalturaClient($config);
$ks = $client->session->start(KALTURA_PARTNER_ADMIN_SECRET, $partnerUserID, KalturaSessionType::ADMIN);
//Prepare variables to be passed to embedded flash object.
$flashVars = array();
$flashVars["uid"] = $partnerUserID;
$flashVars["partnerId"] = KALTURA_PARTNER_ID;
$flashVars["ks"] = $ks;
$flashVars["afterAddEntry"] = "onContributionWizardAfterAddEntry";
$flashVars["close"] = "onContributionWizardClose";
$flashVars["showCloseButton"] = false;
$flashVars["Permissions"] = 1;
?>
<div id="kcw"></div>
<script type="text/javascript">
var params = {
allowScriptAccess: "always",
allowNetworking: "all",
wmode: "transparent"
};
// php to js
var flashVars = <?php echo json_encode($flashVars); ?>;
<!--embed flash object-->
swfobject.embedSWF("http://www.kaltura.com/kcw/ui_conf_id/1000741 ", "kcw", "680", "360", "9.0.0", "expressInstall.swf", flashVars, params);
</script>
<//!--implement callback scripts-->
<script type="text/javascript">
function onContributionWizardAfterAddEntry(entries) {
alert(entries.length + " media file/s was/were succsesfully uploaded");
for(var i = 0; i < entries.length; i++) {
alert("entries["+i+"]:EntryID:::::" + entries[i].entryId);
}
}
</script>
<script type="text/javascript">
function onContributionWizardClose() {
alert("Thank you for using Kaltura contribution Wizard");
}
</script>
</body>
</html>
Thanks,
Kumar