Red5WebRTCKit is the native iOS SDK for publishing and subscribing to live streams over WebRTC. It handles ICE negotiation, codec selection, camera and microphone capture, and license validation so you can focus on building your app. The SDK works with both Red5 Cloud (Stream Manager) deployments and standalone Red5 Pro servers, and is compatible with SwiftUI and UIKit.
Requirements
- iOS 13.0 or later
- Xcode 14.0 or later
- Swift 5.5 or later
- A valid Red5 Pro SDK license key
Installation
Add the SDK to your Xcode project using Swift Package Manager. Package URL:https://github.com/red5pro/red5pro-ios-sdk
Or declare it in your Package.swift:
Permissions
Add the following keys to yourInfo.plist before publishing. Camera permission is not required for audio-only sessions.
License key setup
Pass your license key to the builder with.setLicenseKey(). The SDK validates the key asynchronously when the client is built, and fires onLicenseValidated on your delegate before any streaming can begin.
Your license key is available on the Dev Resources page in the Red5 Cloud dashboard.
Minimal publish
Publishing requires three steps after the license validates: start a camera preview, then callpublish().
1
Build the client
Configure the client with your server details and media settings. Use
setStreamManagerHost() for Red5 Cloud or setServerIp() for a standalone server.2
Wait for license validation
The SDK fires
onLicenseValidated before any other callback. Start the camera preview only after validation succeeds.3
Publish when preview is ready
Enable your publish button in
onPreviewStarted, then call publish() when the user taps it.4
Stop the session
Minimal subscribe
Subscribing does not require a preview step. Build the client, attach a renderer for the incoming video, and callsubscribe().
Audio-only streaming
Set.setVideoEnabled(false) to publish or subscribe without video. No camera permission is required, and no RTCMTLVideoView renderer is needed.
publish() directly from onLicenseValidated — no preview step is needed:
Custom video settings
Configure resolution, frame rate, and bitrate on the builder before calling.build(). These settings cannot be changed after the client is created.
Camera controls
Call these methods on the client instance any time afterstartPreview() completes.
Switch between front and back camera:
Event reference
ImplementRed5ProWebrtcEventDelegate in your class to receive SDK lifecycle events. All methods have default no-op implementations, so you only need to override the callbacks you care about.
Publish events
Publish events
Subscribe events
Subscribe events
Connection and lifecycle events
Connection and lifecycle events
Chat events
Chat events
Configuration reference
KeyRed5WebrtcClientBuilder methods:
Example apps
Each example is a self-contained Xcode project. CopyConfig.swift and the example file into a fresh project, fill in your server details, and run.
- 01-MinimalPublish — fewest lines needed to go live
- 02-MinimalSubscribe — fewest lines needed to receive a stream
- 03-AudioOnly — publish or subscribe with video disabled
- 04-CustomVideoSettings — configure resolution, frame rate, and bitrate
- 05-CameraControls — flip camera, mute/unmute video and audio while live
