Exemplo n.º 1
0
 /**
  * Create a Youtube media
  *
  * @param string $url
  * @return array
  */
 public function create(string $url) : array
 {
     $config = $this->config;
     /* @service YoutubeDriver */
     $service = new YoutubeDriver(['key' => $config['api_key']]);
     $videoId = $service->parseVIdFromURL($url);
     $video = $service->getVideoInfo($videoId);
     return (array) $video;
 }
Exemplo n.º 2
0
 /**
  * @expectedException \Exception
  */
 public function testParseVIdException()
 {
     $vId = $this->youtube->parseVIdFromURL('http://www.facebook.com');
 }