Trying to upload videos using V3 API from a form. When specifying the path to the video I'm using $videoPath = file_get_contents($_FILES["file"]["name"]);
I've also tried it with out the get_file_contents
and it tells me it can't find the file. I must be missing something, is there a way to upload directly from a form post without having to upload it to my server, than upload it to YouTube?
You dont allow to download video files from youtube dirrectly. At first check path for $_FILES["file"]["name"]
.
I recommend to use code if you need get information about video. After you may parse data and get images/video etc.
public function getParseVideo($code = null){
$key = "your code";
if(!empty($code)){
$data = file_get_contents("https://www.googleapis.com/youtube/v3/videos? key=".$key."&part=snippet&id=".$code);
echo $json = json_decode($data);
}
}