honoru88 / google-glass-api

Automatically exported from code.google.com/p/google-glass-api
0 stars 0 forks source link

Animated GIF attached to Timeline does not animate #101

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
XE5 and XE6

Attach an animated gif to the timeline.  Depending on content type you get 
various outcomes but none of them properly show an animated gif in Glass.

You can get an animated GIF to display if you send it as HTML content.  It will 
animate and loop.

As an attachment these are the results based on Content Type:

image/jpeg - shows first frame of animated gif, and overlay message text

image/gif - shows overlay message text only, no image at all, just white text 
on black background

video/mp4 - just a black background (not surprising)

What I expect to happen is to see the animated gif animate and loop when 
attached, I suspect that "image/gif" is the correct content type, even though 
right now image/jpeg works the best.

Here is some sample Java code that reproduces the issue based on the quick 
start project:

        TimelineItem timelineItem = new TimelineItem();
        timelineItem.setText("");
        timelineItem.setNotification(new NotificationConfig().setLevel("DEFAULT"));
        // Attach animated GIF
        String contentType = req.getParameter("contentType");
        URL url = new URL("http://localhost:8888/static/images/animated.gif");
        contentType = "image/jpeg";
        byte[] b = ByteStreams.toByteArray(url.openStream());
        int i = b.length;
        InputStream temp = url.openStream();
        MirrorClient.insertTimelineItem(credential, timelineItem,
                contentType, temp);

Original issue reported on code.google.com by markwear...@gmail.com on 7 Jun 2013 at 6:52

GoogleCodeExporter commented 9 years ago
Animated GIFs... who knew they'd be such a challenge to support on modern html 
viewports?  ;)

Original comment by mimm...@google.com on 7 Jun 2013 at 5:28

GoogleCodeExporter commented 9 years ago
Ha ha, yes.  Low priority seems appropriate, especially since you can get a gif 
to animate if you send it in html.  

Original comment by markwear...@gmail.com on 9 Jun 2013 at 12:53

GoogleCodeExporter commented 9 years ago
@markwaersglass - We added some documentation about using Content-ID URIs to 
refer to attachments from within HTML payloads: 
https://developers.google.com/glass/v1/reference/timeline#attachments

This should allow you to render full screen gifs that are unique to (and 
attached to) the timeline item.

Original comment by mimm...@google.com on 10 Jun 2013 at 8:36

GoogleCodeExporter commented 9 years ago
This method works, thank you!

Original comment by markwear...@gmail.com on 11 Jun 2013 at 3:55

GoogleCodeExporter commented 9 years ago

Original comment by mimm...@google.com on 23 Jul 2013 at 1:33