Do this function on the Internet to check some information, code as follows, in this code in Google Chrome version 46 is not a problem, in Firefox browser is OK, but in the high version of Google Browser is incompatible
<DivID= "Body"> < Sectionclass= "Featured"> <Divclass= "Content-wrapper"> <Hgroupclass= "title"> <H1>Welcome to Webcam</H1> <BR/> <H2>Compatible with Google Chrome 46 version, 48 version, Google Chrome high version, Firefox browser</H2> </Hgroup> </Div> </ Section> < Sectionclass= "Content-wrapper main-content clear-fix"> <H3>HTML5 in the local call camera is no problem, but deployed to the external network server, Google Chrome High version needs to change the HTTP to https;<BR/>HTTPS in IIS7.5 configuration tutorial: http://www.cnblogs.com/bobliu/archive/2012/08/05/2590694.html; </H3> <olclass= "Round"> <Liclass= "One"> <VideoID= "Video"width= " the"Height= "+"AutoPlay></Video> <inputtype= "button"value= "Photo Button"ID= "Snap" /> </Li> <Liclass= "both"> <CanvasID= "Canvas"width= " the"Height= "+"></Canvas> </Li> </ol> </ Section></Div>
<script type= "Text/javascript" >varCanvas = document.getElementById ("Canvas"); varContext = Canvas.getcontext ("2d"); varVideo = document.getElementById ("video"); $ (document). Ready (function() {videoobj= {Video:true }; varErrback =function(Error) {Console.log ("Video Capture Error:", Error.code); }; if(Navigator.getusermedia) {// StandardNavigator.getusermedia (Videoobj,function(stream) {video.src=Window.webkitURL.createObjectURL (stream); Video.play (); }, Errback); } Else if(Navigator.webkitgetusermedia) {//webkit-prefixedNavigator.webkitgetusermedia (Videoobj,function(stream) {video.src=window. Url.createobjecturl (stream); Video.play (); }, Errback); } Else if(Navigator.mozgetusermedia) {//firefox-prefixedNavigator.mozgetusermedia (Videoobj,function(stream) {Video.mozsrcobject=stream; Video.play (); }, Errback); }; $("#snap"). On ("click",function() {context.drawimage (video,0, 0, 640, 480); }); });</script>
Google Browser high version to be compatible with the above code, you must deploy the project to HTTPS
HTTPS and IIS7.5 deployment tutorial can see so classmate's blog: http://www.cnblogs.com/bobliu/archive/2012/08/05/2590694.html;
I did a test demo click to download
HTML5 call native webcam compatible with Google Chrome version, Google Chrome low version, Firefox browser