Just a heads up.
I am working on integrating webcams into guideme
Currently playing around with what can be done from javascript.
I have added com.github.sarxos.webcam into GuideMe and have been able to take a picture and display it fairly easily
See below
Code: Select all
<Page id="start">
<Text>
<div>Take a picture with the default webcam</div>
</Text>
<Image id="webcam/picture.jpg"/>
<Button target="start" onclick="takePicture()" >Take Picture</Button>
<javascript><![CDATA[
function takePicture() {
//add refernces to java File, ImageIO and Webcam libraries
var File = java.io.File;
var ImageIO = Packages.javax.imageio.ImageIO;
var Webcam = Packages.com.github.sarxos.webcam.Webcam;
var filename = guide.getDataDirectory() + guide.getMediaDirectory() + "/webcam/picture.jpg";
//get the default webcam
var cam = Webcam.getDefault();
//set it to the maximum resolution it supports
var viewSizes = cam.getViewSizes();
cam.setViewSize(viewSizes[viewSizes.length - 1]);
cam.open();
try {
//grab the current image from the webcam
var image = cam.getImage();
//save it to a file
ImageIO.write(image, "JPG", new File(filename));
}
finally {
cam.close();
cam.resetDriver();
}
}
]]></javascript>
</Page>
I will probably add a webcam node into the xml, which will display the output from the webcam as a live video.
Plus new custom button nodes to capture a single image, start recording video, stop recording video.
Probably some helper functions in Java script, so adding the Webcam nodes to the override object for page load, image capture, start / stop recording calls in the guide object.
These images / videos would the be available to display / play back in the tease.
I am also toying with the idea of adding the ability to upload them somewhere, but not sure whether this is
a) wise
b) where the best place to host them from is
I am open to suggestions on other functionality for web cam stuff and for your ideas on adding internet functionality.