I am trying to play a encypted hls content . The contents are chunked using a tool developed locally called chunker .
A catalogue having info about the contents is loaded on the device which wants to play the chunks and is shown as playlist of contents. The catalogue points to the manifest file of each content.
In live scenario, when the chunker is running and chunking the contents, the playback does not start on clicking the playlist, it does not even make a request to the url in d manifest for the decryption key. But the same happens as soon as chunker is stopped .
Exactly similar behaviour happens when trying to play the content using Safari on iPad too.
And now the interesting thing is, this issue doesn't happen with ios simulator or macos and playback is fine but only with iOS device it doesn't play when chunker is running.
Also clear hls content plays just fine on iPad, macos and simulator. No issues with clear content anywhere.
I used iOS 8.2 & 9 iPad and i used Avplayer as player.
Can anybody give me any clue on this ?
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
NSLog(@"Trying to play media ");
NSURL *mediaUrl = [[NSURL alloc]initWithString:[[self.arrMedialist objectAtIndex:indexPath.row]objectForKey:@"url"]];
// NSURL *mediaUrl = [[NSURL alloc]initWithString:@"http://10.237.166.59/ccad/hls.m3u8"];
AVPlayer *player = [[AVPlayer alloc]initWithURL:mediaUrl];
AVPlayerViewController *controller = [[AVPlayerViewController alloc]init];
controller.player = player;
controller.showsPlaybackControls = YES;
[self presentViewController:controller animated:YES completion:nil];
NSLog(@"playing media url %@ ", mediaUrl);
[player play];
}