2016-09-19 85 views
1

我想玩蘋果樣本直播流HLS流URlAVPlayer不玩HLS流

我在info.plist中添加ATS異常。

<key>NSAppTransportSecurity</key> 
    <dict> 
     <key>NSAllowsArbitraryLoads</key><true/> 
    </dict> 

當AVPlayer開始準備播放應用程序崩潰時。以下例外。

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 

回答

0

檢查,你想從你的代碼,你試圖訪問不存在的索引加載陣列的關鍵「NSAllowsArbitraryLoads」你的情況並不重要。

+0

沒有 NSAppTransportSecurity NSAllowsArbitraryLoads 的Xcode顯示異常。 –

+0

好的,但你需要http的事實並不會影響你得到的錯誤,你會因爲你的任何數組而出錯,這不是因爲http連接。 –