// Create template ad data.
Image startImage = new Image();
startImage.setData(ImageUtils.getImageDataFromUrl("http://goo.gl/HJM3L"));
startImage.setType(MediaMediaType.IMAGE);
Video video = new Video();
video.setMediaId(videoMediaId);
video.setType(MediaMediaType.VIDEO);
templateAd.setTemplateElements(new TemplateElement[] {
new TemplateElement("adData", new TemplateElementField[] {
new TemplateElementField("startImage", TemplateElementFieldType.IMAGE,
null, startImage),