大橙子网站建设,新征程启航

为企业提供网站建设、域名注册、服务器等服务

html5调用摄像头拍照源码-创新互联

今天小编就为大家带来一篇关于html5调用摄像头拍照源码的文章。小编觉得挺实用的,为此分享给大家做个参考。一起跟随小编过来看看吧。

成都创新互联公司是一家专注于成都网站建设、成都网站制作与策划设计,双江网站建设哪家好?成都创新互联公司做网站,专注于网站建设十多年,网设计领域的专业建站公司;建站业务涵盖:双江等地区。双江做网站价格咨询:13518219792

代码:

<!DOCTYPE html>  
      
      
         HTML5调用摄像头实现拍照</ TITLE>  
        <meta charset =“utf-8”>  
        <meta name =“viewport”content =“width = device-width,initial-scale = 1”>  
    </ HEAD>  
    <BODY>  
    <video id =“video”autoplay =“”style ='width:640px; height:480px'> </ video>  
    <button id =“paizhao”>拍照</ button>   
    <canvas id =“canvas”width =“640”height =“480”> </ canvas>  
    <script type =“text / javascript”>  
        var video = document.getElementById(“video”);  
        var context = canvas.getContext(“2d”);  
        var errocb = function(){  
            console.log(“sth srong”);  
        }  
        如果(navigator.getUserMedia){  
            navigator.getUserMedia({ “视频”:真},函数(流){  
                video.src =流;  
                video.play();  
            },errocb);  
        } else if(navigator.webkitGetUserMedia){  
            navigator.webkitGetUserMedia({ “视频”:真},函数(流){  
                video.src = window.webkitURL.createObjectURL(流);  
                video.play();  
            },errocb);  
        }  
        的document.getElementById( “paizhao”)的addEventListener( “点击”,函数(){  
            context.drawImage(视频,0,0,640,480);  
        });  
    </ SCRIPT>  
    </ BODY>  
    </ HTML></pre><p>以上就是html5调用摄像头拍照的源码,代码详细清楚,如果在日常工作遇到这个问题,希望你能通过这篇文章解决问题。如果想了解更多相关内容,欢迎关注创新互联网站制作公司行业资讯频道!</p>                <br>
                文章标题:html5调用摄像头拍照源码-创新互联                <br>
                地址分享:<a href="http://dzwzjz.com/article/jgihi.html">http://dzwzjz.com/article/jgihi.html</a>
            </div>
        </div>
        <div class="othernews">
            <h3>其他资讯</h3>
            <div class="othernews_list">
                <ul>
                    <li>
                            <a href="/article/jdssoh.html">spring项目实现单元测试过程解析</a>
                        </li><li>
                            <a href="/article/jdsssi.html">JS一维和二维数组的创建和访问方法</a>
                        </li><li>
                            <a href="/article/jdssej.html">Linux如何使用root账号创建一个新的登录账号</a>
                        </li><li>
                            <a href="/article/jdssgs.html">Xcode9项目上传到GitHub教程</a>
                        </li><li>
                            <a href="/article/jdscij.html">核心技术:J2ME中RMS的使用解析(转)</a>
                        </li>                </ul>
            </div>
        </div>
    </div>
</div>

