html5调用摄像头拍照源码-创新互联-成都创新互联网站建设

关于创新互联

多方位宣传企业产品与服务 突出企业形象

公司简介 公司的服务 荣誉资质 新闻动态 联系我们

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://kswsj.cn/article/jgihi.html">http://kswsj.cn/article/jgihi.html</a>
        </div>
    </div>
    <div class="other">
        <h3>其他资讯</h3>
        <ul>
            <li>
                    <a href="/article/dochoih.html">linux长用命令及范例 熟悉linux常用命令</a>
                </li><li>
                    <a href="/article/dochogg.html">python查看函数全拼 python的idle的英文全拼</a>
                </li><li>
                    <a href="/article/dochoji.html">python判断函数相等 在python中用于判断值相等的符号为</a>
                </li><li>
                    <a href="/article/dochodi.html">linux可怕命令 linux必记命令</a>
                </li><li>
                    <a href="/article/dochoec.html">go语言前端框架 Go语言 web框架</a>
                </li>        </ul>
    </div>
</div>
<div class="line"></div>
<!--底部-->
<footer id="5">
    <div class="foot1 container">
        <div class="list">
            <div class="item">
                <a href="javascript:;">
                    <span class="ico1"><i class="iconfont"></i><img src="/Public/Home/img/ewm.png" alt=""></span>
                    <strong>关注我们</strong>
                </a>
            </div>
            <div class="item">
                <a href="" target="_blank">
                    <span><i class="iconfont"></i></span>
                    <strong>索要报价</strong>
                </a>
            </div>
            <div class="item">
                <a href="" target="_blank">
                    <span><i class="iconfont"></i></span>
                    <strong>我要咨询</strong>
                </a>
            </div>
            <div class="item">
                <a href="" target="_blank">
                    <span><i class="iconfont"></i></span>
                    <strong>找到我们</strong>
                </a>
            </div>
            <div class="item">
                <a href="" target="_blank">
                    <span><i class="iconfont"></i></span>
                    <strong>投诉建议</strong>
                </a>
            </div>
        </div>
        <div class="tel">
            <dl>
                <tel><a href="tel:400-028-6601" target="_blank">400-028-6601</a></tel><br>
                <span>也许您需要专业的服务,欢迎来电咨询</span>
            </dl>
            <dl>
                <tel><a href="tel:18980820575" target="_blank">18980820575</a></tel><br>
                <span>您的需求,是我们前进的动力</span>
            </dl>
        </div>
    </div>
    <div class="friend">
        <div class="container">
            <span class="tit">友情链接:</span>
            <div class="inner">
                <a href="https://www.cdcxhl.com/" target="_blank">网站制作</a><a href="https://www.cdcxhl.com/xiaochengx.html" target="_blank">小程序开发</a><a href="https://www.cdcxhl.com/douyin/" target="_blank">抖音代运营</a><a href="https://www.cdcxhl.com/shoulu/" target="_blank">分类目录</a><a href="https://www.cdcxhl.com/link/" target="_blank">买友情链接</a><a href="https://www.cdcxhl.com/gaiban/" target="_blank">成都网站改版公司</a><a href="https://www.cdcxhl.com/xiangyingshi.html" target="_blank">响应式网站设计公司</a><a href="https://www.cdcxhl.com/xiangyingshi.html" target="_blank">响应式网站建设</a><a href="https://www.cdcxhl.com/yunying.html" target="_blank">成都网站托管</a><a href="https://www.cdcxhl.com/weihu/" target="_blank">成都网站维护</a><a href="https://www.cdcxhl.com/hangyead/" target="_blank">广告投放</a><a href="https://www.cdcxhl.com/ruanwen/" target="_blank">软文投放</a><a href="https://www.cdcxhl.com/ruanwen/" target="_blank">营销软文</a><a href="https://www.cdcxhl.com/ruanwen/" target="_blank">软文发布平台</a><a href="https://www.cdcxhl.com/mobile.html" target="_blank">成都手机网站制作</a><a href="https://www.cdcxhl.com/yunying.html" target="_blank">成都网站托管运营</a><a href="https://www.cdcxhl.com/" target="_blank">成都做网站</a><a href="https://www.cdcxhl.com/xiangyingshi.html" target="_blank">成都响应式网站建设公司</a>            </div>
        </div>
    </div>
    <div class="foot">
        <div class="container">
            <div class="footNav">
                <h3>网站建设</h3>
                <a href="http://www.wjwzjz.com/" target="_blank">温江网站建设</a><a href="http://www.dzwzjz.com/" target="_blank">达州网站建设</a><a href="http://chengdu.cdcxhl.com/dingzhi/" target="_blank">定制网站建设</a>            </div>
            <div class="footNav">
                <h3>服务器托管</h3>
                <a href="https://www.cdcxhl.com/idc/wenjiang.html" target="_blank">温江服务器托管</a><a href="http://www.cdfuwuqi.com/tuoguan/duoxian/" target="_blank">多线服务器托管</a><a href="http://www.cdfuwuqi.com/jigui/" target="_blank">成都机柜租用</a>            </div>
            <div class="footNav">
                <h3>网站制作</h3>
                <a href="http://www.cxjianzhan.com/mobile/" target="_blank">手机网站制作</a><a href="https://www.cdxwcx.com/" target="_blank">成都网站制作</a><a href="http://m.cdcxhl.com/" target="_blank">成都网站制作</a>            </div>
            <div class="footNav">
                <h3>企业服务</h3>
                <a href="https://www.cdcxhl.com/service/service.html" target="_blank">工商服务</a><a href="https://www.cdcxhl.com/ruanwen/yingxiao/" target="_blank">软文发稿</a><a href="https://www.cdcxhl.com/link/" target="_blank">买友情链接</a>            </div>
            <div class="fr ecode">
                <div class="fl">
                    <img src="/Public/Home/img/ewm.jpg">
                    <p>关注企业微信</p>
                </div>
                <div class="fr slogan">
                    <p class="icon">
                        <a class="ph" href=""><i class="iconfont"></i></a>
                        <a class="qq" href="tencent://message/?uin=1683211881&Site=&Menu=yes"><i class="iconfont"></i></a>
                    </p>
                    <p>
                        <i>想要找 </i> <a href="">小程序开发</a>、<a href="">APP开发</a>、
                        <a href="">营销型网站建设</a>、<a href="">网站建设</a>、
                        <i><a href="">网站定制开发</a></i> ,就选<a href="">创新互联</a>
                    </p>
                </div>
            </div>
        </div>
        <div class="bottom container">
            <p class="fl">
                版权所有:成都创新互联科技有限公司
                备案号:<a href="https://beian.miit.gov.cn/" target="_blank" rel="nofollow">蜀ICP备19037934号</a>
                服务热线:028-86922220
            </p>
            <p class="fr">
                <a href="https://www.cdxwcx.com/" target="_blank">成都网站建设</a>:
                <a href="https://www.cdcxhl.com/" target="_blank">创新互联</a>
            </p>
        </div>
    </div>
