public function sendtoeditorAction()
 {
     wp_enqueue_style('media');
     wp_enqueue_script('kaltura-player-selector');
     $entryIds = isset($_GET['entryIds']) ? $_GET['entryIds'] : array();
     $entryId = null;
     if (is_array($entryIds) && count($entryIds) > 0) {
         $entryId = $entryIds[0];
     }
     if (is_null($entryId)) {
         wp_die('No entry specified');
     }
     if (!count($_POST)) {
         $kmodel = KalturaModel::getInstance();
         $entry = $kmodel->getEntry($entryId);
         $clientSideSession = $kmodel->getClientSideSession();
         $flashVars = KalturaHelpers::getKalturaPlayerFlashVars(null, $clientSideSession, $entryId);
         $thumbnail = KalturaHelpers::getPluginUrl() . '/thumbnails/get_preview_thumbnail.php?thumbnail_url=' . $entry->thumbnailUrl;
         $params['entry'] = $entry;
         $params['entryId'] = $entryId;
         $params['nextEntryIds'] = $entryIds;
         $params['flashVars'] = $flashVars;
         $params['flashVars']['autoPlay'] = 'true';
         $params['thumbnailPlaceHolderUrl'] = $thumbnail;
     } else {
         // update the entry name
         $kmodel = KalturaModel::getInstance();
         $baseEntry = new Kaltura_Client_Type_BaseEntry();
         $baseEntry->name = $_POST['ktitle'];
         $kmodel->updateBaseEntry($entryId, $baseEntry);
         array_shift($entryIds);
         // done with 1 entry, maybe we have more
         $width = $_POST['playerWidth'];
         $uiConfId = $_POST['uiConfId'];
         $playerRatio = $_POST['playerRatio'];
         $params['entryId'] = $entryId;
         $params['nextEntryIds'] = $entryIds;
         $params['playerWidth'] = $width;
         $params['playerHeight'] = KalturaHelpers::calculatePlayerHeight($uiConfId, $width, $playerRatio);
         $params['uiConfId'] = $uiConfId;
     }
     $this->renderView('library/send-to-editor.php', $params);
 }
예제 #2
0
 function getTinyPlayerFlashVars($ks, $kshowId)
 {
     $sessionUser = KalturaHelpers::kalturaGetSessionUser();
     $flashVars = KalturaHelpers::getKalturaPlayerFlashVars($ks, $kshowId, -1);
     $flashVars["layoutId"] = "playerOnly";
     return $flashVars;
 }
function embed_kaltura($entryId, $width, $height, $type, $design, $show_links = false)
{
    global $CFG;
    $client = KalturaHelpers::getKalturaClient();
    $playerId = KalturaHelpers::getPlayer($type, $design);
    $partnerId = KalturaHelpers::getPlatformKey("partner_id", "0");
    $swfUrl = KalturaHelpers::getSwfUrlForWidget($partnerId);
    $swfUrl .= "/uiconf_id/{$playerId}/entry_id/" . $entryId;
    $flashVarsStr = KalturaHelpers::flashVarsToString(KalturaHelpers::getKalturaPlayerFlashVars($client->getKS(), -1, $entryId));
    $div_id = "kaltura_wrapper_" . $entryId;
    $kaltura_poweredby = '<div style="width:' . $width . 'px;padding-top:6px;font-size:9px;text-align:right"><a href="http://corp.kaltura.com/technology/video_player" target="_blank">Video Player</a> by <a href="http://corp.kaltura.com" target="_blank">Kaltura</a></div>';
    if ($show_links == false) {
        $kaltura_poweredby = '';
    }
    $align = '';
    $custom_style = '';
    $links = '<a href=" http://corp.kaltura.com/solutions/education">education video</a><a href="http://corp.kaltura.com/userzone/tutorials">video tutorials</a><a href="http://corp.kaltura.com/technology/video_player">flv player</a>';
    $html = '
      <div id="' . $div_id . '" class="kaltura_wrapper" style="' . $align . $custom_style . '"' . $embed_options['js_events'] . '>' . $links . '</div>' . $kaltura_poweredby;
    $html .= '<script type="text/javascript">';
    $html .= 'function gotoEditorWindow(param1)';
    $html .= '{';
    $html .= '     onPlayerEditClick(param1);';
    $html .= '}';
    $html .= 'function onPlayerEditClick(param1)';
    $html .= '{';
    $html .= '      kalturaInitModalBox(\'' . $CFG->wwwroot . '/mod/kaltura/keditor.php?entry_id=' . '\'+param1 , {width:890, height:546});';
    $html .= '}';
    $html .= '        var kaltura_swf = new SWFObject("' . $swfUrl . '", "' . $player_id . '", "' . $width . '", "' . $height . '", "9", "#ffffff");';
    $html .= '        kaltura_swf.addParam("wmode", "opaque");';
    $html .= '        kaltura_swf.addParam("allowScriptAccess", "always");';
    $html .= '        kaltura_swf.addParam("allowFullScreen", "TRUE");';
    $html .= '        kaltura_swf.addParam("allowNetworking", "all");';
    $html .= '        if(kaltura_swf.installedVer.major >= 9) {';
    $html .= '          kaltura_swf.write("' . $div_id . '");';
    $html .= '        } else {';
    $html .= '          document.getElementById("' . $div_id . '").innerHTML = "Flash player version 9 and above is required. <a href=\'http://get.adobe.com/flashplayer/\'>Upgrade your flash version</a>";';
    $html .= '        }</script>';
    return $html;
}