KaltuaraAPI:Collaborative Video Editor
From Devwiki
Part of the KalturaAPI
The Collaborative Video Editor is a flash object that helps edit a Collaborative Video.
When placed in an html page the code looks like the following:
<object width="100%" height="100%" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab" data="/swf/keditor.swf" type="application/x-shockwave-flash" id="keditor" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"> <param value="/swf/keditor.swf" name="movie"/> <param value="best" name="quality"/> <param value="#000000" name="bgcolor"/> <param value="Always" name="allowScriptAccess"/> <param value="true" name="allowFullScreen"/> <param value="OnCreationCompleteF=onLoadMovie" name="flashVars"/> <embed width="100%" height="100%" align="middle" pluginspage="http://www.adobe.com/go/getflashplayer" type="application/x-shockwave-flash" flashvars="OnCreationCompleteF=onLoadMovie" allowfullscreen="true" allowscriptaccess="Always" quality="best" loop="false" play="true" id="keditor" name="keditor" bgcolor="#000000" src="/swf/keditor.swf"/> </object>
After the flash object initializes, it calls 3 JavaScript functions:
getKshowId, getEntryId and getPartnerInfo.
When it closes, it calls a 4th function - browseBack<code/>.
All functions must exist and be accessible by the flash object.
<script type="text/javascript">
function getKshowId(){
return kshow_id;
}
function getEntryId(){
return null;
}
function getPartnerInfo (){
obj = new Object;
obj["partner_id"]="1";
obj["subp_id"]="100";
obj["ks"]="ZTVhMWU1M2M0NWQ3YzM0NWJhMzM1YjdiNjk4NzBlMmMxNTYwNDhlOHwxOzE7MTIwMTUyMTkxNjswOzEyMDE0MzU1MTYuMTQ7Mg==";
obj["uid"]="2";
obj["logo_url"]="http://www.kaltura.com/images/partners/wookoo.png";
obj["btn_txt_back"]="Back to WooKoo";
obj["btn_txt_publish"]="Save";
obj["partner_name"]="WooKoo";
return obj;
}
function browseBack( modified ){
modified_str = "";
if ( ! modified ) modified_str = "&kaltura_modified=true";
window.top.location='<some_url_to_navigate_to>' + modified_str;
}
</script>
Javascript functions
- getKshowId - returns the Collaborative Video id to edit.
- getEntryId - should always return null.
- getPartnerInfo - returns a javascript object (as associative array) with info about the context of the editor
- partner_id - id of the kaltura-partner of which the Collaborative Video belongs to
- subp_id - the subp_id of the currnet Collaborative Video;
- ks - a valid kaltura-session returned by the startsession service (issues for thie current partner_id)
- uid - the partner's user id of the current user
- logo_url - the url of a logo to be dispalyed on the upper-left corner of the <cvw/>. Should be of size 75 x 35 pixels.
Valid types are png, jpg, gif. - btn_txt_back - text displyed on the 'Back' button.
- btn_txt_publish - text displyed on the 'Publish' button.
- partner_name - name of partner displayed in the Collaborative Video Editor splash screen.
- browseBack (modified) - called when the Collaborative Video Editor closes.
'modified' is set to be true if the user modified the Collaborative Video and saved it. Otherwise - modified=0.

