WebCam widget

Hi Elvin,

One thing that I remembered right now was that the problem showing the capture button might be due the problem finding the path to image resource. The image resource couldn’t be found if the URL in the browser doesn’t end with ‘/’ symbol :frowning: thats stupid thing and I have to fix it asap.

So with following url doesn’t work
http://johannes.virtuallypreinstalled.com/WebCamForVaadin
but this one works
http://johannes.virtuallypreinstalled.com/WebCamForVaadin/

#johannes

Hi!

I finally had time to look the WebCamForVaadin add-on, and I noticed that there was a nasty bug in the path for the capturebutton image. Also the example code in the Directory was very badly outdated.

I updated the add-on and example code and I hope it will work now better! Please, let me know if there still exists some problems with it!

#johannes

Hello,

I just added the WebCam widget to my application but I get an error. However the online demo seems to be working fine.
This is my situation: In my application I create a modal window and put the widget and refresher as described in the vaadin directory. When a user clicks a certain button in my application this window pops… The modal window appears together with the webcam widget(which is not working)
Also an alert window appears with the following message:

Cannot call method ‘toString’ of undefined: fxwebcamforvaadinPID_SVAADIN_WEBCAM_PID name: fxwebcamforvaadinPID_SVAADIN_WEBCAM_PID

What am I doing wrong?

Hi,

This looks very interesting.

Is there any chance it might be possible to use this to implement a 1-to-1 video chat from within vaadin, any time soon?

This would be an awesome plug-in them !!

I also have the same problem, all I wanted was to take a picture.

Sorry for this long delay. Again :frowning:

This error seem to be that for some reason the StreamVariable couldn’t be serialized to String… Some suggestions that might help (fingers crossed)

  • Update to the latest Vaadin jar (6.6.5 or 6.6.6)
  • Make sure you have also new enough gwt libs in your build path (at least the version 2.3.0)
  • Update also the Vaadin Eclipse Plug-In (just in case)

#johannest

Hello, friends!
Really need help with this useful Addon!

I want to use WebCamForVaadin but in all the cases i tried, i got an JS runtime error with message like that:

"

Cannot convert ‘d’ to object: fxwebcamforvaadinPID_SVAADIN_WEBCAM_PID name: fxwebcamforvaadinPID_SVAADIN_WEBCAM_PID".

This message appears when flash-content is still loading… then after closing error-window, flash wakes up and camera began to work, and even Capture button works well…

I’m using last Vaadin 6.7.0 (but tried versions from 6.6.0), GWT 2.4.0(but tried with 2.3.0), IDE - NetBeans 7, also I’ve tried to build Add-On in my environment, but without any success(but may be i’m not very expirienced in add-on building)… and by the way, in the beginning of my experiments, variable that cannot be converted ( in error message) was not ‘d’ but ‘e’, and this is also very strange, as for me :wink:

Also i’d thoughts about rights-management for Flash… but even with saved permissions for host with “Allow” value… the same situation.

Web-camera is important part of my project and i would be very grateful for any help! Thank you in advance!

PS. Probably anyone could suggest another good way to access WebCamera from Vaadin? I discovered and tried to use JMF, but… WebCamForVaadin’s approach completely overwhelming!

I found a small amout of time to look this project.

I have now created an example Vaadin project (WebCamTest) that uses the WebCamForVaadin add-on. Could you please test whether the example project works for you?

If it works ok, feel free to use it as a basis of your own project. To be sure that project will be similar to mine I recommed you to use the Eclipse Java EE IDE for Web Developers and latest Vaadin Eclipse plug-in with it. And, please tell me if it doesn’t work…

The WebCamTest project is available for download from here
http://code.google.com/p/webcamforvaadin/source/browse/#svn%2Ftrunk%2FWebCamTest
or directly from svn
http://webcamforvaadin.googlecode.com/svn/trunk/WebCamTest/

Hi everyone!

Is there any way to remove the “white strip” from the top of destination photo?
It is very critical to capture the correct images in our application.

Perhaps you have some experience with solving this problem.

Thanks in advance.

Hi Vasiliy!

Thanks for pointing out this problem. It seem to be flash side problem which should be relative easily fixed. I’ll try to fix this asap.

#johannest

I made very quick fix for it (demo and svn is not yet updated only jar is). Could you please, test does it work now:
http://vaadin.com/directory#addon/webcamforvaadin

With best regards,
#johannest

Johannes, judging by our application everything works fine.

Is it possible to set WebCam Widget in order to act as a Red5 or Wowza client ?!

I am trying to get access to webcam/ipcam from a swf module resource using vaadin(theme resource),
but I’m not getting this approach to work as required. I need to access webcam.

Thanks in advance.

Answering my own question…

Yes. It is possible to use Red5 and Wowza Client using WebCamForVaadin. I had only to adjust mxml file in order to do that.
Although, I’ve acessed webcam without WebCamForVaadin add-on. It has required only to design a swf module, and build a Embedded Object point out to this module. Besides, it is necessary to setType to Embedded.TYPE_BROWSER and voilà.

Hi Paulo,

do have sample of what you did to get the stream working?

Like you I am trying to source the stream from a different camera.

Thank you.

Hi

I have already using this Web Cam application.
Now i want to store this captured image into my server side machine .
please tell me how i can do this task

I’ve never used this widget - but, as a quick look at the code, you can access the current picture as a StreamResource by WebCamForVaadin#getPicture(). The following is the sort of code that might work. Note I have not tried this, as I don’t have the add-on (nor, indeed, a webcam!)


    StreamResource pic = webcam.getPicture();
    if (pic != null) {
      try {
        BufferedInputStream in = new BufferedInputStream(pic.getStream().getStream());
        BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream("C:/temp/mypicture.jpg", false));

        byte[] buffer = new byte[32 * 1024]
;
        int len;
        while ((len = in.read(buffer)) > 0) {
          out.write(buffer, 0, len);
        }
        in.close();
        out.close();
      } catch (IOException e) {
        e.printStackTrace();
      }
    }

Cheers,

Charles

Hi,

Is there a possibility to using that widget (or similar one) with iPhone and iPad ?

Françoise

Hi Johannes

Is there some code samples of using this widget?