Live Streaming Overview
Use LiveStreamingAPI to receive live camera output from a connected device. The device may expose an RTSP stream over its hotspot, deliver individual JPEG frames, or support both modes.
Animated workflow
Device live-stream lifecycle
Select a capability-supported transport, keep device and presentation resources coordinated, and treat the finish callback as the terminal session signal.
Available Features
RTSP Live Streaming
Start a device RTSP session, join its hotspot, and play the returned stream
JPEG Image Live Streaming
Receive and present a sequence of JPEG images from a connected device
Stop Live Streaming
Stop the active device live-stream session and release presentation resources
Implement with AI Assistance
Build with AI
Implement this workflow with AI
Use the official Stream Live Media from AIBuds skill to adapt this workflow to your app.
Read and follow https://docs-aibuds.github.io/skills/stream-aibuds-live-media. Use it to implement Stream Live Media from AIBuds in this iOS project and verify the result.Streaming Modes
| Mode | Capability | Media delivery | Host presentation |
|---|---|---|---|
| RTSP | supportsRTSPLiveStreaming | The SDK coordinates the device hotspot and returns an rtsp:// address. | Use AIBudsLiveStream or another compatible RTSP player. |
| JPEG | supportsJPEGImageLiveStreaming | The SDK calls the JPEG data handler for each received image. | Decode each complete Data / NSData value and update the UI. |
Framework Responsibilities
AIBuds.xcframeworkprovides the device-facingLiveStreamingAPI, capability properties, session callbacks, andRTSPStreamParamsintegration.AIBudsFoundation.xcframeworkdefinesRTSPStreamParams.AIBudsLiveStream.xcframeworkprovides optional RTSP playback and RTSP-to-RTMP relay APIs. Starting the device stream does not automatically create a player or publisher.
Best Practices
- Check the mode-specific capability property before starting.
- Keep UI state separate from individual intermediate callbacks; only the start and finish handlers describe session-level state.
- Dispatch UIKit work to the main queue.
- Stop playback or relay resources together with the device session.
- Handle hotspot loss and non-user session termination as recoverable failures rather than successful stops.
Notes
- The public API does not expose an authoritative
isLiveStreamingproperty; maintain presentation state locally and reconcile it through callbacks. - RTSP uses a Wi-Fi hotspot workflow and can temporarily change the phone's network path.
- JPEG mode provides compressed images, not a decoded video-frame object.
- RTMP publishing in the Demo is an optional
AIBudsLiveStream.LiveStreamerworkflow and is not performed byLiveStreamingAPIitself.