com.google.api.services.youtube.model.ThumbnailDetails

Here are the examples of the java api class com.google.api.services.youtube.model.ThumbnailDetails 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;
}

2. YoutubeChannelDeserializer#setThumbnails()

View license
protected ThumbnailDetails setThumbnails(JsonNode node) {
    ThumbnailDetails details = new ThumbnailDetails();
    if (node == null) {
        return details;
    }
    details.setDefault(new Thumbnail().setUrl(node.get("default").get("url").asText()));
    details.setHigh(new Thumbnail().setUrl(node.get("high").get("url").asText()));
    details.setMedium(new Thumbnail().setUrl(node.get("medium").get("url").asText()));
    return details;
}