src/services/VideoEmbedderService.php
public function getVideoId($url)
    {
        // looks like there are, now let's only do this for YouTube and Vimeo
        if($this->getInfo($url)->type == 'video' && ($this->isYouTube($url) || $this->isVimeo($url)))
        {
            if ($this->isYouTube($url))
            {
                return $this->getYouTubeId($url);
            }
            else if ($this->isVimeo($url))
            {
                return $this->getVimeoId($url);
            }
        }
        else
        {
            // return empty string
            return '';
        }
    }
public function getVideoId($url)
    {
        // looks like there are, now let's only do this for YouTube and Vimeo
        if($this->getInfo($url)->type == 'video' && ($this->isYouTube($url) || $this->isVimeo($url)))
        {
            if ($this->isYouTube($url))
            {
                return $this->getYouTubeId($url);
            }
            else if ($this->isVimeo($url))
            {
                return $this->getVimeoId($url);
            }
        }
        else
        {
            // return empty string
            return '';
        }
    }
public function getVideoId ( $ url ) { // looks like there are, now let's only do this for YouTube and Vimeo if ( $ this -> getInfo ( $ url ) -> type == 'video' && ( $ this -> isYouTube ( $ url ) || $ this -> isVimeo ( $ url ) ) ) { if ( $ this -> isYouTube ( $ url ) ) { return $ this -> getYouTubeId ( $ url ) ; } else if ( $ this -> isVimeo ( $ url ) ) { return $ this -> getVimeoId ( $ url ) ; } } else { // return empty string return '' ; } }
Take a url and returns only the video ID

@param string $url
@return string
Take a url and returns only the video ID