在另一个Flash或Adobe Air应用程序中嵌入流式.swf文件

时间:2010-09-24 05:30:00

标签: flex flash adobe air

我目前有一个网络摄像头,可以将视频流式传输为.swf(也可以作为动态JPEG ...),我希望能够将流嵌入Flash或Air项目中。创造自己。我能找到的唯一例子,需要将.swf保存为项目的资源;很明显,这对于直播来说是不合需要的。有没有关于如何解决这个问题的建议/教程/示例?

另一个选择是使用动态JPEG。我有一些生成的代码(如下所示),但遗憾的是,只有通过adobe air查看时才会显示第一个图像(如果我在HTML浏览器中查看它,图像会自动更新,有效显示流:

<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>

有什么建议吗?

谢谢和问候。

1 个答案:

答案 0 :(得分:1)

这不是你嵌入到项目中的东西。您可以通过网址拉取图片并在swf中显示一些幻灯片。你没有说过关于流的信息,Flash可能会或者可能无法播放它(它是flv吗?)

相关问题