我正在尝试从苹果示例直播中播放 HLS 流 URl .
我在 info.plist
中添加了 ATS 异常。
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key><true/>
</dict>
当 AVPlayer 开始准备播放时应用程序崩溃。除了以下异常(exception)。
2016-09-19 16:15:32.562 AVPlayer[4630:268295] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array'
*** First throw call stack:
........
libc++abi.dylib: terminating with uncaught exception of type NSException
最佳答案
检查您尝试从您的代码中加载的数组您正在尝试访问不存在的索引,键“NSAllowsArbitraryLoads”在您的情况下无关紧要。
关于ios - AVPlayer 不播放 HLS 流,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39571967/