Skip to main content

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.

Host app

Check Device

Confirm the device is connected, ready, and conforms to LiveStreamingAPI.

Host app

Select Transport

Read RTSP and JPEG capability properties before choosing a mode.

AIBuds

Start Session

Request the selected live-stream mode and observe startup callbacks.

Device + SDK

Prepare Input

RTSP configures and joins the device hotspot; JPEG waits for frame data.

Device → app

Receive Media

Consume the RTSP address or each complete JPEG frame.

live media
Host app

Present Media

Play RTSP with AIBudsLiveStream or decode JPEG data into an image view.

Host app → device

Stop Session

Stop the device session together with playback or presentation resources.

Terminal callback

Handle Finish

Distinguish a user stop from an interruption and clear local state.

RTSP and JPEG are alternative input modes. Start only one device live-stream session at a time.

Available Features

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.
View official skill

Streaming Modes

ModeCapabilityMedia deliveryHost presentation
RTSPsupportsRTSPLiveStreamingThe SDK coordinates the device hotspot and returns an rtsp:// address.Use AIBudsLiveStream or another compatible RTSP player.
JPEGsupportsJPEGImageLiveStreamingThe 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.