Skip to main content
← Back to Quickstart Guides

Mobile Streaming

Native iOS and Android streaming

30 minutes
Intermediate
iOS • Android

Installation

Add WAVE SDK to your mobile project

CocoaPods

# Podfile
pod 'WaveSDK', '~> 1.0'

# Then run:
pod install

Swift Package Manager

// Package.swift
dependencies: [
    .package(url: "https://github.com/wave/wave-ios", from: "1.0.0")
]

Quick Start

import WaveSDK

class ViewController: UIViewController {
    var wave: WaveClient!
    var streamer: WaveStreamer!

    override func viewDidLoad() {
        super.viewDidLoad()

        // Initialize Wave
        wave = WaveClient(apiKey: "wave_live_xxxxx")

        // Create streamer
        streamer = WaveStreamer(
            camera: .front,
            resolution: .hd1080,
            fps: 30
        )

        // Set preview
        view.addSubview(streamer.previewView)
    }

    func startStream() async throws {
        let stream = try await wave.streams.create(
            title: "Mobile Stream",
            protocol: .webrtc
        )

        try await streamer.start(streamId: stream.id)
        print("Streaming: \(stream.url)")
    }
}

Mobile-Optimized Features

Built for mobile constraints and capabilities

Adaptive Bitrate

Automatically adjusts quality based on network conditions and battery level

Battery Optimization

Efficient encoding with hardware acceleration reduces battery drain by 60%

Network Resilience

Gracefully handles WiFi to cellular transitions and poor signal

Camera Controls

Switch cameras, zoom, focus, exposure, beauty filters, and AR effects

Camera and Audio Configuration

Full control over capture settings

// iOS Example
let streamer = WaveStreamer(
    camera: .back,  // .front | .back
    resolution: .uhd4k,  // .sd, .hd720, .hd1080, .uhd4k
    fps: 60,  // 15, 30, 60
    orientation: .portrait,  // .portrait | .landscape
    audio: AudioConfig(
        enabled: true,
        echoCancellation: true,
        noiseSuppression: true,
        sampleRate: 48000
    ),
    video: VideoConfig(
        stabilization: true,
        hdr: true,
        codec: .h265,  // .h264 | .h265 | .vp9
        bitrate: .auto  // Adaptive bitrate
    )
)

// Switch camera mid-stream
await streamer.switchCamera()

// Enable beauty filters
streamer.beautyFilter.enabled = true
streamer.beautyFilter.level = 0.5  // 0-1

// Add AR effects
await streamer.effects.add(AREffect(type: .faceMask, asset: "cat_ears"))

Network Adaptation

Handle poor mobile networks gracefully

// Configure network adaptation
let networkConfig = NetworkConfig(
    // Adaptive bitrate settings
    minBitrate: 500_000,    // 500 kbps
    maxBitrate: 5_000_000,  // 5 Mbps
    startBitrate: 1_500_000, // 1.5 Mbps

    // Quality presets for different networks
    wifi: .uhd,       // Max quality on WiFi
    cellular5g: .hd1080,
    cellular4g: .hd720,
    cellular3g: .sd,

    // Network monitoring
    adaptationSpeed: .fast,  // How quickly to adapt
    connectionMonitoring: true
)

// Listen to network changes
streamer.onNetworkChange = { quality in
    print("Adapted to: \(quality)")
    // Show indicator to user
}
Mobile Streaming - Quickstart | WAVE Docs | WAVE