I want to hide these system controls on the iOS14 pip:
Any way I can do it?
You can do it with KVC:
Swift:
pipController.setValue(1, forKey: "requiresLinearPlayback")
Objective-C:
[self.pipController setValue:[NSNumber numberWithInt:1] forKey:@"requiresLinearPlayback"]
pipController.setValue(1, forKey: "controlsStyle")
[self.pipController setValue:[NSNumber numberWithInt:1] forKey:@"controlsStyle"];
Note: iOS16+ only
pipController.setValue(2, forKey: "controlsStyle")
[self.pipController setValue:[NSNumber numberWithInt:2] forKey:@"controlsStyle"];
For more detail about custom picture-in-picture, you can take a look at my repository here:
https://github.com/CaiWanFeng/PiP
You can hide at least the seek buttons via:
vc.requiresLinearPlayback = true
Where vc is your AVPictureInPictureController instance.
If you have already found a way how to hide the play button, please share it.
if #available(iOS 14.0, *) { //Hide the seekbar pipController?.requiresLinearPlayback = true } else { // Fallback on earlier versions } //Hide the play/pause controls pipController?.setValue(1, forKey: "controlsStyle")
Copyright © 2021 Jogjafile Inc.
You can do it with KVC:
1. Hide forward button and back button:
Swift:
Objective-C:
2. Hide progress bar, play button, forward button and back button:
Swift:
Objective-C:
3. Hide all the controls on the pip:
Note: iOS16+ only
Swift:
Objective-C:
For more detail about custom picture-in-picture, you can take a look at my repository here:
https://github.com/CaiWanFeng/PiP