Skip to main content
SmallWebRTCTransport enables peer-to-peer WebRTC connections between clients and your Pipecat application. It implements bidirectional audio and video streaming using WebRTC for real-time communication. This transport is intended for lightweight implementations. It expects your Pipecat server to include the corresponding SmallWebRTCTransport server-side implementation.

Installation

Add the SmallWebRTCTransport package to your project:
.package(url: "https://github.com/pipecat-ai/pipecat-client-ios-small-webrtc.git", from: "0.0.1")

// Add to your target dependencies
.target(name: "YourApp", dependencies: [
    .product(name: "PipecatClientIOSSmallWebrtc", package: "pipecat-client-ios-small-webrtc")
])

Usage

Create a client using the SmallWebRTCTransport:
import PipecatClientIOS
import PipecatClientIOSSmallWebrtc

let rtviClientOptions = RTVIClientOptions.init(
    enableMic: currentSettings.enableMic,
    enableCam: currentSettings.enableCam,
    params: RTVIClientParams(
        config: [
            .init(
                service: SmallWebRTCTransport.SERVICE_NAME,
                options: [
                    .init(name: "server_url", value: .string($PIPECAT_SERVER_URL))
                ]
            )
        ]
    )
)
self.rtviClientIOS = RTVIClient.init(
    transport: SmallWebRTCTransport.init(options: rtviClientOptions),
    options: rtviClientOptions
)
self.rtviClientIOS?.start() { result in
    switch result {
    case .failure(let error):
        // handle error
    case .success(_):
        // handle success
    }
}

API Reference

SmallWebRTCTransport Reference

Complete API documentation for the Small WebRTC transport implementation