@param null|string $family_friendly

@return GoogleVideoUrlDecorator
350874
public function setFamilyFriendly($family_friendly = null)
    {
        if (null == $family_friendly) {
            $family_friendly = self::FAMILY_FRIENDLY_YES;
        }

        if (!in_array($family_friendly, [self::FAMILY_FRIENDLY_YES, self::FAMILY_FRIENDLY_NO])) {
            throw new Exception\GoogleVideoUrlException(
                sprintf(
                    'The parameter %s must be a valid family_friendly. see http://support.google.com/webmasters/bin/answer.py?hl=en&answer=80472#4',
                    $family_friendly
                )
            );
        }

        $this->family_friendly = $family_friendly;

        return $this;
    }
774945
public function getFeaturedVideo(ConnectionInterface $con = null)
    {
        if ($this->aFeaturedVideo === null && ($this->video_id !== null)) {
            $this->aFeaturedVideo = ChildVideoQuery::create()->findPk($this->video_id, $con);
            /* The following can be used additionally to
                guarantee the related object contains a reference
                to this object.  This level of coupling may, however, be
                undesirable since it could result in an only partially populated collection
                in the referenced object.
                $this->aFeaturedVideo->addFeaturedSkills($this);
             */
        }

        return $this->aFeaturedVideo;
    }
483053
public function find($videoKey) {
        if(is_null($videoKey) || empty($videoKey)) {
            throw new VideoClientException("A key is needed to fnd a video");
        }

        try {
            // Request the video from the SafeStream REST API
            $videos = $this->get(sprintf("%s?key=%s", $this->apiResourcePath, $videoKey));

            return $videos[0];
        } catch (SafeStreamHttpException $e) {
            throw new VideoClientException($e);
        }
    }
684840
public function getChildFamilyLabel(Family $family): string
    {
        if (preg_match('/\n1 FAMC @' . $family->xref() . '@(?:\n[2-9].*)*\n2 PEDI (.+)/', $this->gedcom(), $match)) {
            // A specified pedigree
            return GedcomCodePedi::getChildFamilyLabel($match[1]);
        }

        // Default (birth) pedigree
        return GedcomCodePedi::getChildFamilyLabel('');
    }
451506
public function chartFamsWithSources(
        string $color_from = null,
        string $color_to = null
    ): string {
        $tot_fam        = $this->totalFamiliesQuery();
        $tot_fam_source = $this->totalFamsWithSourcesQuery();

        return (new ChartFamilyWithSources())
            ->chartFamsWithSources($tot_fam, $tot_fam_source, $color_from, $color_to);
    }
216440
public function loadChildren(Family $family, $generations): string
    {
        $out = '';
        if ($family->canShow()) {
            $children = $family->children();

            if ($children->isNotEmpty()) {
                foreach ($children as $child) {
                    $out .= $this->getPersonLi($child, $generations - 1);
                }
            } else {
                $out .= '<li class="sb_desc_none">' . I18N::translate('No children') . '</li>';
            }
        }
        if ($out) {
            return '<ul>' . $out . '</ul>';
        }

        return '';
    }
888137
static function getGoogleClient($logger_name = null) {
        if (is_null($logger_name)) {
            $logger_name = "Google_Client at " . Util::getModuleId();
        }
        $client = new \Google_Client();
        $client->useApplicationDefaultCredentials();
        $client->setApplicationName(Util::getModuleId() . "@" . Util::getApplicationId());
        $client->setLogger(Logger::create($logger_name));
        if (Util::isDevServer()) {
            $http = self::getWindowsCompliantHttpClient();
            $client->setHttpClient($http);
        }
        return $client;
    }
408886
public function getMediaPlayerAttribute()
    {
        if (!in_array($this->attributes['type'], ['video', 'audio'])) {
            return null;
        }

        return html_raw(view('shortcodes.media_player', [
            'media' => (object) $this->toArray()
        ]));
    }
