This topic describes how to integrate the short video SDK for iOS in pod mode and manually integrate the SDK.

Prerequisites

The development environment is set up. The following table describes the requirements on the development environment.
Environment Description
iOS iOS 9.0 or later.
macOS High Sierra macOS High Sierra 10.13 or later.
Xcode Xcode 9.0 or later. To download Xcode, visit Mac App Store.

(Recommended) Integrate the SDK in pod mode

  1. Add dependencies to the Podfile file. The following table describes the dependencies for the SDK.
    Notice If you use the short video SDK 3.24.0 or later, use FFmpeg 4.3.0 or later.
    pod 'AliyunVideoSDKPro', '~> 3.30.0'
  2. Update the pod repository.
    pod repo update
  3. Install the pods.
    pod install
Note Make sure that you can access and update the pod repository over the network. After the pods are installed, check whether the framework version is the same as the latest version that is released on the GitHub official website.

Manually integrate the SDK

To manually integrate the SDK, download the latest release packages from GitHub. In this topic, you need to download six frameworks and a bundle resource package.
Name Type Description Download link
AliyunVideoSDKPro Static framework Short video SDK Professional Edition
AliyunVideoCore Dynamic framework Short video SDK Professional Edition
AliyunVideoSDKPro.bundle Resource plan Short video SDK Professional Edition
alivcffmpeg Dynamic framework FFmpeg framework GitHub
AlivcConan Dynamic framework Tool framework GitHub
VODUpload Static framework Upload framework of ApsaraVideo VOD (VOD) GitHub
AliyunOSSiOS Static framework Upload framework of Object Storage Service (OSS) GitHub
Notice
  1. To import dynamic frameworks, perform the following operations: In the left-side navigation tree, click TARGETS. On the page that appears, click the General tab. In the Frameworks, Libraries, and Embedded Content section, import the frameworks.
  2. Before you submit dynamic frameworks to App Store, you must strip dynamic frameworks of the x86-based simulator architecture. If you do not strip the dynamic frameworks, App Store rejects your submission. You can strip dynamic frameworks of the x86-based simulator architecture by using one of the following methods:
    • Use the lipo command line tool to strip dynamic frameworks of the x86-based simulator architecture.
    • Integrate dynamic frameworks in pod mode. This way, dynamic frameworks of the x86-based simulator architecture are automatically stripped when the pods are packaged.
  1. Add dynamic frameworks.
    Click the General tab. In the Frameworks, Libraries, and Embedded Content section, click +, select Add Other... from the drop-down list, and then import AliyunVideoCore.framework, AlivcConan.framework, and alivcffmpeg.framework. After the frameworks are imported, click Embed & Sign.
  2. Add static frameworks.
    Click the General tab. In the Frameworks, Libraries, and Embedded Content section, click +, select Add Other... from the drop-down list, and then import AliyunVideoSDKPro.framework, AliyunOSSiOS.framework, and VODUpload.framework.
  3. Add other dependencies.
    Click the General tab. In the Frameworks, Libraries, and Embedded Content section, click + and import MobileCoreServices.framework, SystemConfiguration.framework, and libresolv.tbd.
  4. (Optional) Import AliyunVideoSDKPro.bundle to the project. This step is required only if you use the SDK Professional Edition. You can skip this step if you use the SDK Basic or Standard Edition.
    Click the Build Phases tab. In the Copy Bundle Resources section, click +, select Add Other… from the drop-down list, and then import AliyunVideoSDKPro.bundle.
Note

The manual integration of the SDK is complex and requires you to strip dynamic frameworks before you submit dynamic frameworks to App Store. We recommend that you integrate the SDK in pod mode.

If an error occurs during compilation, perform the following operations: Click the Build Settings tab. In the Apple Clang - Language section, set Compile Sources As to Objective-C++.

Configure the project

After the SDK is integrated, open the project and modify the configurations.

  1. Click the Build Settings tab. In the Linking section, set Other Linker Flags to -ObjC.
  2. Click the Build Settings tab. In the Build Options section, set Enable Bitcde to NO.
  3. Open the info.Plist file of the project and grant the following permissions:
    Privacy - Camera Usage Description
    Privacy - Microphone Usage Description
    Privacy - Photo Library Usage Description

API references

For more information, see API references.