Attaching video with video/vnd.google-glass.stream-url after Update XE6

前端 未结 2 1441
礼貌的吻别
礼貌的吻别 2021-01-16 04:19

Attaching video with the XE6 Google Glass Update is getting stuck. The code I\'m using is this:

    String videoUrl = \"http://www.youtube.com/watch?v=9bZkp7         


        
相关标签:
2条回答
  • 2021-01-16 05:01

    I think the issue is that you're trying to stream a YouTube page instead of stream the video from that page itself.

    Unfortunately, YouTube isn't very forthcoming about how to get the stream for videos that aren't yours. (And not even that helpful about videos that are.)

    0 讨论(0)
  • 2021-01-16 05:02

    (Updated with working curl command below)

    Based on the documentation here:

    https://developers.google.com/glass/timeline#attaching_video

    Streaming video to the timeline does not work like attaching a video to the timeline. Instead you are supposed to make a multipart post. Note that the content type of the actual post is going to look like this:

    Content-Type: multipart/related; boundary="mymultipartboundary"
    

    Then there will be two more content types, the parts of the multipart content, and the second of those will be the content type you specified.

    Some supporting information is here under "multipart upload":

    https://developers.google.com/glass/media-upload

    If you want a static video that has a cat, you can try this :)

    Sweetie-Cat-Video

    Here is a curl command I have tested and works, both with the static video link above, and with a NASA stream as below:

    curl --header "Authorization: Bearer your_token_here" -H "Content-Type: multipart/related; boundary=mymultipartboundary" --data-binary @input.txt https://www.googleapis.com
    /upload/mirror/v1/timeline
    

    Where input.txt looks like this:

    --mymultipartboundary
    Content-Type: application/json; charset=UTF-8
    
    { "text": "Sweetie" }
    --mymultipartboundary
    Content-Type: video/vnd.google-glass.stream-url
    
    http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8
    --mymultipartboundary--
    

    If I execute this command then go into the timeline, I see a loading card with the clapper board icon, then the first frame of the video with loading text. Then the stream starts. I do not see the text that I posted ("Sweetie"). If I return to the card later, in the nasa example, the stream starts from current time. In the case of the cat video (not a stream), it does not appear that the video is cached, it re-downloads it.

    0 讨论(0)
提交回复
热议问题