# SiteCam ActiveX Control The SiteCam ActiveX control provides the ability to show or record video streams by means of a web cam. Members Table The following table lists the members provided by the SiteCam ActiveX control.
Members
Properties | Description
CanCaptureAudio | If audio hardware is available.
CanCaptureVideo | If video hardware is available.
CaptureAudio | If next capture is to contain an audio stream.
CaptureVideo | If next capture is to contain a video stream.
IsImageMailAllowed | If sending image mails is allowed.
IsSiteCamEnabled | If the Webcam plugin is enabled.
IsVideoMailAllowed | If sending video mails is allowed.
IsVoiceMailAllowed | If sending voice mails is allowed.
LastImageFile | Path including the file name of the last saved image file.
LastVideoFile | Path including the file name of the last saved video file.
MaxSecondsAudio | Maximum length of audio to be recorded.
MaxSecondsVideo | Maximum length of video to be recorded.
Progress | Progress of the current action.
ProgressMax | Maximum progress of the current action.
Status | Status of the current action.
Window | Window handle of the control.
Methods | Description
Capture | Starts recording.
Compress | Compresses and saves the recorded video.
DeleteCreatedFiles | Deletes all video and image files.
PlayFile | Plays the last recorded video.
Preview | Starts the video streaming.
Snapshot | Captures and saves a single image.
Stop | Stops the current action.
Events | Description
OnError | Fires when an error occurres.
OnProgressChange | Fires when the progress changes.
OnSnapshot | Fires when a snapshot has been taken.
OnStatusChange | Fires when the status changes.
Remarks This ActiveX control is available in the form of scripts that can be used in combination with SiteKiosk. Use the SiteCam control to show or record video streams or single images. To initialize the ActiveX control use the OBJECT tag and, in particular, the classID to identify the control. CLSID 54632F4A-055A-44C1-B1E6-EDB62AC2AC3E Examples The following example shows the functionality of the SiteCam ActiveX Control.
    <html>
    <body>
    <table border="0" bgcolor="#ebebeb" width="600" cellspacing="5"
    cellpadding="5" style="font-family:verdana;font-size:8pt;"
    align="center">
    <tr><td bgcolor="f8f8f8">
    The Webcam [Plug-In] provides functions to use a webcam. Click "preview"
    to start the streaming, "capture" to start recording the
    stream, "compress" to save a recorded stream, "play" to play
    the last recorded stream, "snapshot" to take and save a single
    picture or "stop" to stop all actions.
    </td></tr>
    <tr><td style="font-family:verdana;font-size:8pt;">
    <pre>
    <object classid='clsid:54632F4A-055A-44C1-B1E6-EDB62AC2AC3E'
    id='webcam' border='0' width='320' height='240' style='margin:5px;'>
    </object>
    <br>
    <span id='cst' style='position:relative;top:5px;'>Status: -</span>
    <span id='id_camprogress'>Progress: -</span>
    <br>
    <span id='id_camlastimage'>Last image: -</span>
    <span id='id_camlastvideo'>Last video: -</span>
    <SCRIPT TYPE="text/javascript">
    window.external.InitScriptInterface();
    function webcam::OnStatusChange()
    {
       switch (webcam.Status)
       {
          case 0 : cst.innerHTML = "Status: stopped";break;
          case 1 : cst.innerHTML = "Status: initializing";break;
          case 2 : cst.innerHTML = "Status: preview started";break;
          case 3 : cst.innerHTML = "Status: capture started";break;
          case 4 : cst.innerHTML = "Status: playback started";break;
          case 5 : cst.innerHTML = "Status: compressing";break;
       }
       if (webcam.LastVideoFile == "") camlvf = "-";
       else camlvf = webcam.LastVideoFile;
       id_camlastvideo.innerHTML = "Last video: " + camlvf;
    }
    function webcam::OnProgressChange(pr, prmax)
    {
       id_camprogress.innerHTML = pr + " / " + prmax;
    }
    function webcam::OnSnapshot(filename)
    {
       camlif = filename;
       id_camlastimage.innerHTML = "Last image: " + camlif;
    }
    function webcam::OnError(errorcode)
    {
       switch (errorcode)
       {
          case 1 : alert("Error : device lost");break;
          case 2 : alert("Error : init failed");break;
       }
    }
    function delfiles()
    {
       webcam.DeleteCreatedFiles();
       cst.innerHTML = "Status: files deleted";
    }
    function camaction(camactionid)
    {
       if (webcam.IsSiteCamEnabled)
       {
          switch (camactionid)
          {
             case 1 : webcam.Preview();break;
             case 2 : webcam.Capture();break;
             case 3 : webcam.Snapshot();break;
             case 4 : webcam.Compress();break;
             case 5 : webcam.Stop();break;
             case 6 : webcam.PlayFile();break;
             case 7 : delfiles();break;
          }
       } else alert("The Webcam plugin has not been configured");
    }
    if (webcam.IsSiteCamEnabled)
    {
       window.setTimeout("camaction(1)", 1500);
    }
    else
    {
       cst.innerHTML = "Status: The Webcam plugin has not been configured";
    }
    </SCRIPT>
    </pre>
    </td></tr>
    </table>
    <br><br>
    <div align="center">
    <a href="javascript:camaction(1)">Preview</a>&nbsp;
    <a href="javascript:camaction(2)">Capture</a>&nbsp;
    <a href="javascript:camaction(4)">Compress</a>&nbsp;
    <a href="javascript:camaction(6)">Play</a>&nbsp;
    <a href="javascript:camaction(3)">Snapshot</a>&nbsp;
    <a href="javascript:camaction(5)">Stop</a>&nbsp;
    <a href="javascript:camaction(7)">Delete created files</a>
    </div>
    </body>
    </html>
Applies to SiteKiosk v5.0 (and later versions). Back to top