I can use ios16 to display floating windows, but ios15 cannot. Why
@try { NSError *error = nil;
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback mode:AVAudioSessionModeMoviePlayback
options:AVAudioSessionCategoryOptionInterruptSpokenAudioAndMixWithOthers
error:&error];
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionOrientationBack error:&error];
[[AVAudioSession sharedInstance] setActive:YES error:&error];
} @catch ( NSException *exception ) { NSLog( @"AVAudioSession error" ); }
self.pipVC = [[AVPictureInPictureController alloc] initWithPlayerLayer:self.playerLayer];
self.pipVC.delegate = self;
[self.pipVC setValue:@1 forKey:@"controlsStyle"];
if ( ![self.pipVC isPictureInPictureActive] ) { [self.pipVC startPictureInPicture]; }