My question is, should I use the YouTube API to load the a video that I've recorded from glass and sent to my server as an attachment to a notification? Or, is there a mirror-api call that I should use instead?
For instance, the URL for the video that I am receiving looks like this: http://redirector.googlevideo.com/videoplayback?id=875f7e1335214880&itag=22&source=picasa&cmo=sensitive_content%3Dyes&ip=0.0.0.0&ipbits=0&expire=1384018362&sparams=id,itag,source,ip,ipbits,expire&signature=AB8FC431423D6C86024A36F170ECF20C6F02223C.3FA395F9092F2EE5D6B14ACF49A4C18725A8846B&key=lh1
I did check out this answer which is similiar: Displaying Video on Webpage from Google Glass, but wasn't sure if actually should use the YouTube API. If I should, could someone could point me in the right direction in terms of which calls I should investigate?
Thanks!
Quick Update to add more context, so if I record a 10 sec video and share to my server via a custom contact card, I immediately get the following (this is my own debugging output via error logs):
[error] Error Downloading Attachment - HTTP ResponseCode:404
[error] ContentUrl:
[error] ContentType: video/mp4
[error] id ps:5933350025312253298
[error] IsProcessing: 1
So, this totally makes sense as the video is still processing. Now, if I wait a couple minutes and re-share the video with my server, I get the following:
[error] Error Downloading Attachment - HTTP ResponseCode:302
[error] ContentUrl: http://redirector.googlevideo.com/videoplayback?id=e0d5f76ca1fff29a&itag=22&source=picasa&cmo=sensitive_content%3Dyes&ip=0.0.0.0&ipbits=0&expire=1384058057&sparams=id,itag,source,ip,ipbits,expire&signature=CD41362EC3D3DDCD9EA3A63003B4C1A1F95D52C.BAE1608B827661FD47FC8D68DCBCE32F683A013D&key=lh1
[error] ContentType: video/mp4
[error] id ps:5933350025312253298
[error] IsProcessing: 0
To contrast, Image attachments always work, and look like so:
[error] Downloading Attachment - HTTP ResponseCode:200
[error] ContentUrl: https://www.googleapis.com/mirror/v1/timeline/7f13b01d-ee26-4b02-b6c3-7f885a452fc9/attachments/ps:5933353306000857698?alt=media
[error] ContentType: image/jpeg
[error] id ps:5933353306000857698
[error] IsProcessing: 0
So that's the rub. I can't figure out a way to access the video data, partly because it's a redirect that (seems to??) require some sort auth exchange to handle, and I can't figure out which API to use to help me do that.
So, going back to my question... is there a suggested way for me to handle the redirector url to either download the video to my server, OR, even just keep it hosted where it is, but wrap a youtube'esque player around it like the G+ backup cloud player? My intent is that I make the video publicly viewable.
Thanks! Update: here is a gist of the code I'm using. I just started out with the sample PHP quickstart that the Glass Team provided:
You should use the Google API client to download attachment URLs, which will handle authorization and any redirects for you. Please see the examples provided in the Timeline.attachments.get
documentation, for whichever language you're coding in.