Às vezes, o replaykit startrecording nunca entra no manipulador de conclusão
Estou usando o kit de repetição para salvar um vídeo da minha tela durante o jogo, mas aleatoriamente na ocasiãostartRecordingWithMicrophoneEnabled
erecorder.stopRecordingWithHandler
nunca entra no manipulador de conclusão
não gera um erro, apenas roda e trava indefinidamente.
if recorder.available && recorder.microphoneEnabled {
recorder.startRecordingWithMicrophoneEnabled(true) { [unowned self] (error) in
if let unwrappedError = error {
print(unwrappedError.localizedDescription)
} else {
print("called")
self.manager.instructions.text = "Click to Start Game"
}
}
}
if recorder.available && recorder.microphoneEnabled {
print("initiating stop recording")
recorder.stopRecordingWithHandler { [unowned self] (RPPreviewViewController, error) in
print("in completion handler")
if let previewView = RPPreviewViewController {
print("will transition to gameplay video")
previewView.previewControllerDelegate = self
self.presentViewController(previewView, animated: true, completion: nil)
self.sessionHandler.session.stopRunning()
}
}
}