1.urlsession https

  1. - (void)URLSession:(NSURLSession *)session
  2. didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge
  3. completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler
  4. {
  5. //AFNetworking中的处理方式
  6. NSURLSessionAuthChallengeDisposition disposition = NSURLSessionAuthChallengePerformDefaultHandling;
  7. __block NSURLCredential *credential = nil;
  8. //判断服务器返回的证书是否是服务器信任的
  9. if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {
  10. credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust];
  11. /*disposition:如何处理证书
  12. NSURLSessionAuthChallengePerformDefaultHandling:默认方式处理
  13. NSURLSessionAuthChallengeUseCredential:使用指定的证书 NSURLSessionAuthChallengeCancelAuthenticationChallenge:取消请求
  14. */
  15. if (credential) {
  16. disposition = NSURLSessionAuthChallengeUseCredential;
  17. } else {
  18. disposition = NSURLSessionAuthChallengePerformDefaultHandling;
  19. }
  20. } else {
  21. disposition = NSURLSessionAuthChallengeCancelAuthenticationChallenge;
  22. }
  23. //安装证书
  24. if (completionHandler) {
  25. completionHandler(disposition, credential);
  26. }
  27. }

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

第26月第28天 avplayer cache的更多相关文章

  1. 第27月第28天 iOS bundle

    1. 7.如果将自己打包的bundle给别人使用,别人在打包上传过程中可能会遇到错误提示如: ERROR ITMS-90171: "Invalid Bundle Structure - Th ...

  2. 第26月第30天 srt

    1. ffmpeg -i 0.mp4 -vf subtitles=0.srt 1.mp4 https://jingyan.baidu.com/article/c45ad29c73cef2051653e ...

  3. 第26月第29天 ffmpeg yasm

    1. brew install automake fdk-aac git lame libass libtool libvorbis libvpx \ opus sdl shtool texi2htm ...

  4. 第26月第26天 Domain=AVFoundationErrorDomain Code=-11850

    1. curl -voa http://119.29.108.104:8080/inweb01/kotlin.mp4 -H "Range:bytes=0-1" https://al ...

  5. 第26月第25天 ubuntu openjdk-8-jdk jretty

    1.ubuntu ============== sudo apt-get install openjdk-8-jdk https://blog.csdn.net/zhaohaiyitian88/art ...

  6. 第26月第23天 nsobject 单例 CFAbsoluteTimeGetCurrent

    1.nsobject 单例 sudo chmod 666 /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources/ ...

  7. 第26月第22天 iOS瘦身之armv7 armv7s arm64选用 iOS crash

    1.iOS瘦身之armv7 armv7s arm64选用 机器对指令集的支持是向下兼容的,因此armv7的指令集是可以运行在iphone5S以上的,只是效率没那么高而已~ 但是由于苹果要求必须支持ar ...

  8. 第26月第20天 springboot

    --------------------- 1.pom.xml中添加支持web的模块: <dependency> <groupId>org.springframework.bo ...

  9. 第26月第18天 mybatis_spring_mvc

    1. applicationContext.xml  配置文件里最主要的配置: <?xml version="1.0" encoding="utf-8"? ...

随机推荐

  1. ImageMagick: DrawImage(Image*,DrawInfo*) 绘制填充图片时卡住的原因分析

    今天傍晚在测试的时候无意发现有两个动画会卡住,正常情况下,20秒就完成的操作,突然卡住. CPU:95%+,经过30 - 50秒左右后,程序又能正常的向下执行,结果是对的. 这种情况不是每次都发生,有 ...

  2. Spring MVC 架构的java web工程如何添加登录过滤器

    发布到外网的web工程必须添加登录过滤器来阻挡一些非法的请求,即只有登录的用户才能对web工程进行请求,否则无论请求什么资源都需要调整到登录页面进行登录操作.这时就需要用到过滤器,其实非常简单,只需要 ...

  3. 使用bedtools提取vcf多个位置的变异(extract multi-region of genotypes by bedtools)

    1.下载安装bedtools: 2.生成bed文件:标准的bed文件格式如下: chr7 127471196 127472363 Pos1 0 + 127471196 127472363 255,0, ...

  4. HTML学习笔记Day10

    一.Form表单补充(收集用户信息) 1.button按钮(不进行提交) 1)语法1:<input type="button" value="按钮内容" ...

  5. Ajax和Json的介绍(一)

    Ajax简介: 优点: 1.Ajax是一种网页开发技术,异步JavaScript和XML;(这样叫的原因是是因为ajax传递数据是用json格式的,而json和xml又类似,都是以键值对,josn是& ...

  6. qml: 软件启用前插入广告;

    一般来说,免费软件或者部分商业软件在发布前都会放一些广告在软件上. 下面是我自己的方案(哪位有更好的方案,请告知,先谢): ...... ApplicationWindow{ visible: !ad ...

  7. qml: 自定义输入框

    import QtQuick 2.7 Rectangle { width:; height:; border.width:; border.color: "#E7E7E7" rad ...

  8. Session兑现的一级缓存

    快照机制:

  9. E2E测试框架

    1. 目前E2E测试工具有哪些? 项目 Web Star puppeteer Chromium (~170Mb Mac, ~282Mb Linux, ~280Mb Win) 41427 nightma ...

  10. java多线程api

    Object类相关api(相关的方法一定是当前线程在获取了对应的锁对象才能调用,否则会抛出异常) o.wait() :锁对象调用该方法使当前线程进入等待状态,并立刻释放锁对象,直到被其他线程唤醒进入等 ...