[英]Jquery webcam plugin - error: Flash movie not yet registered
I want to capture image using jquery webcam plugin. 我想使用jquery网络摄像头插件捕获图像。 I am able to view the video through the player, but i am not able to capture images.
我可以通过播放器观看视频,但是无法捕获图像。 I get "error: Flash movie not yet registered" error.
我收到“错误:尚未注册Flash电影”错误。 What does this mean?
这是什么意思? On trying to call webcam.capture function i get an error which says, 'webcam.capture is not a function'.
尝试调用webcam.capture函数时出现错误,提示“ webcam.capture不是函数”。
Edit: I'm using this jQuery plugin: http://www.xarg.org/project/jquery-webcam-plugin/ 编辑:我正在使用此jQuery插件: http : //www.xarg.org/project/jquery-webcam-plugin/
The problem is solved in this link: https://github.com/infusion/jQuery-webcam/issues/14 . 该问题已通过以下链接解决: https : //github.com/infusion/jQuery-webcam/issues/14 。
The issue is because the test must be in a HTTP URL " http://....
" and not file URL " file://....
". 问题是因为测试必须在HTTP URL“
http://....
”中,而不是在文件URL“ file://....
”中。
Is the flash section visible when the page loads? 页面加载时是否可以看到Flash部分? I've found that this is a constant occurrence if the code is in a div that is not visible when the page loads.
我发现如果代码位于页面加载时不可见的div中,则这是经常发生的情况。 Easiest way to get around it is to only load the code when the div is visible:
解决它的最简单方法是仅在div可见时才加载代码:
$("#webcam-cap-div").click(function() {}
I'm sure this could be greatly simplified through detection if the div is :visible
or not ... Further, if you can post code how you use webcam.capture
that would also help 我确信可以通过检测div是否
:visible
来显着简化此操作:visible
...此外,如果您可以发布代码来使用webcam.capture
,这也将有所帮助
You would need to update your web.xml file with the following : 您将需要使用以下内容更新web.xml文件:
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.swf</url-pattern>
</servlet-mapping>
I know that this is an old question, but as I answered in this link , this is what I did to solve my problem: 我知道这是一个古老的问题,但是正如我在此链接中回答的那样,这是我为解决问题而做的:
If you REALLY need to use it locally (like i had to), you can change your Global Security Settings (of flash player) to trust files in a determined folder. 如果您确实需要在本地使用它(如我所必须),则可以更改(Flash Player的)“全局安全性设置”以信任确定文件夹中的文件。
With that configured, I was able to use the plugin locally. 配置完成后,我就可以在本地使用该插件了。
My problem was actually very silly. 我的问题实际上很愚蠢。 I did not have the webcam function wrapped inside jquery's ready event.
我没有在jquery的ready事件中包装网络摄像头功能。 Wrapping it inside worked for me
包裹在里面对我有用
$(document).ready(function() {
$("#camera").webcam({
// options
});
});
PS: Like nicolas said, make sure the url is HTTP
PS:就像nicolas所说的那样,确保URL是
HTTP
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.