zoukankan      html  css  js  c++  java
  • 摄像头(闪光灯)权限 的判断

       

     NSString * mediaType = AVMediaTypeVideo;  //相应的还有麦克风权限字符串等等

        AVAuthorizationStatus  authorizationStatus = [AVCaptureDevice authorizationStatusForMediaType:mediaType];

        if (authorizationStatus == AVAuthorizationStatusRestricted|| authorizationStatus == AVAuthorizationStatusDenied) {

            [self alertWithTitle:@"摄像头访问受阻" andMessage:@"请到设置中修改权限"];

        }else if (

    authorizationStatus ==

    AVAuthorizationStatusNotDetermined

    ) {

    //第一次打开,应用还没有授权询问

    ){

            WTLog(@"可以使用摄像头");

            //开启扫描回话

            [self scanSession];

        }

  • 相关阅读:
    Logstash
    收藏学习Linux好用的网站
    Elasticsearch
    Elasticsearch-head
    Kibana
    Metricbeat
    filebeat
    elelelleeleELK
    MySQL对库的操作
    【Django】URL控制器
  • 原文地址:https://www.cnblogs.com/handsomeBoys/p/5364293.html
Copyright © 2011-2022 走看看