Development of Video Calls in Mobile Application
Video call — not just WebRTC connection. This is camera and microphone management, lifecycle at system level, handling interruptions (incoming call, notification, screen lock), proper background work and low battery. Each of these details — separate task with non-trivial solutions on iOS and Android.
Transport Choice: WebRTC vs Ready SDKs
Pure WebRTC — RTCPeerConnection, RTCSessionDescription, ICE/STUN/TURN servers, getUserMedia, signaling via WebSocket. Full implementation from scratch takes 3–6 weeks only on transport layer, without UI.
Most projects choose SDK over WebRTC: Twilio Video, Daily.co, 100ms, Livekit or Agora. They handle ICE negotiation, codec negotiation (VP8/VP9/H.264/AV1), adaptive bitrate, and provide ready native wrappers for iOS and Android.
If customization requirements low and launch speed important — choose SDK. If full control over codec, encryption or minimal binary weight needed — pure WebRTC via GoogleWebRTC (iOS) or org.webrtc (Android).
Native iOS Implementation: AVCaptureSession and CallKit
Video from camera captured via AVCaptureSession. Proper initialization:
let session = AVCaptureSession()
session.sessionPreset = .hd1280x720
let camera = AVCaptureDevice.default(.builtInWideAngleCamera, for: .video, position: .front)
let input = try AVCaptureDeviceInput(device: camera!)
let output = AVCaptureVideoDataOutput()
output.setSampleBufferDelegate(self, queue: DispatchQueue(label: "videoQueue"))
AVCaptureVideoDataOutput with delegate gives raw CMSampleBuffer — pass to WebRTC via RTCVideoSource. Important: AVCaptureSession.startRunning() called strictly in background thread, not main — otherwise UI freeze 200–400 ms.
Front/back camera switch — AVCaptureSession.beginConfiguration() + remove old input + add new + commitConfiguration(). Without begin/commit around these ops — flicker on video during switch.
CallKit — mandatory for iOS apps with video calls. Without it incoming call displays as push notification easily missed. With CallKit — full-screen system call screen, Bluetooth/AirPods integration, proper audio interrupt handling. Implement via CXProvider and CXCallController. VoIP push via PKPushRegistry — only way to wake app for incoming call.
Native Android Implementation: Camera2 and ConnectionService
On Android Camera2 API (CameraManager.openCamera()) gives access to ImageReader with format YUV_420_888 — standard for WebRTC on Android. For most tasks level of CameraDevice.StateCallback + CaptureRequest.Builder sufficient.
ConnectionService — Android equivalent of CallKit. Register PhoneAccount, via TelecomManager manage call state. Without this on Android 10+ app can't work in foreground during call without persistent notification.
For connection preservation on minimize — ForegroundService with type mediaProjection or phoneCall. On Android 14 requires explicit manifest entry: android:foregroundServiceType="camera|microphone".
Camera and Microphone Management
Mute microphone — not device disable but audio track replacement with silence. In WebRTC: RTCAudioTrack.isEnabled = false. Full microphone disable at AVAudioSession level — breaks echo cancellation.
Flip camera during call — via RTCCameraVideoCapturer.stopCapture() + device switch + startCapture(with:fps:). Without full stop — crash on some Huawei and Xiaomi devices due to Camera2 race condition.
Screen rotation — RTCVideoTrack itself doesn't account for orientation. Need to pass RTCVideoRotation in RTCVideoFrame when capturing from camera, otherwise peer sees rotated 90° video on portrait-lock devices.
Connection Quality and Adaptation
Adaptive bitrate — basic WebRTC feature (GCC algorithm). But need to explicitly set range: RTCRtpEncodingParameters with minBitrateBps: 100_000 and maxBitrateBps: 1_500_000. Without upper limit on Wi-Fi WebRTC attempts 4–8 Mbps — uncomfortable for other network users.
Connection quality indicator via RTCPeerConnection.getStats() — parse RTCInboundRtpStreamStats for framesPerSecond and packetsLost. Losses > 5% — show warning to user.
Process
Requirements audit → transport choice (WebRTC or SDK) → signaling implementation → camera/microphone integration → CallKit/ConnectionService → UI (local video preview, remote video, control buttons) → real device testing.
Basic 1-to-1 video call via SDK (Twilio/Agora/100ms) with camera management, mute, flip — 1–2 weeks. Pure WebRTC with signaling, CallKit, background mode — 3–5 weeks. Cost calculated after requirement analysis.







