Copyright © 2011 Kaltura Inc.
All Rights Reserved. Designated trademarks and brands are the property of their respective owners.
Use of this web site constitutes acceptance of the Terms of Use and Privacy Policy.
EduVideo.org
I am trying to get the KCW up and working on my site. I copy and pasted the example script from the integration help page but when I load the web page it just comes up completely blank, no errors or anything just blank. Heres is my code:
<?php require_once("KalturaClient.php"); ?>
<?php
//define constants
define("KALTURA_PARTNER_ID", 104892);
define("KALTURA_PARTNER_SERVICE_SECRET", "2da55f0b05fbc6d1ab89de3494c7d082");
//define session variables
$partnerUserID = 'ANONYMOUS';
//construct Kaltura objects for session initiation
$config = new KalturaConfiguration(KALTURA_PARTNER_ID);
$client = new KalturaClient($config);
$ks = $client->session->start(KALTURA_PARTNER_SERVICE_SECRET, $partnerUserID, KalturaSessionType::USER);
//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;
?>
var params = {
allowScriptAccess: "always",
allowNetworking: "all",
wmode: "opaque"
};
// php to js
var flashVars = <?php echo json_encode($flashVars); ?>;
swfobject.embedSWF("http://www.kaltura.com/kcw/ui_conf_id/1000741 ", "kcw", "680", "360", "9.0.0", "expressInstall.swf", flashVars, params);
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);
}
}
function onContributionWizardClose() {
alert("Thank you for using Kaltura ontribution Wizard");
}
Any idea what is wrong?
missing some basics folks....
1. First of all, tags are missing around javascript code.
2. Must include swfobject.
3. Be careful with secrets you have, they may be misused...!!!???!!!
Running code is here...
<?php require_once("lib/KalturaClient.php"); ?>
<?php
//define constants
define("KALTURA_PARTNER_ID", 104892);
define("KALTURA_PARTNER_SERVICE_SECRET", "2da55f0b05fbc6d1ab89de3494c7d082");
//define session variables
$partnerUserID = 'ANONYMOUS';
//construct Kaltura objects for session initiation
$config = new KalturaConfiguration(KALTURA_PARTNER_ID);
$client = new KalturaClient($config);
$ks = $client->session->start(KALTURA_PARTNER_SERVICE_SECRET, $partnerUserID, KalturaSessionType::USER);
//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;
?>
var params = {
allowScriptAccess: "always",
allowNetworking: "all",
wmode: "opaque"
};
// php to js
var flashVars = <?php echo json_encode($flashVars); ?>;
swfobject.embedSWF("http://www.kaltura.com/kcw/ui_conf_id/1000741 ", "kcw", "680", "360", "9.0.0", "expressInstall.swf", flashVars, params);
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);
}
}
function onContributionWizardClose() {
alert("Thank you for using Kaltura ontribution Wizard");
}
Thanks ;-)
Ok I included my swfobject.js and my java is in its proper tags, but I am having the same problem. Any suggestions?
<!--include external scripts and define constants -->
<?php
ini_set('display_errors',1);
error_reporting(E_ALL|E_STRICT);
require_once("kaltura_client_v3/KalturaClient.php");
//define constants
define("KALTURA_PARTNER_ID", 254892);
define("KALTURA_PARTNER_WEB_SERVICE_SECRET", "6ac67698*****1");
//define session variables
$partnerUserID = "ADMIN";
//Construction of Kaltura objects for session initiation
$config = new KalturaConfiguration(KALTURA_PARTNER_ID);
$client = new KalturaClient($config);
$ks = $client->session->start(KALTURA_PARTNER_WEB_SERVICE_SECRET, $partnerUserID, KalturaSessionType::ADMIN);
$flashVars = array();
$flashVars["uid"] = $partnerUserID;
$flashVars["partnerId"] = KALTURA_PARTNER_ID;
$flashVars["subPId"] = KALTURA_PARTNER_ID*100;
$flashVars["ks"] = $ks;
$flashVars["afterAddEntry"] = "onContributionWizardAfterAddEntry";
$flashVars["close"] = "onContributionWizardClose";
$flashVars["showCloseButton"] = false;
$flashVars["Permissions"] = 1;
?>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<div id="kcw"></div>
<script type="text/javascript">
var params = {
allowScriptAccess: "always",
allowNetworking: "all",
wmode: "opaque"
};
// 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 ontribution Wizard");
}
</script>
</body>
</html>
Ok so I ran through the code and output and came up with this, this snippit of code,
is outputing this
Looks like the javascript variables (flashVars and params) are not rendering in the swf embed. Now I'm useless with java, can anyone point me in the right direction?
I am just documenting my attempts now to get this all working. Quite frankly I am about running out of patience with these horrible "sample codes" and the complete lack of support with the kaltura platform. I understand I am not yet a paying member but if I can't get 2 out of 3 of what should be simple widgets working, I doubt ill ever be.
So I tried to take as much javascipt as I could out of it and tried to populate the swf embed call with php, something I am much more comfortable with and threw this together.
That outputted something that looks a lot more correct;
But still no hints of the object actually, you know, embedding
omg, I'm not the only guy who has this pb.
That's a bug?
Blank page and no error.
Why it's so complicated to run this CW app... Grrr