[AVPictureInPictureController startPictureInPicture] didn't call delegate method in certain cases when failed

Originator:LvChaoShuai
Number:rdar://FB9983572 Date Originated:04-14-2022
Status:Open Resolved:
Product:iOS Product Version:15.3
Classification: Reproducible:YES
 
When `-[AVPictureInPictureController startPictureInPicture]` failed because of `[pictureInPictureController platformAdapter].status == 0`, the failure delegate method `- (void)pictureInPictureController:(AVPictureInPictureController *)pictureInPictureController 
failedToStartPictureInPictureWithError:(NSError *)error;` is not called. This is against what's documented [here](https://developer.apple.com/documentation/avkit/avpictureinpicturecontroller/1614687-startpictureinpicture?language=objc):
> If PiP fails, your delegate receives a call to the `pictureInPictureController:failedToStartPictureInPictureWithError:` method.

Expected: `- (void)pictureInPictureController:(AVPictureInPictureController *)pictureInPictureController 
failedToStartPictureInPictureWithError:(NSError *)error;` called
Actual: `- (void)pictureInPictureController:(AVPictureInPictureController *)pictureInPictureController 
failedToStartPictureInPictureWithError:(NSError *)error;` not called

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!