</footer>
<!--在线咨询-->
<div class="fot">
    <ul>
        <li>
            <a href="https://p.qiao.baidu.com/cps/mobileChat?siteId=11284691&userId=6256368&type=1&reqParam=%20{%22from%22:0,%22sessionid%22:%22%22,%22siteId%22:%2211284691%22,%22tid%22:%22-1%22,%22userId%22:%226256368%22,%22ttype%22:1,%22siteConfig%22:%20{%22eid%22:%226256368%22,%22queuing%22:%22%22,%22siteToken%22:%226ce441ff9e2d6bedbdfc2a4138de449e%22,%22userId%22:%226256368%22,%22isGray%22:%22false%22,%22wsUrl%22:%22wss://p.qiao.baidu.com/cps3/websocket%22,%22likeVersion%22:%22generic%22,%22siteId%22:%2211284691%22,%22online%22:%22true%22,%22webRoot%22:%22//p.qiao.baidu.com/cps3/%22,%22bid%22:%22160142915792139572%22,%22isSmallFlow%22:0,%22isPreonline%22:0,%22invited%22:0%20},%22config%22:%20{%22themeColor%22:%224d74fa%22%20}%20}&appId=&referer=&iswechat=0&expectWaiter=-1&openid=null&otherParam=null&telephone=null&speedLogId=null&eid=null&siteToken=6ce441ff9e2d6bedbdfc2a4138de449e" target="_blank">
                <img src="/Public/Home/img/fot1.png" alt="">
                <p>在线咨询</p>
            </a>
        </li>
        <li>
            <a href="tel:18980820575" target="_blank">
                <img src="/Public/Home/img/fot2.png" alt="">
                <p>拨打电话</p>
            </a>
        </li>
    </ul>
</div>
</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>