You will probably find a package here that can help you
How to insert featured comments with Youtube API
I've searched and posted this question on other forums, but I didn't get an answer. Hope someone here has worked with the youtube API and can help me...
I'm inserting videos on youtube using API in PHP version. But I'm not able to include a highlight comment in the videos. In the youtube documentation the example is in json , and as I'm doing it in php it just doesn't work.
See part of my code is like this:
// Create a snippet with title, description, tags and category ID
// Create an asset resource and set its snippet metadata and type.
// This example sets the video's title, description, keyword tags, and
// video category.
$snippet = new Google_Service_YouTube_VideoSnippet();
$snippet->setTitle("Cats are cute #".$filme['Data ID']);
$snippet->setDescription($filme['titulo']);
$snippet->setTags('cats','cutecats','cute');
// Numeric video category. See
// https://developers.google.com/youtube/v3/docs/videoCategories/list
$snippet->setCategoryId("19");
// Set the video's status to "public". Valid statuses are "public",
// "private" and "unlisted".
$status = new Google_Service_YouTube_VideoStatus();
$status->privacyStatus = "public";
// Associate the snippet and status objects with a new video resource.
$video = new Google_Service_YouTube_Video();
$video->setSnippet($snippet);
$video->setStatus($status);
And the youtube suggestion to include comments using the API is this:
{
"snippet": {
"channelId": "UC_x5XG1OV2P6uZZ5FSM9Ttw",
"topLevelComment": {
"snippet": {
"textOriginal": "This video is awesome!"
}
},
"videoId": "MILSirUni5E"
}
}
I tried like this and it didn't work: $snippet->textOriginal('My comment');
How can I submit a featured comment using youtube API in php?
Please or to participate in this conversation.