. * */ function_exists('tubepress_load_classes') || require(dirname(__FILE__) . '/../../../../tubepress_classloader.php'); tubepress_load_classes(array('net_php_pear_HTML_Template_IT', 'org_tubepress_embedded_impl_AbstractEmbeddedPlayerService', 'net_php_pear_Net_URL2')); /** * Represents an HTML-embeddable JW FLV Player * */ class org_tubepress_embedded_impl_JwFlvEmbeddedPlayerService extends org_tubepress_embedded_impl_AbstractEmbeddedPlayerService { /** * Spits back the text for this embedded player * * @return string The text for this embedded player */ public function toString($videoId) { global $tubepress_base_url; $tpl = new net_php_pear_HTML_Template_IT(dirname(__FILE__) . "/../../../../../ui/embedded/longtail/html_templates"); if (!$tpl->loadTemplatefile("object.tpl.html", true, true)) { throw new Exception("Couldn't load embedded template"); } $tpom = $this->getOptionsManager(); $link = new net_php_pear_Net_URL2(sprintf("http://www.youtube.com/watch?v=%s", $videoId)); $link = $link->getURL(true); $tpl->setVariable("TUBEPRESS_BASE", $tubepress_base_url); $tpl->setVariable("YOUTUBE_LINK", $link); $tpl->setVariable('AUTOSTART', $tpom->get(org_tubepress_options_category_Embedded::AUTOPLAY) ? 'true' : 'false'); $tpl->setVariable('WIDTH', $tpom->get(org_tubepress_options_category_Embedded::EMBEDDED_WIDTH)); $tpl->setVariable('HEIGHT', $tpom->get(org_tubepress_options_category_Embedded::EMBEDDED_HEIGHT)); return $tpl->get(); } }