Integrate ApsaraVideo MediaBox SDK for iOS

Updated at: 2025-03-14 08:50

This topic describes how to integrate ApsaraVideo MediaBox SDK for iOS to meet requirements in different business scenarios.

Usage notes

For information about how to update ApsaraVideo MediaBox SDK V6.6.0 and earlier to V6.7.0 and later, see Updates on the integrated retouching effects of ApsaraVideo MediaBox SDK V6.7.0.

Environment requirements

Item

Description

Item

Description

macOS

macOS High Sierra 10.13 or later is supported.

Xcode

In this topic, Xcode is used. To download Xcode, visit Mac App Store.

iOS

iOS 9.0 or later is supported.

Step 1: Integrate the SDK

(Recommended) Integrate the SDK in pod mode
Manually integrate the SDK
  1. Run the pod init command in the project directory to create a Podfile.

  2. Add SDK dependencies to the Podfile.

    The SDK version in the following code is used for reference only. For more information about how to obtain the latest version of ApsaraVideo MediaBox SDK, see Download by scenario.

    # Integrate one of the following SDKs based on your business scenario.
    
     #1. All-in-one ApsaraVideo MediaBox SDK: supports ApsaraVideo Player, real-time streaming (RTS), standard live streaming, short video production, real-time communication (RTC) co-streaming, and basic retouching.
     pod 'AliVCSDK_Standard', '7.0.0'
     #2. ApsaraVideo MediaBox SDK for basic live streaming: supports ApsaraVideo Player, live stream ingest, basic retouching, and RTS.
     pod 'AliVCSDK_BasicLive', '7.0.0'   
     #3. ApsaraVideo MediaBox SDK for short video scenarios: supports ApsaraVideo Player, short video production, and basic retouching.
     pod 'AliVCSDK_UGC', '7.0.0'  
     #4. ApsaraVideo MediaBox SDK for interactive streaming: supports ApsaraVideo Player, RTS, live stream ingest, RTC co-streaming, and basic retouching.
     pod 'AliVCSDK_InteractiveLive', '7.0.0'
  3. Run the pod install command to install the SDK.

    After you run the command, a *.xcworkspace file is generated, which indicates that the SDK is integrated.

Note
  • Before you submit dynamic frameworks to the App Store, you must strip dynamic frameworks of the x86-based simulator architecture. If you do not strip the dynamic frameworks, your submission will be rejected by the App Store. If you integrate the SDK in pod mode, the dynamic frameworks of the x86-based simulator architecture are automatically stripped.

  • If an error occurs during compilation, perform the following operations: In the Xcode project, open the TARGETS directory. Click the Build Settings tab. In the Apple Clang - Language section of the Build Settings tab, set the Compile Sources As parameter to Objective-C++.

  1. Download and decompress the SDK for iOS.

  2. Add the SDK dependencies.

    In the Xcode project, open the TARGETS directory. Click the General tab. In the Frameworks, Libraries, and Embedded Content section of the General tab, import the AliVCSDK_***.framework and alivcffmpeg.framework dependencies and set the value of the Embed column of each dependency to Embed & Sign. You can also import other SDK dependencies based on your business requirements.

  3. Add other dependencies.

    In the Xcode project, open the TARGETS directory. Click the General tab. In the Frameworks, Libraries, and Embedded Content section of the General tab, import the MobileCoreServices.framework, SystemConfiguration.framework, CoreTelephony.framework, CoreMedia.framework, VideoToolbox.framework, AVFoundation.framework, and libresolv.tbd dependencies.

  4. Add the resource bundle if the SDK package contains a resource bundle.

    Import the AliyunVideoSDKPro.bundle resource bundle to the Xcode project.

Step 2: Configure a license for the SDK

The first time you access ApsaraVideo MediaBox SDK, you must apply for a license and bind the license to your application.

Step 3: Configure permissions

  1. In the Xcode project, open the TARGETS directory. Click the Build Settings tab. In the Linking section of the Build Settings tab, select Other Linker Flags and configure -ObjC.

  2. In the Xcode project, open the TARGETS directory. Click the Build Settings tab. In the Build Options section of the Build Settings tab, set the Enable Bitcode parameter to No.

  3. Modify the Info.plist file to configure permissions.

    Privacy - Camera Usage Description
    Privacy - Microphone Usage Description
    Privacy - Photo Library Usage Description

FAQ

See FAQ.

  • On this page (1, T)
  • Usage notes
  • Environment requirements
  • Step 1: Integrate the SDK
  • Step 2: Configure a license for the SDK
  • Step 3: Configure permissions
  • FAQ
Feedback