网站建设资讯

NEWS

网站建设资讯

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://cdweb.net/article/jgihi.html">http://cdweb.net/article/jgihi.html</a>
        </div>
    </div>
    <div class="other">
        <h3>其他资讯</h3>
        <ul>
            <li>
                    <a href="/article/shpedp.html">抖音探店类创意剧情(带你进入神秘的抖音探店世界)</a>
                </li><li>
                    <a href="/article/shpess.html">商会抖音代运营方法</a>
                </li><li>
                    <a href="/article/shpspj.html">滨州抖音小店代运营公司</a>
                </li><li>
                    <a href="/article/shpeop.html">抖音探店体验詹记美食文化</a>
                </li><li>
                    <a href="/article/shpecp.html">足疗店短视频营销有什么方法,足疗店怎么发广告</a>
                </li>        </ul>
    </div>
</div>
</div>
<footer>
    <div class="footop">
        <div class="wrap">
            <div class="bottomrpw">
                <div class="erp arp">
                    <dl>
                        <dt>ADDRESS</dt>
                        <dd class="address"> <i class="icon"></i> <span class="word">成都市青羊区锦天国际1号楼1002室</span> </dd>
                    </dl>
                </div>
                <div class="erp arp">
                    <dl>
                        <dt>TEL</dt>
                        <dd class="phonum"> <i class="icon"></i> <span class="word en"> <a href="tel:18980820575">18980820575</a> </span> </dd>
                    </dl>
                </div>
                <div class="erp crp">
                    <dl>
                        <dt>OTHER</dt>
                        <dd> <a class="word get-quote">获得报价与方案</a> </dd>
                        <dd> <a href="#" target="_blank" rel='nofollow' class="word" title="付款方式">付款方式</a> </dd>
                    </dl>
                </div>
                <div class="erp code-rp">
                    <dl>
                        <dt>Wechat</dt>
                        <dd class="code-wrap"> <span class="code"> <img src="/Public/Home/images/qr-code.jpg" alt="快上网微信公众号" /> </span> </dd>
                    </dl>
                </div>
            </div>
        </div>
    </div>
    <div class="footerbot">
        <div class="friendlinks">
            <div class="wrap">
                <ul class="rpl">
                    <li><a href="http://www.zywzjz.com/" title="成都公司注册代办" target="_blank">成都公司注册代办</a></li><li><a href="http://www.hzlinhua.com/" title="成都茶叶销售" target="_blank">成都茶叶销售</a></li><li><a href="http://www.cdxwcx.cn/tuoguan/ershu.html" title="成都枢纽中心" target="_blank">成都枢纽中心</a></li><li><a href="http://m.cdxwcx.com/wenjiang.html" title="温江电信机房" target="_blank">温江电信机房</a></li><li><a href="https://www.cdcxhl.com/" title="成都创新互联" target="_blank">成都创新互联</a></li><li><a href="http://www.ledyue.cn/" title="成都酒店服定制" target="_blank">成都酒店服定制</a></li><li><a href="https://www.cdcxhl.com/" title="成都网站建设" target="_blank">成都网站建设</a></li><li><a href="http://www.nzanhua.com/" title="四川雕琢时光" target="_blank">四川雕琢时光</a></li><li><a href="http://www.4006tel.net/mobile/" title="app制作" target="_blank">app制作</a></li><li><a href="http://m.cdcxhl.cn/dingzhi/
" title="定制网站" target="_blank">定制网站</a></li>                </ul>
            </div>
        </div>
        <div class="wrap">
            <div class="copyright"> <span class="en">©2007-2022</span> 成都快上网科技有限公司 <span class="en">ALL RIGHTS
                        RESERVED.</span> <a rel="nofollow" href="http://www.miitbeian.gov.cn" target="_blank">蜀ICP备19037934号</a> </div>
        </div>
    </div>
</footer>
<div class="fcwrap">
    <ul class="rpl clearfix">
        <li class="phone"> <a rel="nofollow" target="_blank" href="tel:18980820575"> <i class="icon"></i>
            <strong>18980820575</strong> </a> </li>
        <li class="qq"> <a rel="nofollow" target="_blank"
                           href="https://wpa.qq.com/msgrd?v=1&uin=244261566&site=qq&menu=yes"> <i class="icon"></i>
            <strong>244261566</strong> </a> </li>
        <li class="back-top"> <a href="javascript:void(0)" rel="nofollow" class="back-to-top"> <i class="icon"></i>
            <strong>回到顶部</strong> </a> </li>
    </ul>
</div>
<!--nav-->
<div class="n-Wrap">
    <div class="navBar visble show">
        <div class="barlogo">
            <a href="/" rel="nofollow">
                <img src="/Public/Home/images/logo1.png" alt="成都做网站" />
                <img src="/Public/Home/images/logo2.png" alt="成都网站设计" />
            </a>
        </div>
        <div class="bmenu">
            <i class="bar-top"><span></span></i>
            <i class="bar-cen"><span></span></i>
            <i class="bar-bom"><span></span></i>
            <i class="bar-left"><span></span></i>
            <i class="bar-right"><span></span></i>
        </div>
    </div>
    <section class="fixmenu">
        <div class="close-bar">
            <i class="bar-left"><span></span></i>
            <i class="bar-right"><span></span></i>
        </div>
        <nav class="smph">
            <ul>
                <li class="index-hrefs on"><a href="http://www.cdweb.net/"><font>首页</font></a></li>
                <li><a href="/about/" rel="nofollow"><font>关于快上网</font></a></li>
                <li><a href="/service/" rel="nofollow"><font>服务范围</font></a></li>
                <li><a href="/case/" rel="nofollow"><font>案例展示</font></a></li>
                <li><a href="/solve/" rel="nofollow"><font>解决方案</font></a></li>
                <li><a href="/news/" rel="nofollow"><font>建站资讯</font></a></li>
                <li><a href="/contact/" rel="nofollow"><font>联系快上网</font></a></li>
            </ul>
            <div class="pwrap">
                <span class="label">服务热线</span>
                <strong class="phone"><a href="tel:18980820575">18980820575</a></strong>
            </div>
        </nav>
    </section>
</div>
<!--end nav-->
<script src="/Public/Home/js/hotcss.js"></script>
<script type="text/javascript" src="/Public/Home/js/su_new.js"></script>
</body>
</html>
<script>
    $(".con 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>