Skip to content

Core Live Streaming Overview

Mr.P edited this page Aug 25, 2026 · 1 revision

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.

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.

  1. Check Device — Confirm the device is connected, ready, and conforms to LiveStreamingAPI.
  2. Select Transport — Read RTSP and JPEG capability properties before choosing a mode.
  3. Start Session — Request the selected live-stream mode and observe startup callbacks.
  4. Prepare Input — RTSP configures and joins the device hotspot; JPEG waits for frame data.
  5. Receive Media — Consume the RTSP address or each complete JPEG frame.
  6. Present Media — Play RTSP with AIBudsLiveStream or decode JPEG data into an image view.
  7. Stop Session — Stop the device session together with playback or presentation resources.
  8. Handle Finish — Distinguish a user stop from an interruption and clear local state.

Available Features

Browse the generated Wiki navigation for the pages in this section.

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.xcframework provides the device-facing LiveStreamingAPI, capability properties, session callbacks, and RTSPStreamParams integration.
  • AIBudsFoundation.xcframework defines RTSPStreamParams.
  • AIBudsLiveStream.xcframework provides optional RTSP playback and RTSP-to-RTMP relay APIs. Starting the device stream does not automatically create a player or publisher.

Best Practices

  1. Check the mode-specific capability property before starting.
  2. Keep UI state separate from individual intermediate callbacks; only the start and finish handlers describe session-level state.
  3. Dispatch UIKit work to the main queue.
  4. Stop playback or relay resources together with the device session.
  5. Handle hotspot loss and non-user session termination as recoverable failures rather than successful stops.

Notes

  • The public API does not expose an authoritative isLiveStreaming property; 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.LiveStreamer workflow and is not performed by LiveStreamingAPI itself.

AIBuds SDK iOS Wiki

Clone this wiki locally