function getPlayerByType($type) { $players = KalturaHelpers::getPlayers(); if (array_key_exists($type, $players)) { $player = $players[$type]; } else { $player = $players[get_option('kaltura_default_player_type')]; } return $player; }
function get_cw_props_player($div, $width, $height) { $client = KalturaHelpers::getKalturaClient(); $playerId = KalturaSettings_PLAY_NOMIX_UICONF_ID; $players = KalturaHelpers::getPlayers(KalturaEntryType::MEDIA_CLIP); $partnerId = KalturaHelpers::getPlatformKey("partner_id", "0"); $swfUrl = KalturaHelpers::getSwfUrlForWidget($partnerId); $swfUrl .= "/uiconf_id/"; $flashVarsStr = KalturaHelpers::flashVarsToString(KalturaHelpers::getKalturaPlayerFlashVars($client->getKS(), -1, "#ReplaceME#")); $flash_embed = ' <script type="text/javascript"> function show_entry_player(entryId, design) { var playreId =' . KalturaSettings_PLAY_REGULAR_LIGHT_UICONF_ID . '; switch (design) {'; foreach ($players as $option_player_name => $option_player_id) { $flash_embed .= ' case "' . $option_player_name . '": playreId=' . $option_player_id . ';break;'; } $flash_embed .= ' } var kso = new SWFObject("' . $swfUrl . '" + playreId + "/entry_id/" + entryId, "' . $div . '", "' . $width . '", "' . $height . '", "9", "#ffffff"); kso.addParam("allowScriptAccess", "always"); kso.addParam("allowFullScreen", "TRUE"); kso.addParam("allowNetworking", "all"); if(kso.installedVer.major >= 9) { kso.write("' . $div . '"); } else { document.getElementById("' . $div . '").innerHTML = "Flash player version 9 and above is required. <a href=\\"http://get.adobe.com/flashplayer/\\">Upgrade your flash version</a>"; } } </script> '; return $flash_embed; }