Open surazdott opened 1 year ago
Cannot access protected property YouTube\Models\VideoDetails::$videoDetails
try { $downloadOptions = $youtube->getDownloadLinks("https://www.youtube.com/watch?v=aqz-KE-bpKQ"); if ($downloadOptions->getAllFormats()) { $info = $downloadOptions->getInfo(); echo $info->videoDetails['title']; } else { echo 'No links found'; } } catch (YouTubeException $e) { echo 'Something went wrong: ' . $e->getMessage(); }
When we need additional information and call $videoDetails property of video we get an error.
For solution i changed this code inside YouTube\Models\VideoDetails;
YouTube\Models\VideoDetails;
public $videoDetails = array(); public function __construct($videoDetails) { $this->videoDetails = $videoDetails; }
Cannot access protected property YouTube\Models\VideoDetails::$videoDetails
When we need additional information and call $videoDetails property of video we get an error.
For solution i changed this code inside
YouTube\Models\VideoDetails;