Learner\Services\Videos\VideoTrait::getData PHP Method

getData() private method

Get the video data from serve.
private getData ( string $url ) : array
$url string
return array
    private function getData($url)
    {
        $json = null;
        if (extension_loaded('curl')) {
            $ch = curl_init(str_replace('{id}', $this->id, $url));
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_TIMEOUT, config('video.video_timeout'));
            $json = curl_exec($ch);
        } else {
            $json = @file_get_contents(str_replace('{id}', $this->id, $url));
        }
        if (!$json) {
            throw new VideoNotFoundException("video_not_found");
        }
        return $this->parseData($json);
    }