Loading Recently Created Mix -

1 reply [Last post]
Joined: 06/22/2009
Points: 1

I have just read "How to pre-populate you editor content", and I was able to succesfully create a new Mix.

I am using PHP, and I get the following back:

 Your new mix ID is "3ffpv3g0wg"
These entries were added to the mix -
u5o21kld88-First test Video
qzz0prt090-Second Test Video

So, I am attempting to "load" this 'new mix' into KSE, but I get the following Flash errors:

"LoadEntryMRCommand ==> fault, load show/entry faild please try again later..."
-AND-
"Error: Internal server error INVALID_STR"

Here's the code I'm using to attempt to load the new mix:

 <?

require_once("../kaltura_client.php");

define(KALTURA_PARTNER_ID, XXXXX);
define(KALTURA_SUBP_ID, XXXXXXX);
define(KALTURA_SECRET, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");

$config = new KalturaConfiguration(KALTURA_PARTNER_ID,KALTURA_SUBP_ID);

$user = new KalturaSessionUser();
$user->userId = "255";
$user->screenName = "testings";

$client = new KalturaClient($config);
$result = $client->startSession($user, KALTURA_SECRET, false, "edit:*");
$ks = $result["result"]["ks"];

$mix_id = '3ffpv3g0wg';     // The entry id of the mix we created above
$result = $client->cloneRoughcut($user,$mix_id);      // Cloning the mix.
$new_mix_id = @$result["result"]["entry"]["id"]; // Retrieving the new mix id. THIS is what you launch the editor with.    
$flashVars = array();
$flashVars["partnerId"] = KALTURA_PARTNER_ID;
$flashVars["subpId"]    = KALTURA_SUBP_ID;
$flashVars["uid"]       = $user->userId;
$flashVars["ks"]        = $ks;
$flashVars["kshowId"]   = "entry-".$new_mix_id;
$flashVars["entryId"]   = $new_mix_id;
$flashVars["backF"]     = "onSimpleEditorBackClick";
$flashVars["saveF"]     = "onSimpleEditorSaveClick";
$flashVars["quick_edit"] = 0;

?>

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<div id="kse"></div>
<script type="text/javascript" src="../swfobject/swfobject.js"></script>
<script type="text/javascript">
var params = {
        allowScriptAccess: "always",
        allowNetworking: "all",
        wmode: "opaque"
};
                       
var flashVars = <?php echo json_encode($flashVars); ?>;
swfobject.embedSWF("http://www.kaltura.com/kse/ui_conf_id/1000200", "kse", "890", "546", "9.0.0", false, flashVars, params);
</script>

<script type="text/javascript">

function onSimpleEditorBackClick(isModified) {
        alert('onSimpleEditorBackClick');
}

function onSimpleEditorSaveClick() {
        alert('onSimpleEditorSaveClick');
}

</script>
</body>
</html>

Any help would be wonderful!

Joined: 01/05/2009
Points: 1697

If you'll do a var_dump on $result, you will see you get an invalid KS.
This is because you need to use ADMIN secret to perform cloneRoughcut action, but you only use the regular secret.

See my last comment on the pre-populated mix guide with the updated script.