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

  • 相关阅读:
    common.js
    数据库_day05_查询语句及JDBC
    数据库_day04_基本的增删改查操作
    Java 抽象类、普通类、接口的区别
    java中ArrayList和LinkedList的区别
    数据库_day03_对数据库的基本操作
    java_day18_集合框架map和list
    java_day17_socket,tcp协议传输
    java_day16_读写锁,fork-join框架
    java_day15_线程,匿名内部类,线程安全
  • 原文地址:https://www.cnblogs.com/javastart/p/10030546.html
Copyright © 2011-2022 走看看