Joining video from video /vnd.google-glass.stream-url after XE6 update

Attaching video from the XE6 Google Glass Update is stuck. The code I use is as follows:

String videoUrl = "http://www.youtube.com/watch?v=9bZkp7q19f0"; if (videoUrl != null) { String contentType = "video/vnd.google-glass.stream-url"; InputStream is = new ByteArrayInputStream( videoUrl.getBytes( ) ); MirrorClient.insertTimelineItem(credential, timelineItem, contentType, is); } 

Not sure what I'm doing wrong, but the video is still trying to download and kills my battery ...

+1
source share
2 answers

I think the problem is that you are trying to transfer a YouTube page, instead of transferring videos from this page.

Unfortunately, YouTube is not very ready on how to get a stream for a video that does not belong to you. (And even this is not useful regarding videos.)

+3
source

(Updated using the curl working command below)

Based on the documentation here:

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

Streaming video on the timeline does not work like attaching video to the timeline. Instead, you should do a multi-page post. Note that the content type of the actual message will look like this:

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

Then there will be two more types of content, parts of multi-page content, and the second of them will be the specified type of content.

Some supporting information is here under "multipart upload":

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

If you want a static video with a cat, you can try the following :)

Sweetie-cat-video

Here is the curl command that I tested and works, both with reference to the static video above, and with the NASA stream, as shown 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 run this command, go to the timeline, I see a boot card with the clapper panel , then the first frame of the video with the text loading. Then the flow begins. I do not see the text that I published ("Sweetie"). If I return to the map later, in the nasa example, the flow will start from the current time. In the case of a cat video (not a stream), the video does not seem to be cached, it reloads it.

+2
source

Source: https://habr.com/ru/post/1490374/


All Articles