public static function fetchData($url, $fields = array()) { $id = Video_Fetcher::extractIDFromURL($url); $channel = Video_Fetcher::extractChanneldFromURL($url); switch ($channel) { case 'youtube': return Video_Fetcher::fetchYoutubeData($id, $fields); case 'vimeo': return Video_Fetcher::fetchVimeoData($id, $fields); default: return null; } }