Real-Time Streaming (RTS) is a key value-added feature for ApsaraVideo Live. The ApsaraVideo Player SDK provides live streaming with millisecond-level latency for millions of concurrent users. This feature addresses the 3- to 6-second latency common in traditional live streaming, ensuring ultra-low latency, low stuttering, and instant playback. This topic describes how to implement RTS playback.
For more information about features, API documentation, and FAQs, see iOS Player.
RTS playback
The ApsaraVideo Player SDK for iOS integrates the native RTS SDK to enable low-latency live streaming on native clients. For more information, see Implement RTS stream pulling on iOS.
For detailed code samples, see the RTS ultra-low latency live playback (RtsLiveStream) module in API-Example. This project is an Objective-C-based sample project for the ApsaraVideo Player SDK for iOS. It helps developers quickly learn how to integrate the core features of the SDK.
RTS fallback
Automatic RTS fallback
When playing a stream from an RTS URL, if no fallback URL is set and RTS stream pulling fails, playback automatically falls back to the default FLV URL that corresponds to the RTS URL. The following code provides an example:
// 1: enabled, 0: disabled. Default: enabled.
[AliPlayerGlobalSettings setOption:ALLOW_PRE_RENDER valueInt:1];Custom RTS fallback
When playing a stream from an RTS URL, you can set a fallback URL, such as an HLS or FLV URL. If RTS stream pulling fails, playback automatically falls back to this URL.
// Set the fallback source URL.
AVPUrlSource *urlSource = [[AVPUrlSource alloc] urlWithString:downgradeUrl];
// Optional. Configure other items in the config object.
AVPConfig *config = [self.player getConfig];
// Set the fallback URL.
[self.player enableDowngrade:urlSource config:config];