New entry in api v3 (addRoughcutEntry)

2 replies [Last post]
Joined: 02/06/2010
Points: 13

Hi

can someone please tell us how to make a new entryId in the api v3?

In the api v2 it was somthing like this. But addRoughcutEntry does not exist in api v3 anymore.
How to call the new api to create a new empty mix?

$mix = new KalturaEntry;
$mix->name = $mix_name;
       
$result = $client->addRoughcutEntry($user, -2, $mix);
$mix_id = @$result["result"]["entry"]["id"];

----------------------------------------------------------------------------------------
My full sample php

require_once("kaltura/kaltura_client_v3/KalturaClient.php");

define("KALTURA_PARTNER_ID", "xxx");
define("KALTURA_PARTNER_SERVICE_SECRET", "xxx");

$config = new KalturaConfiguration(KALTURA_PARTNER_ID);
$config->serviceUrl = "http://www.kaltura.com";
$client = new KalturaClient($config);

$ks = $client->session->start(KALTURA_PARTNER_SERVICE_SECRET, KALTURA_PARTNER_ID, KalturaSessionType::ADMIN, KALTURA_PARTNER_ID, 86400, "edit:*");

$mix = new KalturaEntry;
$mix->name = $mix_name;
       
$result = $client->addRoughcutEntry($user, -2, $mix);
$mix_id = @$result["result"]["entry"]["id"];
echo '<b>Your new mix ID is </b>"' . $mix_id . '"<br>';

$flashVars = array();
$flashVars["partnerId"] = KALTURA_PARTNER_ID;
$flashVars["subpId"] = KALTURA_PARTNER_ID * 100;
$flashVars["uid"] = "USERID";
$flashVars["ks"]                = $ks;
$flashVars["kshowId"]   = -1;
$flashVars["entryId"]   = $entryId;
$flashVars["backF"]     = "onSimpleEditorBackClick";
$flashVars["saveF"]     = "onSimpleEditorSaveClick";

?>
<!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" xml:lang="en" lang="en">
<head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Kaltura Starter Kit - Add Video</title>
        <script type="text/javascript" src="xxx/lib/jquery-1.2.6.min.js"></script>
        <script type="text/javascript" src="xxx/swfobject.js"></script>
        <link rel="stylesheet" type="text/css" media="screen" href="css/layout.css" />
        <script type="text/javascript">
                function onContributionWizardAfterAddEntry(obj) {
                        // nothing to do
                }

                function onContributionWizardClose() {
                        window.location.href  = "video_test.php";
                }
        </script>
</head>
<body>
        <div id="wrap">
                <div id="contWrap" class="innerpage">
                        <div class="ipleftSide"></div>
                        <div class="ipleftSide iprightSide"></div>
                        <div id="row1" class="clearfix">
                                <div id="kseWrap">
                                        <div id="kse"></div>
                                </div>
                                <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/36300", "kse", "890", "546", "9.0.0", false, flashVars, params);
                                </script>
                        </div><!-- end #row1 -->
                </div><!-- end #contWrap -->
                <div id="bottomCorners"><div></div></div>
        </div>
</body>
</html>

Joined: 02/06/2010
Points: 13

To add a new empty entry call.

$ks = $client->session->start(KALTURA_PARTNER_SERVICE_SECRET, KALTURA_PARTNER_ID, KalturaSessionType::ADMIN, KALTURA_PARTNER_ID, 36300, "edit:*");

        $client -> setKs($ks);
        $mix = new KalturaMixEntry();
        $mix -> name = "video";
        $mix -> editorType = KalturaEditorType::SIMPLE;
        $mix = $client -> mixing -> add($mix);

IT WORKS GREAT :-)
Can someone confirm, that this is the right way? Do i need an admin session?

Joined: 05/14/2009
Points: 69

Yes, it works for me. Also a user session can do it, too. :)