zoukankan      html  css  js  c++  java
  • 第26月第28天 avplayer cache

    1.urlsession https

    - (void)URLSession:(NSURLSession *)session
    didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge
     completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler
    {
       //AFNetworking中的处理方式
        NSURLSessionAuthChallengeDisposition disposition = NSURLSessionAuthChallengePerformDefaultHandling;
        __block NSURLCredential *credential = nil;  
        //判断服务器返回的证书是否是服务器信任的
        if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {
            credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust];
            /*disposition:如何处理证书
         NSURLSessionAuthChallengePerformDefaultHandling:默认方式处理
             NSURLSessionAuthChallengeUseCredential:使用指定的证书    NSURLSessionAuthChallengeCancelAuthenticationChallenge:取消请求
             */
            if (credential) {
                disposition = NSURLSessionAuthChallengeUseCredential;
            } else {
                disposition = NSURLSessionAuthChallengePerformDefaultHandling;
            }
        } else {
            disposition = NSURLSessionAuthChallengeCancelAuthenticationChallenge;
        }
        //安装证书
        if (completionHandler) {
            completionHandler(disposition, credential);
        }
    }

    https://www.jianshu.com/p/4b5d2d47833d

    2.avplayer cache

    https://github.com/XTShow/XTAudioPlayer/

    https://www.jianshu.com/p/c157476474f1

    https://github.com/newyjp/JPVideoPlayer

  • 相关阅读:
    检查SQL Server 2005的索引密度和碎片信息(转)
    数据库系统异常排查之DMV(转)
    sql server性能分析--执行sql次数和逻辑次数
    sql语句优化
    C#获取文件夹下的所有文件的文件名
    siebel学习笔记-应用/数据访问控制
    FlexPaper实现文档在线浏览(附源码)
    C# Process.WaitForExit()与死锁
    前端网站
    微信小程序
  • 原文地址:https://www.cnblogs.com/javastart/p/10030546.html
Copyright © 2011-2022 走看看