Reputation: 5365
I currently have a network camera that streams video as a .swf (and also as a motion JPEG as well...) and I want to be able to embed the stream inside of either a Flash or Air project that I'm creating myself. The only examples i've been able to find though, require the .swf to be saved as a resource of the project; clearly, this is undesirable for a live stream. Is there any suggestion/tutorial/example for how to work around this issue?
Another option is to utilize the motion JPEG. I have some generated code (shown below), but unfortunately only the first image is displayed when viewed via adobe air (if I were to view it in a HTML browser, the image would automatically update, effectively showing the stream:
<SCRIPT LANGUAGE="JavaScript">
function displayImage( )
{
// Set the BaseURL to the URL of your camera
var BaseURL = "foo.com/";
// DisplayWidth & DisplayHeight specifies the displayed width & height of the image.
// You may change these numbers, the effect will be a stretched or a shrunk image
var DisplayWidth = "320";
var DisplayHeight = "240";
// This is the path to the image generating file inside the camera itself
var File = "axis-cgi/jpg/image.cgi?resolution=320x240";
// No changes required below this point
var output = "";
theDate = new Date();
output = '<IMG SRC="';
output += BaseURL;
output += File;
output += '&dummy=' + theDate.getTime().toString(10);
output += '" HEIGHT="';
output += DisplayHeight;
output += '" WIDTH="';
output += DisplayWidth;
output += '" ALT="Camera Image">';
document.write(output);
}
</SCRIPT>
Any suggestions?
Thanks and Regards.
Upvotes: 2
Views: 982
Reputation: 9897
This is not the something you embed into project. You can pull pictures by url and show some slide show in your swf. You didn't say anything about the stream, Flash might or might not be able to play it (is it flv?)
Upvotes: 1