[EXTENSION] yii-jpegcam

Yii-jpegcam is a widget that allows you to display the picture from the webcam in your page, take a photo and save it on the server in JPEG format.

It wraps jpegcam and uses Flash + JavaScript.

Check the extension documentation page or try the live demo!

The project is also available on Github.

Thank you for the wonderful webcam utility. I am new to yii and learning to create new application.

I have downloaded and copied in to (app)/extensions dir and I want to use it from a module. I updated controller and I could see the form but not the webcam movie.

Please help me setting up correctly.

with warm regards

Sridhar dk

How to setup on xampp? I tried on xampp 1.7.7 but flash seems not found ;( I directly upload the demo-app to local xampp but not working either. could you help with this? any other settings need to be done?

cheers,

Daniel

Hi,

after more test, I found out that demo-app is working on linux server, but not on XAMPP. I downloaded sample from jpegcam directly and tested it on XAMPP and it works!

The problem on yii-jpegcam is only at localhost. Can you give some hints? This extension is very exciting, many things can be done based on this.

Cheers,

Daniel

Hi,

Found the solution. I changed the code EJpegcam.php




public function run() {

//        $base_dir = dirname(__FILE__);

//        $assets_dir = $base_dir . DIRECTORY_SEPARATOR . 'assets';

//        $assets_url = Yii::app()->getAssetManager()->publish($assets_dir) . DIRECTORY_SEPARATOR;


        $assets_path = Yii::getPathOfAlias('ext.jpegcam.assets');

        $assets_url = Yii::app()->assetManager->publish($assets_path);


...



It works now on XAMPP, but I got problem when I used the url manager, showScriptname = false. Anyone can help on this?

The demo-app is working fine, now. But my code is failed on the apiUrl setting.

Cheers,

Daniel

Hi everybody; the yii-jpegcam extension is looking for new mantainers. I’m not developing anymore. The code is on github anyway, so feel free to fork it!

If urlManager enabled on config, you can chage apiUrl value with createUrl method :


$this->beginWidget('application.extensions.jpegcam.EJpegcam', array(

            'apiUrl' =>  Yii::app()->urlManager->createUrl('multimedia/webcam/jpegcam.saveJpg'), //multimedia = module id, webcam = controller id

            'shutterSound' => false,

            'stealth' => true,

            'buttons' => array(

                'configure' => 'Configure',

                'takesnapshot' => 'Take Snapshot!',

                //'freeze' => 'Capture',

                //'upload' => 'Upload',

                //'reset' => 'Reset'

            ),

            'onBeforeSnap' => $onBeforeSnap,

            'completionHandler' => $completionHandler

        )); 



I hope it help you

Hi,

I dont know if it solve your problem, but I’m using Apache on a Windows Server, and it works only after I replace the constant DIRECTORY_SEPARATOR by “/” in the EJpegcam.php

Jardel

Who know, how use a custom name from the snapshot?

webcam.swf was not loading so I changed

// Correcting url to adapt to assets directory

$js2 = “webcam.swf_url = '$assets_url” . “webcam.swf’;\n”;

to

// Correcting url to adapt to assets directory

$js2 = “webcam.swf_url = '$assets_url” .DIRECTORY_SEPARATOR. “webcam.swf’;\n”;