Skip to content

Instantly share code, notes, and snippets.

@timothyclemans
Created July 5, 2014 03:37
Show Gist options
  • Save timothyclemans/f5523e9e93c10f8410df to your computer and use it in GitHub Desktop.
Save timothyclemans/f5523e9e93c10f8410df to your computer and use it in GitHub Desktop.
[wearscript] moverio camera preview
<html style="width:100%; height:100%; overflow:hidden">
<style>
body {
margin:0;
}
</style>
<body style="width:100%; height:100%; overflow:hidden; margin:0">
<img width="960" height="540" id="image" />
<script>
function main() {
if (WS.scriptVersion(1)) return;
WS.cameraOn(.1, 540, 960, function (x) {
document.getElementById('image').setAttribute('src', 'data:image/jpg;base64,' + x);
});
}
window.onload = main;
</script></body></html>
{"name":"Example"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment