ISBX / apprtc-ios

A native iOS video chat app based on WebRTC
BSD 3-Clause "New" or "Revised" License
1.35k stars 413 forks source link

When I raise the phone (with like "raise to wake" gesture) the video either freezes or the camera is flipped #70

Open gierunio opened 7 years ago

gierunio commented 7 years ago

console log:


onVideoError: NSConcreteNotification 0x17425bc00 {name = AVCaptureSessionRuntimeErrorNotification; object = <AVCaptureSession: 0x174009550 [AVCaptureSessionPresetInputPriority]>
    <AVCaptureDeviceInput: 0x174223360 [Front Camera]> -> <AVCaptureVideoDataOutput: 0x1740342a0>; userInfo = {
    AVCaptureSessionErrorKey = "Error Domain=AVFoundationErrorDomain Code=-11819 \"Cannot Complete Action\" UserInfo={NSLocalizedDescription=Cannot Complete Action, NSLocalizedRecoverySuggestion=Try again later.}";
}}

WARNING: Renegotiation needed but unimplemented.
WARNING: Renegotiation needed but unimplemented.

onVideoError: NSConcreteNotification 0x1744430f0 {name = AVCaptureSessionRuntimeErrorNotification; object = <AVCaptureSession: 0x174009920 [AVCaptureSessionPreset640x480]>; userInfo = {
    AVCaptureSessionErrorKey = "Error Domain=AVFoundationErrorDomain Code=-11800 \"The operation could not be completed\" UserInfo={NSUnderlyingError=0x174442f10 {Error Domain=NSOSStatusErrorDomain Code=-12785 \"(null)\"}, NSLocalizedFailureReason=An unknown error occurred (-12785), NSLocalizedDescription=The operation could not be completed}";
}}
gierunio commented 7 years ago

I managed to fix the problem by removing ARDAppClient from observing UIDeviceOrientationDidChangeNotification (raising the device is considered as orientation change). It seems to work well without that.

vaiden commented 7 years ago

@gierunio - what an amazing GOTCHA. Thanks for the heads up.