AVPictureInPictureController crashes during initialization

19 views Asked by At

I have used AVPictureInPictureController in my project for a long time. However, I started to get a few crashes every day recently from firebase, and I don't think it provides too much information.

My code snippets:

self.myPlayerLayer = [AVSampleBufferDisplayLayer layer];

- (void)setupPictureInPictureController {
    AVPictureInPictureControllerContentSource *source = [[AVPictureInPictureControllerContentSource alloc] initWithSampleBufferDisplayLayer:self.myPlayerLayer] playbackDelegate:self];
    self.pipController = [[AVPictureInPictureController alloc] initWithContentSource:source];  // <- Crash at this line
    self.pipController.delegate = self;
    self.pipController.canStartPictureInPictureAutomaticallyFromInline = YES;
    [self.pipController setValue:[NSNumber numberWithInt:1] forKey:@"controlsStyle"];
}

Firebase shows the crash happens at self.pipController = [[AVPictureInPictureController alloc] initWithContentSource:source], and I can't get any clues from the trace.

enter image description here

Does anyone have the same issue?

0

There are 0 answers