0

I'm using the GDK with XE16

I would like to save a video using MediaRecorder and then put it on the Timeline so I can let the user share the video to Gplus, YouTube or any contact. I am providing some additional information during the recording process as an overlay on the video preview.

I am able to save the videos into the /mnt/sdcard/Movies path. I am invoking the Intent.ACTION_MEDIA_SCANNER_SCAN_FILE to add the recorded video to the media database.

I have not been able to figure out how to add a share intent to on livecard. The previous API supported static cards, but those did not support video attachments; and the API is no longer available. I have also tried to use AccountManager and the com.google account in Glass to get an ouath token for the Mirror api to write direction via oauth2:https://www.googleapis.com/auth/glass.timeline. The authorization request shows up, but it is impossible for the user to accept the request.

I've considered sending the video file back to a proxy server that will then call mirror, but this seems like a big round trip for nothing.

I suppose I could send the credentials through this proxy, but this seems like a security nightmare.

John Fontaine
  • 1,019
  • 9
  • 14

1 Answers1

1

The difference between Static Cards and a Timeline Item were large enough that the team, apparently, removed Static Cards until they could make the two of them work much more similarly. What you're trying to do is a commonly requested, and it does make sense that both should work mostly the same way.

You're on the right track for how to handle this at the moment - use the Mirror API to get it into the timeline as a Timeline Item. As you've noticed, you can't go through the auth flow since the user is unable to authenticate through Glass directly.

While you're testing, you can code in an auth token and a refresh token to be provided to the library to do this. For production through MyGlass, take a look at the auth flow that is available at https://developers.google.com/glass/develop/gdk/authentication

Prisoner
  • 49,922
  • 7
  • 53
  • 105