Integrate the SDK

更新时间:
复制 MD 格式

Integrate the Short Video SDK for iOS by using CocoaPods (pod).

Prerequisites

Your development environment must meet these requirements:

Item

Description

OS version

iOS 9.0 or later.

macOS High Sierra version

macOS High Sierra 10.13 or later.

Xcode version

Xcode 9.0 or later. Download Xcode.

SDK editions

The Short Video SDK has three editions — Professional, Standard, and Basic — all using the AliVCSDK_ShortVideo.framework library. Obtain a license for the edition that fits your needs.

  • The Basic Edition supports recording and cropping only.

  • The Professional and Standard editions are full-featured. The Standard Edition requires separate authorization for advanced API operations.

Note

Check the release notes for SDK updates.

Integration

  • To use both the Short Video SDK and the Player SDK, integrate the ApsaraVideo MediaBox SDK for iOS. This all-in-one SDK prevents dependency conflicts from separate integrations.

  • To integrate the Short Video SDK and Player SDK separately, use compatible versions of both SDKs and AlivcFFmpeg to avoid feature malfunctions. AlivcFFmpeg version dependencies.

Pod integration

  1. Add dependencies to the Podfile based on the SDK version.

    Important
    • If you use Short Video SDK 3.24.0 or later, you must use FFmpeg 4.3.0 or later.

    • Verify network access to the pod repository. After running pod install, confirm the framework version matches the latest version on the official website.

    • To upload media files to ApsaraVideo VOD with a minimal-dependency integration, also integrate the Upload SDK.

    • For V7.0.0 or later

      pod 'AliVCSDK_ShortVideo', '~> 7.11.0'
    • For V6.21.0 or earlier

      pod 'AliyunVideoSDKBasic', '~> 6.21.0' // Required for the Basic Edition
      pod 'AliyunVideoSDKStd', '~> 6.21.0'	// Required for the Standard Edition
      pod 'AliyunVideoSDKPro', '~> 6.21.0'	// Required for the Professional Edition
  2. Update the pod repository.

    pod repo update
  3. Install the pod.

    pod install

Project configuration

After integration, configure these settings in Xcode:

  1. In Build Settings > Linking > Other Linker Flags, add the -ObjC flag.

  2. In the Info.plist file of your project, add the following permissions:

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

License configuration

After you obtain a license, configure the license file. Obtain a license for the Short Video SDK.

Import the license file into your app project and add two key-value pairs to Info.plist. Set AlivcLicenseKey to your license key and AlivcLicenseFile to the license file path relative to the main bundle:

Key

Value

AlivcLicenseKey

Your license key. Example: MoCTfuQ391Z01mNqG8f8745e23c8a457a8ff8d5faedc1****

AlivcLicenseFile

The path of the embedded license file relative to the main bundle.

Next steps

Initialize the SDK

Player integration

To use both the Short Video SDK and the Player SDK, use the ApsaraVideo MediaBox SDK for iOS to avoid duplicate class compilation failures.

Related documents