You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The class Google_Service_YouTube_VideoSnippet has a method setThumbnails that takes as a parameter an instance of Google_Service_YouTube_ThumbnailDetails which has two interesting methods called setDefault and setStandard which takes in parameter an instance of Google_Service_YouTube_Thumbnail which itself has a method called setUrl. This is the method I use to set the thumbnail url. I've also set the width and the height just in case, making sure the minimum width is 640.
However, upon upload the thumbnail I chose is not set. Why? What am I doing wrong?
( I want to know if it's possible to set the thumbnail before try this thumbnails/set and sending a second request.)
$thumbnail_service = new \Google_Service_YouTube_Thumbnail();
$thumbnail_details = new \Google_Service_YouTube_ThumbnailDetails();
$thumbnail_service->setUrl($thumbnail_url);
$thumbnail_details->setDefault($thumbnail_service);
$snippet = new \Google_Service_YouTube_VideoSnippet();
/*
Other video info added to snippet
*/
$snippet->setThumbnails($thumbnail_details);
The class
Google_Service_YouTube_VideoSnippet
has a methodsetThumbnails
that takes as a parameter an instance ofGoogle_Service_YouTube_ThumbnailDetails
which has two interesting methods calledsetDefault
andsetStandard
which takes in parameter an instance ofGoogle_Service_YouTube_Thumbnail
which itself has a method calledsetUrl
. This is the method I use to set the thumbnail url. I've also set the width and the height just in case, making sure the minimum width is 640.However, upon upload the thumbnail I chose is not set. Why? What am I doing wrong?
( I want to know if it's possible to set the thumbnail before try this thumbnails/set and sending a second request.)
StackOverflow: how-to-add-thumbnail-to-youtube-video-upon-insert
The text was updated successfully, but these errors were encountered: