Copyright © 2012 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
Hello, i'm new to Kaltura.. and have been playing around recently, I'm trying to get a upload videos widget up, but weirdly, some part of the PHP codings is consistently been shown on the webpage itself, I can't figure out why as i don't find any syntax error too.. can anyone please help me with this?
Is tabs like audio, webcam removable? i don't need them and i have been looking through all the files.. :|
<body>
<?php
//define constants
define("KALTURA_PARTNER_ID", myown);
define("KALTURA_PARTNER_SERVICE_SECRET", "myown");
//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);
//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: "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>
I have the same issue with the php api.
For me it looks definitely like the php-parser has some problem with the ">"
directly in front of the content which is finally displayed at your webpage,
so that he thinks its the closing bracket of the php-"Tag".
I didnt find a solution by now and trying to use the bad described
js-api with no big success.
Did you intergrate this code in a "real" Web-Application or simply
use some standard folder with the appropriate apache-configuration.
That could maybe be a problem i think.
Maybe one of the Kaltura-Pro's can make a simple tutorial for creating a
PHP-web-application with the simpliest api-functionality like KSU, KCW ...
by the way you forgot an "-" between session and
>start(KALTURA_PARTNER_SERVICE_SECRET, $partnerUserID); . . .
In general all the API's could be documented a bit better from my point of view
try to put the php-tag on the very top of your file.
then it should look like this:
//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);
//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;
?>
<html>
<head>
...
If this doesn't work you can control wether you are using the correct ui_conf_id by
open the contribution wizard from inside your KMC and check the modalbox with
firebug (ideally with the HTML-Tab) or something similar whitin your browser.
i hope i can help you
This might be due to the fact that you are not using the sample with a php web application. If you don't want to create a php application, convert the php code into javascript and then you will have to hardcode the ks value in and run it at jsbin.com (this way you wont have to create a web app atleast in the beginning to test your values, uiconf etc. Hope this helps.
Forgot to mention.. whats on the webpage ..