Saturday, December 26, 2009

Google Web Toolkit base captcha to avoid spam

Here is the link to GWT base captcha to avoid spam. You can download source code from the following link.

http://code.google.com/p/gwtcaptcha/

Friday, December 18, 2009

Setting security property checkPolicyFile for VideoDisplay component of Flex

SecurityError: Error #2122: Security sandbox violation: BitmapData.draw:

http://localhost:8080/Video.swf cannot access

http://www.helpexamples.com/flash/video/caption_video.flv. A policy file is required, but the checkPolicyFile flag was not set when this media was loaded. at flash.display::BitmapData/draw()

If you get above error what does that mean is Flash sandbox doesn't allow you to access resource from another server. If you put the video source file (FLV) on localhost or from server where application is loaded you are good.

To avoid this problem add following line into creationComplete() function or somewhere in your code before you access resource from third party server.

===================
Security.loadPolicyFile("http://www.websitename.com/crossdomain.xml");
===================

Above scenario is applicable to VideoDisplay of Flex because it doesn't come with checkPolicyFile property. But Image component has such property, which make it easy.

One thing like so much about flash/flex is active community with many informative blog post.

Adobe Flex Video and Webcam combo component on Google App Engine base

Video Display in Flex is pretty cool. You can attach webcam or video to display object. Once you have source you can take picture from either one. I have added following features to it

1. You can watch video/ live webcam in same player and capture picture. Developed using Flex 4 which uses Flash 10 to save picture to pc and editing without ever going to server.

2. Take/Retake picture from webcam or video and save it to local disk or upload to server. Flash 10 is used to save picture on local disk or upload to server.

3. Adjustable screen size for webcam picture. You can make it large of small according to your webcam resolution.

4. Full size screen in both mode (video/webcam) just like pressing F11 in browser.

5. Volume mute, video run time & slider to show video progress.

6. Run any video (flv file) from web (if you have URL & access) to capture picture and play.

7. Ability to run local FLV video files & take pictures to store on web or local disk.

8. It comes with cloud platform benefits since it is hosted on Google App Engine. GAE comes with lot of benefits & major one is app stays free unless you got more users, who is willing to pay per usage.

9. Once capture photo from video or live webcam save it to hard drive or email to friend.

Top of all it is FREE to use thanks to Google App Engine.

Please check out app