All Products
Document Center

RTS integration

Last Updated: May 29, 2020

ApsaraVideo Player SDK provides the real-time streaming (RTS) feature. The RTS integration procedure is the same as that described in the Integration topic. This topic provides more information about RTS.

Integrate RTS into the project

ApsaraVideo Player SDK supports importing dynamic frameworks. You can add artpSource.framework to your project to enable RTS playback.

This topic takes V4.6.0 as an example to describe the integration procedure. The integration procedure for later versions is similar, except for the version number.

SDK structure

You can add artpSource.framework to your project to play short-delay RTS streams in ApsaraVideo for VOD. To play RTS streams in your application, run the following code before playback: (If you do not need RTS playback, remove artpSource.framework from your project and delete the following code.)
[AliPlayer initPlayerComponent:[NSString stringWithUTF8String:ARTP_COMPONENT_NAME] function:getArtpFactory];

Integration method

  1. In Xcode, add artpSource.framework to Embedded Binaries on the General tab.

Maximum buffer delay for RTS playback

ApsaraVideo Player SDK provides the MaxDelayTime parameter of the AVPConfig method to set the maximum buffer delay for RTS playback.
In RTS playback, you can use this parameter to set the maximum buffer delay for player orchestration. We recommend that you set this parameter to a small value, such as 100 milliseconds.

  1. // Obtain player parameters.
  2. AVPConfig *config = [self.player getConfig];
  3. // Set the maximum buffer delay, in milliseconds. This parameter is valid only for RTS playback. If the delay time exceeds the maximum limit, ApsaraVideo Player SDK synchronizes frames to reduce the delay under the set limit.
  4. config.maxDelayTime = 100;
  5. // Set other parameters.
  6. // Specify the settings for the player.
  7. [self.player setConfig:config];