I ran the code on the simulator and
Downloading HLS streams is not supported on the simulator.
I realized this when I used the delegate method mentioned below.
- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error { }
And now, fighting all day, I found an Apple sample here and got a real cause of the problem.
source share