problems integrating KWC in my website

6 replies [Last post]
Joined: 07/28/2009
Points: 18

Hello,

I'm trying to integrate KWC in my website, I'm following the kwc integration guide ( http://www.kaltura.org/kaltura-contributor-wizard-kcw-website-integratio... )
I'm able to connect to my kaltura CE server, but nothing is displayed.

The problem is that I don't fully understand this line of code:

swfobject.embedSWF("http://www.kaltura.com/kcw/ui_conf_id/1000741 ", "kcw", "680", "360", "9.0.0", "expressInstall.swf", flashVars, params);

I've tried many 'versions' of this line but doesn't work.

Any help please?
Thanks.

Joined: 07/28/2009
Points: 18

I paste below what I have now:

      $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://10.0.2.230/kalturaCE/flash/kcw/v1.5.4CE/ContributionWizard.swf", "kcw", "680", "480", "9.0.0", flashVars, params);

Joined: 07/28/2009
Points: 18

Now a black box is displayed.

This is what I have in flashVars:
{"uid":"ANONYMOUS",
"partnerId":1,
"ks":"NGZmNmY3ZDNlMTAwMjViZDdlZDNkYzY0MjMzOGU1Mzc0YTI5Mzk4OXwxOzE7MTI1MjY4MTkwMTswOzEyNTI1OTU1MDEuODY7QU5PTllNT1VTO2VkaXQ6Kg==",
"afterAddEntry":"onContributionWizardAfterAddEntry",
"close":"onContributionWizardClose",
"showCloseButton":false,
"Permissions":1};

If I try to embed a media player instead of the contributionwizard, then I get this error message:
Error in multiRequest : KalturaStartWidgetSessionResponseError #1034

Joined: 01/05/2009
Points: 1697

Hi,

The swfobject.embedSWF(...); line is a swfobject command that is used to embed the KCW flash widget on your page.

Embedding the kaltura widgets should not be done directly but through using the specific service, i.e.:
Don't use : http://10.0.2.230/kalturaCE/flash/kcw/v1.5.4CE/ContributionWizard.swf
Use this: http://www.kaltura.com/kcw/ui_conf_id/1000741

Using the widget service, the kaltura server inject additional parameters to the embedded widget and improve caching of the widget so the users will not have to download the widget again the next time.

The service can be described as follow:
http://{Kaltura server url}/{Short widget name}/ui_conf_id/{Id of uiConf to use}

  • Kaltura server url - This is simply the url to your kaltura CE server.
  • Short widget name - the short name of the widget to load; kse=kaltura standard editor, kae=kaltura advanced editor, kcw=kaltura contribution wizard...
  • Id of uiConf to use - every widget can have several configuration sets or designs, you distinguish by the id of the configuration set to use (uiConf = User Interface Configuration).
    To get a list of the uiConfs on your server, use the uiConf.list API call.
Joined: 07/28/2009
Points: 18

Hi Kalturian, thanks for reply.
In the end I have been able to get it working but in a different way, without using embedSWF function.
I paste the code below:

var kso = new SWFObject("http://url/kcw/ui_conf_id/601", "kalturaCw", "680", "360", "9", "#000000");
kso.addParam("flashVars", "userId="+userId+"&sessionId="+kk+"&partnerId="+partnerId+"&subPartnerId="+partnerId+"&kshow_id=-2&afterAddentry=onContributionWizardAfterAddEntry&close=onContributionWizardClose&uiConfId=601");
kso.addParam("allowScriptAccess", "always");
kso.addParam("allowFullScreen", "TRUE");
kso.addParam("allowNetworking", "all");
kso.write("divKalturaCw");

Joined: 01/20/2012
Points: 2

When I enter this in my browser...
http://myamazonsite/kcw/ui_conf_id/my_ui_conf_id
It seems to start working...the flexwrapper url gets invoked but I end up with just a light blue screen.

When I enter the same url in the sample code, (http://www.kaltura.org/kaltura-contributor-wizard-kcw-website-integratio...) nothing happens, just get a blank screen...can anyone provide some help?

<?php require_once("KalturaClient.php"); ?>

<?php
//define constants
define("KALTURA_PARTNER_ID", "mypartnerid");
define("KALTURA_PARTNER_SERVICE_SECRET", "mysecretcode");

//define session variables
$partnerUserID = 'ANONYMOUS';

//construct Kaltura objects for session initiation
$config = new KalturaConfiguration(KALTURA_PARTNER_ID);
$config->serviceUrl = "myamazonsite";
$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("myamazonsite/kcw/ui_conf_id/myuiconfid ", "kcw", "680", "360", "9.0.0", "false", 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");
}

Joined: 03/29/2009
Points: 764

Glad to hear it's working now - please let us know if you have any more related issues.