Skip to content

Instantly share code, notes, and snippets.

@kgardnr
Last active December 20, 2015 06:49
Show Gist options
  • Save kgardnr/1f2ce243f91cedaf9c92 to your computer and use it in GitHub Desktop.
Save kgardnr/1f2ce243f91cedaf9c92 to your computer and use it in GitHub Desktop.
Streaming video with Google Glass
$bundle_view = $app->view();
$bundle_view->appendData(array('total' => count($response['search']), 'video'=>$response['search'][0]));
$bundle_html = $app->view()->fetch('bundle_home.twig');
$new_timeline_item = new Google_TimelineItem();
$new_timeline_item->setHtml($bundle_html);
//$new_timeline_item->setBundleId($response['search'][0]['id']);
$new_timeline_item->isBundleCover = 'true';
$notification = new Google_NotificationConfig();
$notification->setLevel("DEFAULT");
$new_timeline_item->setNotification($notification);
$post_result = insert_timeline_item($mirror_service, $new_timeline_item, null, null);
error_log(print_r($post_result->getId(), true));
$new_timeline_item->setHtmlPages("<article><section> <video src='http://www.w3schools.com/html/movie.mp4' controls> </section></article>");
/**
foreach ($response['search'] as $video) {
$item = $video['videos'][0];
$v_item = new Google_MediaFileUpload('video/vnd.google-glass.stream-url', $item, true);
$params = array(
'data' => $v_item,
'mimeType' => 'video/*',
'uploadType' => 'resumable');
$mirror_service->timeline_attachments->insert($post_result->getId(), $params);
}
**/
insert_timeline_item($mirror_service, $new_timeline_item, null, null);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment