Click here to Skip to main content
15,890,882 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
hi
This is demo application of my document camera. but it works only in Internet Explore. I need to run that code in chrome. But when i try to open the camara via chrome browser, it does not working. can anyone help me to fix this please..

HTML
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">


<script language="JavaScript1.2">
       function Start_camera_onclick()
        {
        var str = captrue.bStartPlay(); 	
        }

         function Stop_onclick()
        {
  	var str=captrue.bStopPlay();
        }

	function SaveJPG_onclick()
	{
        var str=captrue.bSaveJPG("d:\\","JPG");
	}

	function ParaSet_onclick()
	{
		var str=captrue.displayVideoPara();
	}
        
        function AutoFocus_onclick_On()
        {
            
         captrue.vSetFocus(0, true);
           
        }
        
        function AutoFocus_onclick_Off()
        {
            
           captrue.vSetFocus(0, false);
           
        }
        
        function ZoomIn_onclick()
        {
            captrue.vZoomIn();
        }
        
        function ZoomOut_onclick()
        {
            captrue.vZoomOut();
        }
        
        function Set_Highest_Res_onclick()
        {
            capture.vSetResolution(7);
        }
</script>

</head>

<body>

<div style="text-align:center;" >
<object classid="clsid:454C18E2-8B7D-43C6-8C17-B1825B49D7DE" id="captrue"  width="480" height="360" ></object>
</div>

  <br/>
  <form method="POST" action="--WEBBOT-SELF--" name="form1">
  <input type="button" value="Main camera" name="StartBtn" onClick="Start_camera_onclick()">
 
  <input type="button" value="Stop" name="StopBtn" onClick="Stop_onclick()">
  <input type="button" value="JPG" name="SaveJPGBtn" onClick="SaveJPG_onclick()">
  
  <input type="button" value="Set parameter" name="ParaSet" onClick="ParaSet_onclick()">
  
  <input type="button" value="Auto focus On" name="autofocusOn" onClick="AutoFocus_onclick_On()">
  <input type="button" value="Auto focus Off" name="autofocusOff" onClick="AutoFocus_onclick_Off()">
  
  <input type="button" value="Zoom In" name="ZoomIn" onClick="ZoomIn_onclick()">
  <input type="button" value="Zoom Out" name="ZoomOut" onClick="ZoomOut_onclick()">
  
  <input type="button" value="Set resolution" name="set_Highest_Res" onClick="Set_Highest_Res_onclick()">
  
</form>

</body>
</html>
Posted
Comments
Richard MacCutchan 11-Jun-15 4:00am    
What does "not working" mean?
dilan.sarith 11-Jun-15 4:55am    
when i click main camera button in the page, it appears the video stream in IE but not in chrome
Simewu 15-Jun-15 0:13am    
It's difficult to understand what this is trying to do. I cant get it working in any browser. Looks like you are missing a lot of essential functions

captrue.bStartPlay();
captrue.bStopPlay();
captrue.bSaveJPG("d:\\", "JPG");
captrue.displayVideoPara();
captrue.vSetFocus(0, true);
captrue.vSetFocus(0, false);
captrue.vZoomIn();
captrue.vZoomOut();
captrue.vSetResolution(7);
PIEBALDconsult 15-Jun-15 23:44pm    
What's a "captrue" ?

1 solution

Try to set the JavaScript type to "text/javascript" instead of language attribute. See is this works.

<script type="text/javascript">
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900