macOS
A native SwiftUI app, with AppKit where SwiftUI has no API. It is not Catalyst. It lives in the same Xcode project as the iOS app and compiles most of its code, so signaling, E2EE, effects and group calls work exactly as on iOS. macOS 26 or newer.
File: docs/public/media/share-macos.pngOpen ios/WebRTCDemo.xcodeproj, pick the WebRTCDemoMac scheme and the My Mac destination. The server addresses are in WebRTC Demo › Settings… (⌘,), and default to localhost, so servers on the same Mac work without changes. The first call asks for camera and microphone access, and the first screen share asks for Screen Recording access.
Shared with iOS
CallViewModel, LocalMedia, WebRTCClient, GroupCallClient, SignalingSocket, FrameEncryption, EffectsProcessor and the shared views are compiled into both apps. Platform code is kept apart with #if os(macOS) / #if os(iOS).
Mac only
Files in ios/WebRTCDemoMac:
| File | What it does |
|---|---|
WebRTCDemoMacApp.swift | One window, the Settings scene, the Call menu |
MacCallView.swift | The call window: stage, draggable self view, auto-hiding controls |
ScreenSharePicker.swift | Screen and window picker with thumbnails |
ScreenShareCapturer.swift | SCStream into the RTCVideoSource |
FileVideoCapturer.swift | AVAssetReader into the RTCVideoSource, looping |
FloatingCallWindow.swift | The always-on-top mini call window |
MacGroupStage.swift | Group call grid, tiles, people list |
CallCommands.swift | The Call menu and single-key shortcuts |
What is different from iOS
- Screen sharing. ScreenCaptureKit:
SCShareableContentfor the list,SCScreenshotManagerfor thumbnails,SCStreamin NV12, at most 1920 px on the long side, 30 fps. The last frame is repeated every 500 ms while the screen is still, so the encoder keeps producing frames. webrtc-sdk'sRTCDesktopCapturerisn't used because it relies on APIs that macOS 15 and later no longer support. - Video files. The macOS slice of webrtc-sdk doesn't ship
RTCFileVideoCapturer, soFileVideoCapturerreads files withAVAssetReader, paced by presentation time. - Video view. The Mac
RTCMTLVideoViewhas no content mode. It is laid out at the frame's aspect ratio, just large enough to cover its bounds, and fit and mirroring are a layer transform around the center. - Devices. Cameras come from
RTCCameraVideoCapturer, microphones and speakers from the factory's audio device module. Choices are remembered. - Floating window. An
NSPanelat floating level on all Spaces. It opens by itself when you minimize the call window. Picture-in-picture - Mirroring. The capture connection is pinned to unmirrored, so the other side always gets unmirrored frames and stickers the right way round. Only the local views mirror.
- Effects cadence. Vision runs on every 2nd frame, and backs off to every 3rd or 4th when a pass is slow, since Intel Macs have no Neural Engine.
- Sandbox. App Sandbox with camera, microphone, outgoing and incoming network (ICE checks arrive unsolicited) and user-selected files. There is no audio session to configure on the Mac.