<div class="footer">
    <div class="footer_content">
        <div class="footer_content_top clear">
            <div class="content_top_share fl">
                <div><img src="/Public/Home/img/logo.png"></div>
                <div class="top_share_content">
                    <dd>分享至:</dd>
                    <dt class="bdsharebuttonbox clear" id="share">
                        <a href="#" class="bds_tsina iconfont fl" data-cmd="tsina" title="分享到新浪微博"></a>
                        <a href="#" class="bds_sqq iconfont fl" data-cmd="sqq" title="分享到QQ好友"></a>
                        <a href="#" class="bds_weixin iconfont fl" data-cmd="weixin" title="分享到微信"></a>
                        <a href="#" class="bds_weixin iconfont fl" data-cmd="tieba" title="分享到贴吧"></a>
                    </dt>
                    <script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
                </div>
            </div>
            <div class="content_top_left fl clear">
                <div class="top_left_list fl">
                    <dd><a href="/about/">关于我们</a></dd>
                    <dt>
                        <a href="/about/#gsjj">公司简介</a>
                        <a href="/about/#fzlc">发展历程</a>
                    </dt>
                </div>
                <div class="top_left_list fl">
                    <dd><a href="/service/">服务项目</a></dd>
                    <dt>
                        <a href="/service/">高端网站建设</a>
                        <a href="/miniprogram/">小程序开发</a>
                        <a href="/service/app.html">APP开发</a>
                        <a href="/service/yingxiao.html">网络营销</a>
                    </dt>
                </div>
                <div class="top_left_list fl">
                    <dd><a href="/jianzhan/">建站知识</a></dd>
                    <dt>
                        <a href="/jianzhan/">行业新闻</a>
                        <a href="/jianzhan/">建站学堂</a>
                        <a href="/jianzhan/">常见问题</a>
                    </dt>
                </div>
                <div class="top_left_list fl">
                    <dd><a href="/contact/">联系我们</a></dd>
                    <dt>
                        <a href="/contact/#lxwm">公司地址</a>
                        <a href="/contact/#rczp">人才招聘</a>
                    </dt>
                </div>
            </div>
            <div class="content_top_right addressR fr">
                <div class="top_right_title addressf_title">
                    <a href="javascript:;" class="on">成都</a>
                    <a href="javascript:;">达州</a>
                </div>
                <div class="top_right_content addressf">
                    <div class="right_content_li on">
                        <div class="right_content_list clear">
                            <dd class="fl iconfont"></dd>
                            <dt class="fl">电话:028-86922220</dt>
                        </div>
                        <div class="right_content_list clear">
                            <dd class="fl iconfont"></dd>
                            <dt class="fl">地址:成都市太升南路288号锦天国际A幢1002号</dt>
                        </div>
                    </div>
                    <div class="right_content_li">
                        <div class="right_content_list clear">
                            <dd class="fl iconfont"></dd>
                            <dt class="fl">电话:028-86922220</dt>
                        </div>
                        <div class="right_content_list clear">
                            <dd class="fl iconfont"></dd>
                            <dt class="fl">地址:达州市南岸区弹子石腾龙大道58号2栋21-6</dt>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="link">
            友情链接:
            <a href="http://chengdu.cdcxhl.com/xcx/" title="微信小程序开发" target="_blank">微信小程序开发</a>   <a href="https://www.cdcxhl.com/yunying.html" title="网站托管运营" target="_blank">网站托管运营</a>   <a href="http://www.cdkjz.cn/fangan/cosmetics/" title="化妆品企业网站建设方案" target="_blank">化妆品企业网站建设方案</a>   <a href="http://www.ybzwz.com/" title="宜宾网站建设" target="_blank">宜宾网站建设</a>   <a href="http://www.cdxwcx.cn/tuoguan/neijiang.html" title="四川内江电信机房" target="_blank">四川内江电信机房</a>   <a href="http://www.cdxwcx.cn/tuoguan/leshan.html" title="乐山托管服务器" target="_blank">乐山托管服务器</a>   <a href="http://chengdu.cdcxhl.cn/weihu/
" title="成都网站维护" target="_blank">成都网站维护</a>   <a href="https://www.cdxwcx.com/tuiguang/zhenghe.html" title="整合营销" target="_blank">整合营销</a>   <a href="http://www.shruijie.cn/" title="上海除甲醛" target="_blank">上海除甲醛</a>   <a href="http://chengdu.cdcxhl.cn/dingzhi/
" title="高端定制网站设计" target="_blank">高端定制网站设计</a>           </div>
    </div>
    <div class="footer_content_copyright clear">版权所有:青羊区大橙子信息咨询工作室
        <a href="http://beian.miit.gov.cn/" rel="nofollow" target="_blank">蜀ICP备2022028542号-14</a>
    </div>
</div>

<!--浮窗-->
<div class="FloatingWindow clear">
    <a href="tencent://message/?uin=1683211881&Site=&Menu=yes" class="FloatingWindow_list fr">
        <div class="FloatingWindow_list_title">
            <dd class="iconfont"></dd>
            <dt><span>在线</span>咨询</dt>
        </div>
    </a>
    <a href="javascript:;" class="FloatingWindow_list fr">
        <div class="FloatingWindow_list_title">
            <dd class="iconfont"></dd>
            <dt>服务热线</dt>
        </div>
        <div class="FloatingWindow_list_down fadeInRight animated">服务热线:028-86922220</div>
    </a>
    <a href="javascript:;" class="FloatingWindow_list fr STop">
        <div class="FloatingWindow_list_title">
            <dd class="iconfont"></dd>
            <dt>TOP</dt>
        </div>
    </a>
</div>

<script src="/Public/Home/js/jquery-1.8.3.min.js"></script>
<script src="/Public/Home/js/comm.js"></script>
<script src="/Public/Home/js/wow.js"></script>
<script src="/Public/Home/js/common.js"></script>
</body>
</html>
<script>
    $(".cont img").each(function(){
        var src = $(this).attr("src");    //获取图片地址
        var str=new RegExp("http");
        var result=str.test(src);
        if(result==false){
            var url = "https://www.cdcxhl.com"+src;    //绝对路径
            $(this).attr("src",url);
        }
    });
    window.onload=function(){
        document.oncontextmenu=function(){
            return false;
        }
    }
</script>