I have AVPlayer to play live stream URL which is working fine but when DAI Ad load, I got black screen in the player.
I have added notification AVPlayerItemNewAccessLogEntryNotification observer as below:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playerItemAccessLogEntry:) name:AVPlayerItemNewAccessLogEntryNotification object:player.currentItem];
When player goes to the black screen, I got the notification event:
-(void)playerItemAccessLogEntry:(NSNotification *)notification {
DLog(@"VideoWithAdsController:playerItemAccessLogEntry");
AVPlayerItemAccessLog *accessLog = [((AVPlayerItem *)notification.object) accessLog];
AVPlayerItemAccessLogEvent *lastEvent = accessLog.events.lastObject;
NSLog(@"The IP address of the server that was the source of the last delivered media segment. = %@",lastEvent.serverAddress);
NSLog(@"A count of changes to the property serverAddress = %ld",(long)lastEvent.numberOfServerAddressChanges);
}
It is printed in console as below:
The IP address of the server that was the source of the last delivered media segment. = (null)
A count of changes to the property serverAddress = -1
I have attached screenshot of black screen. Let me know what is solution.
Thanks in advance.