遇到这个问题的场景:
使用腾讯直播拉流,拉流地址是http开头的,然后一直播放不出来,在控制台查看报了这个错误。
原因 :由于打开NSAllowsArbitraryLoads的同时也打开了Allow Arbitrary Loads in Web Content,Allow Arbitrary Loads in Web Content会把NSAllowsArbitraryLoads的权限覆盖掉
解决办法:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
//此处填你的域名
<key>liteavapp.qcloud.com</key>
<dict>
<key>NSExceptionAllowInsecureHTTPLoads</key>
<true/>
<key>NSExceptionRequiresForwardSecrecy</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
<key>NSAllowsArbitraryLoadsInWebContent</key>
<true/>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
如下图所示: