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.
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.
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];
- In Xcode, add artpSource.framework to Embedded Binaries on the General tab.
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.
// Obtain player parameters.
AVPConfig *config = [self.player getConfig];
// 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.
config.maxDelayTime = 100;
// Set other parameters.
// Specify the settings for the player.