com.google.api.services.youtube.model.Thumbnail

Here are the examples of the java api class com.google.api.services.youtube.model.Thumbnail taken from open source projects.

1. YoutubeActivityUtil#buildActivityObject()

View license
/**
     * Given a video object, create the appropriate activity object with a valid image
     * (thumbnail) and video URL
     * @param video
     * @return Activity Object with Video URL and a thumbnail image
     */
private static ActivityObject buildActivityObject(Video video) {
    ActivityObject activityObject = new ActivityObject();
    ThumbnailDetails thumbnailDetails = video.getSnippet().getThumbnails();
    Thumbnail thumbnail = thumbnailDetails.getDefault();
    if (thumbnail != null) {
        Image image = new Image();
        image.setUrl(thumbnail.getUrl());
        image.setHeight(thumbnail.getHeight());
        image.setWidth(thumbnail.getWidth());
        activityObject.setImage(image);
    }
    activityObject.setUrl("https://www.youtube.com/watch?v=" + video.getId());
    activityObject.setObjectType("video");
    return activityObject;
}