938056
public function getVideoByUrl(string $videoUrl): Video
	{
		$url = new Nette\Http\Url($videoUrl);

		if (stripos($url->host, 'youtu.be') !== false) {
			return $this->getVideo(trim($url->getPath(), '/'));
		}

		$videoId = $url->getQueryParameter('v');
		if (stripos($url->host, 'youtube.com') === false || $videoId === null) {
			throw new Nette\InvalidArgumentException('videoUrl must be valid youtube url.');
		}

		return $this->getVideo($videoId);
	}
484890
public static function getYoutubeEmbedUrl( $videoUrl )
    {
        $embedLink = '';
        $embedINI = eZINI::instance( 'embedtag.ini' );

        preg_match( self::YOUTUBE_VIDEOID_REGEXP, $videoUrl, $matches );
        if ( isset( $matches['videoId'] ) )
        {
            $embedLink = str_replace( '$$$VIDEO$$$', $matches['videoId'], $embedINI->variable( 'YoutubeSettings', 'EmbedLinkPattern' ) );
        }

        return array( 'result' => $embedLink );
    }
478668
protected function getGoogleSitemapToolUrl()
    {
        $url = $this->toolUrl . urlencode($this->xmlSiteUrl);
        if (!GeneralUtility::isValidUrl($url)) {
            return null;
        }

        return $url;
    }
1211667
public function parseVIdFromURL($youtube_url)
    {
        if (strpos($youtube_url, 'youtube.com')) {
            if (strpos($youtube_url, 'embed')) {
                $path = static::_parse_url_path($youtube_url);
                $vid = substr($path, 7);
                return $vid;
            } else {
                $params = static::_parse_url_query($youtube_url);
                return $params['v'];
            }
        } else if (strpos($youtube_url, 'youtu.be')) {
            $path = static::_parse_url_path($youtube_url);
            $vid = substr($path, 1);
            return $vid;
        } else {
            throw new \Exception('The supplied URL does not look like a Youtube URL');
        }
    }
473704
public URL getParent() {
        if (isField()) {
            return getCharacteristicURL();
        } else if (isCharacteristic()) {
            return getServiceURL();
        } else if (isService()) {
            return getDeviceURL();
        } else if (isDevice()) {
            return getAdapterURL();
        } else if (isAdapter()) {
            return getProtocolURL();
        } else {
            return null;
        }
    }
1094748
public function getPlaylistVideoFeedUrl()
    {
        if ($this->getMajorProtocolVersion() >= 2) {
            return $this->getContent()->getSrc();
        } else {
            return $this->getFeedLink(Zend_Gdata_YouTube::PLAYLIST_REL)->href;
        }
    }
823788
protected function getCreatedEntity(FamilyInterface $family, $reference)
    {
        if (!$this->hasCreatedEntity($family, $reference)) {
            return null;
        }

        return $this->createdEntities[$family->getCode()][$reference];
    }
347070
public function getMostViewedVideoFeed($location = null)
    {
        $standardFeedUri = self::STANDARD_MOST_VIEWED_URI;

        if ($this->getMajorProtocolVersion() == 2) {
            $standardFeedUri = self::STANDARD_MOST_VIEWED_URI_V2;
        }

        if ($location == null) {
            $uri = $standardFeedUri;
        } else if ($location instanceof Zend_Gdata_Query) {
            if ($location instanceof Zend_Gdata_YouTube_VideoQuery) {
                if (!isset($location->url)) {
                    $location->setFeedType('most viewed');
                }
            }
            $uri = $location->getQueryUrl($this->getMajorProtocolVersion());
        } else {
            $uri = $location;
        }
        return parent::getFeed($uri, 'Zend_Gdata_YouTube_VideoFeed');
    }
718122
public function getPreview()
    {
        $url = trim($this->value);
        if (!$this->display_video || !$url) {
            return false;
        }
        $obj = VideoLink::create()->setValue($url);
        if ($obj->iFrameURL) {
            return $obj->Iframe($this->display_video, $this->preview_height);
        }
    }