1 year ago

#276027

test-img

Ross Stepaniak

iOS ReplayKit locks screen rotation and prevents auto-roatation of iPhone/iPad

I experience a weird issue when working with Replay Kit. Specifically, when I call startCapture, the app no longer responds to rotations. It locks the current orientation

RPScreenRecorder.shared().startCapture(handler: { [weak self] (sampleBuffer, sampleBufferType, error) in
        guard sampleBufferType == .video else { return }
        ...
        // Processing the buffer frame here   
}

I defined all the orientation in .plist as usual:

<key>UISupportedInterfaceOrientations~ipad</key>
<array>
    <string>UIInterfaceOrientationPortrait</string>
    <string>UIInterfaceOrientationPortraitUpsideDown</string>
    <string>UIInterfaceOrientationLandscapeLeft</string>
    <string>UIInterfaceOrientationLandscapeRight</string>
</array>

After the ReplayKit is stopped, app starts rotating again fine. iOS version seems has nothing to do with that. Tried on 14, 15.

Any ideas why that happens? Thanks

ios

swift

screen-rotation

replaykit

0 Answers

Your Answer

Accepted video resources