Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add thumbnail upon upload #59

Open
ghost opened this issue Feb 26, 2016 · 0 comments
Open

How to add thumbnail upon upload #59

ghost opened this issue Feb 26, 2016 · 0 comments

Comments

@ghost
Copy link

ghost commented Feb 26, 2016

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);

StackOverflow: how-to-add-thumbnail-to-youtube-video-upon-insert

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
and others