Learner\Services\Videos\Youtubee::getVideoDetail PHP Method

getVideoDetail() public method

Get the video detail.
public getVideoDetail ( integer $id ) : array
$id integer
return array
    public function getVideoDetail($id)
    {
        $this->setId($id);
        $data = $this->getData(str_replace('{key}', config('video.youtube_key'), $this->baseUrl));
        if (!$data) {
            throw new VideoNotFoundException("video_not_found");
        }
        return ['title' => $data->items[0]->snippet->title, 'description' => $data->items[0]->snippet->description, 'duration' => $this->formatDuration($data->items[0]->contentDetails->duration), 'upload_date' => $data->items[0]->snippet->publishedAt, 'thumbnail_url' => $data->items[0]->snippet->thumbnails->high->url];
    }