No, for a photo, media content with index 1 or 2 does not exist.
On Sep 24, 1:00 pm, Laran Evans <[email protected]> wrote:
> So, would get(2) give me the original photo in the case that the
> items's a photo?
>
> On Thu, Sep 24, 2009 at 3:58 PM, Detlev <[email protected]> wrote:
>
> > You can download the transcoded video streams (but not the original
> > video) in the same way you are currently downloading the photo byte,
> > by accessing media content 1 or 2 (0 is the photo/thumbnail).
> > photo.getMediaContents().get(1) is the low-quality 320x240 Flash video
> > codec (H263) and photo.getMediaContents().get(2) gives you the better
> > quality mpeg4 stream (H264).
>
> > On Sep 24, 12:41 pm, Laran Evans <[email protected]> wrote:
> >> 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
-~----------~----~----~----~------~----~------~--~---