How to use Dynamic Webcam Plug-in
Dynamic Webcam Plug-in can be used in Gecko-based browsers including Firefox, Chrome, Safari & Opera on PC.
You can use the HTML EMBED as the following sample to invoke Dynamic Webcam Plug-in.
<html>
<head>
<title>Webcam Image Capture Application</title>
</head>
<body>
<p>This is a simple test page for the Dynamic Webcam plug-in.</p>
<embed
type="Application/DynamicWebcam-Plugin"
OnPreTransfer="OnPreTransferCallback"
OnPostTransfer="OnPostTransferCallback"
OnPreAllTransfers="OnPreAllTransfersCallback"
OnPostAllTransfers="OnPostAllTransfersCallback"
OnMouseClick="OnMouseClickCallback"
OnMouseMove="OnMouseMoveCallback"
OnMouseRightClick="OnMouseRightClickCallback"
OnMouseDoubleClick="OnMouseDoubleClickCallback"
OnTopImageInTheViewChanged="OnTopImageInTheViewChangedCallback"
OnImageAreaSelected="OnImageAreaSelectedCallback"
OnImageAreaDeSelected="OnImageAreaDeSelectedCallback"
id = "DynamicWebcam"
width="100"
height="100"
pluginspage="DynamicWebcam.msi">
</embed>
<input type="button" onclick="AcquireImage()" value="AcquireImage" >
<script>
function OnPreTransferCallback(){
// Add your code here
}
function OnPostTransferCallback(){
// Add your code here
}
function OnPreAllTransfersCallback(){
// Add your code here
}
function OnPostAllTransfersCallback(){
// Add your code here
}
function OnMouseClickCallback(sImageIndex){
// Add your code here
}
function OnMouseMoveCallback(sImageIndex){
// Add your code here
}
function OnMouseRightClickCallback(sImageIndex){
// Add your code here
}
function OnMouseDoubleClickCallback(sImageIndex){
// Add your code here
}
function OnTopImageInTheViewChangedCallback(sImageIndex){
// Add your code here
}
function OnImageAreaSelectedCallback(sImageIndex, left, top, right, bottom){
// Add your code here
}
function OnImageAreaDeSelectedCallback(sImageIndex){
// Add your code here
}
function AcquireImage(){
// scan image
var Webcam = document.getElementById("DynamicWebcam");
Webcam.IfShowUI = false;
Webcam.SetVideoContainer(0);
Webcam.AcquireImage();
}
</script>
</body>
</html>
Note:
-
The pluginspage is the relative URL of DynamicWebcam.msi for download. It only works for Firefox. For Chrome, Opera and Safari, etc., when the plug-in is not installed, you can show a download link on your page for the users to download DynamicWebcam.msi. For more info, please refer to the sample code installed with Dynamic Webcam SDK.
-
You must include the type attribute to specify the MIME type "Application/DynamicWebcam-Plugin" in an embed tag. If you do not, then there is no way for the browser to determine the media type and which plug-in to load.
-
After DynamicWebcam.msi is downloaded, you need to run it to install the plug-in.
-
About OnPreTransfer, OnPostTransfer, OnPreAllTransfers and OnPostAllTransfers events in the above sample code, please refer to 'Dynamic Webcam ActiveX' section of this documentation.
