$new = get_subtype_id('object', 'simplekaltura_video'); if (!$new) { $new = add_subtype('object', 'simplekaltura_video'); } $old = get_subtype_id('object', 'kaltura_video'); foreach ($videos as $v) { if ($v->simplekaltura_cannot_import) { // we can't import this for some reason... continue; } // note the old plugin made mixes which are deprecated and don't play properly // we can get the associated source video id instead which works correctly $entry_id = false; // check if it's a mix (most of them are) try { $client = simplekaltura_create_client(true); $entry = $client->mixing->get($v->kaltura_video_id); $xml = new SimpleXMLElement($entry->dataContent); $assets = $xml->VideoAssets->vidAsset[0]; if ($assets) { $attr = get_object_vars($xml->VideoAssets->vidAsset[0]->attributes()); $entry_id = $attr['@attributes']['k_id']; } } catch (Exception $exc) { // do nothing yet... } // if we don't have an entry_id it could be a legit video... if (!$entry_id) { try { $entry = simplekaltura_get_entry($v->kaltura_video_id, true); if ($entry) {
/** * Cron function to update all simplekaltura_video objects */ function simplekaltura_bulk_update() { elgg_load_library('simplekaltura'); elgg_load_library('KalturaClient'); // Get a kaltura client $client = simplekaltura_create_client(true); // Set up pager $pager = new KalturaFilterPager(); $pager->pageIndex = "1"; $pager->pageSize = "0"; // Set up filter $filter = new KalturaMediaEntryFilter(); $filter->tagsAdminTagsMultiLikeOr = elgg_get_plugin_setting('kaltura_admin_tags', 'simplekaltura'); // Grab entries $result = $client->media->listAction($filter, $pager); // Get elgg entities $options = array('type' => 'object', 'subtype' => 'simplekaltura_video', 'limit' => 0); $ia = elgg_set_ignore_access(true); // just need an array of the kaltura ids and GUIDs $batch = new ElggBatch('elgg_get_entities', $options); $video_ids = array(); foreach ($batch as $video) { if ($video->kaltura_entryid) { $video_ids[$video->kaltura_entryid] = $video->getGUID(); } } // Match up each found entry to an elgg entity $success = true; foreach ($result->objects as $entry) { // If it exists.. $video_guid = elgg_extract($entry->id, $video_ids); if ($video_guid) { $videoupdate = get_entity($video_guid); $success &= simplekaltura_update_video($videoupdate, $entry); } } elgg_set_ignore_access($ia); return $success; }
* @package Simplekaltura * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 * @author Jeff Tilson * @copyright THINK Global School 2010 - 2013 * @link http://www.thinkglobalschool.com/ * */ require_once dirname(dirname(dirname(dirname(__FILE__)))) . "/engine/start.php"; global $CONFIG; admin_gatekeeper(); set_time_limit(0); $go = get_input('go', FALSE); elgg_load_library('simplekaltura'); elgg_load_library('KalturaClient'); // Get a kaltura client $client = simplekaltura_create_client(TRUE); // Set up pager $pager = new KalturaFilterPager(); $pager->pageIndex = "1"; $pager->pageSize = "0"; // Set up filter $filter = new KalturaMediaEntryFilter(); $filter->tagsAdminTagsMultiLikeOr = elgg_get_plugin_setting('kaltura_admin_tags', 'simplekaltura'); // Grab entries $result = $client->media->listAction($filter, $pager); // Get elgg entities $options = array('type' => 'object', 'subtype' => 'simplekaltura_video', 'limit' => 0); // just need an array of the kaltura ids and GUIDs $batch = new ElggBatch('elgg_get_entities', $options); $video_ids = array(); foreach ($batch as $video) {
* * Previous working uiconfid's: * - 8003811 */ elgg_load_library('simplekaltura'); elgg_load_library('KalturaClient'); elgg_load_js('simplekaltura:swfobject'); // uiconf $uiconf = elgg_get_plugin_setting('kaltura_uiconfid', 'simplekaltura'); // Session vars $kaltura_partner_id = elgg_get_plugin_setting('kaltura_partnerid', 'simplekaltura'); $partner_user_id = elgg_get_plugin_setting('kaltura_partnerid', 'simplekaltura'); // Upload size $upload_max = elgg_get_plugin_setting('kaltura_upload_max', 'simplekaltura'); // Get client $client = simplekaltura_create_client(); $flashVars = array(); $flashVars["uid"] = $partner_user_id; $flashVars["partnerId"] = $kaltura_partner_id; $flashVars["subPId"] = $kaltura_partner_id * 100; $flashVars["entryId"] = -1; $flashVars["ks"] = $client->getKs(); $flashVars["maxFileSize"] = $upload_max; $flashVars["maxTotalSize"] = $upload_max; $flashVars["uiConfId"] = $uiconf; $flashVars["jsDelegate"] = "uploader"; $video_submit = elgg_view('input/button', array('class' => 'elgg-button elgg-button-submit', 'id' => 'simplekaltura-uploader-submit', 'value' => elgg_echo('simplekaltura:label:selectvideo'))); $dialog_title = elgg_echo('simplekaltura:label:uploadingdialogtitle'); echo <<<HTML \t<div id="simplekaltura-uploader-container"> \t\t{$video_submit}