How do I download videos from an album? When I download a photo that
happens to be a video I only get the first frame as a jpeg. Is there a
"get videos in album" method? Also, is there a way to tell when a
photoEntry is a video and not a simple photo?

I have something basically like this:

List<AlbumEntry> picasaAlbums = picasa.getAlbumsForUser
(googleEmailAccount);
for (AlbumEntry album : picasaAlbums) {
  List<PhotoEntry> photos = picasa.getPhotosInAlbum
(googleEmailAccount, album);
  for(PhotoEntry photo : photos) {
     byte[] photoData = downloadPhoto(photo);
  }
}

                public byte[] downloadPhoto(PhotoEntry photo)
                throws IOException {
                        MediaContent content = 
photo.getMediaContents().get(0);//.getUrl();

                        String sUrl = content.getUrl();
                        System.out.println("Downloading image from: "+sUrl);
                        URL url = new URL(sUrl);
                        InputStream inputStream = url.openStream();
                        ByteArrayOutputStream outputStream = new 
ByteArrayOutputStream();

                        int c;
                        try {
                                while((c=inputStream.read())!=-1) {
                                        outputStream.write(c);
                                }
                        } catch(Exception e) {
                                e.printStackTrace();
                        } finally {
                                try {
                                        inputStream.close();
                                } catch(Exception e2) {}
                        }
                        return outputStream.toByteArray();
                }

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Picasa Web Albums API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-picasa-data-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to