This topic describes how to integrate the short video software development kit (SDK) for iOS using a pod.
Prerequisites
The following table describes the environment requirements.
Category | 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. |
Background information
The short video SDK is available in three editions: Professional, Standard, and Basic. All editions use the AliVCSDK_ShortVideo.framework library. You must activate the license that meets your business requirements.
The Basic Edition includes only the recording and cropping modules.
The Professional and Standard editions include all features. However, the advanced API operations of the Standard Edition require separate authorization before they can be called.
For information about the feature updates of the short video SDK, see Release notes.
Integration instructions
To use both the short video SDK and the player SDK, we recommend that you integrate ApsaraVideo MediaBox for iOS. This all-in-one SDK helps prevent dependency conflicts that can occur when you integrate multiple SDKs separately. For more information about the integration, see iOS.
If you want to integrate the short video SDK and the player SDK separately, you must be aware of the version dependencies among the short video SDK, the player SDK, and AlivcFFmpeg. Otherwise, features of the short video SDK or the player SDK may not work as expected. For more information, see AlivcFFmpeg version dependencies.
Integrate using a pod
Add the dependencies to the Podfile. The required dependencies vary based on the SDK version.
ImportantIf you use the short video SDK V3.24.0 or later, you must use FFmpeg 4.3.0 or later.
Ensure that your network can access the pod repository. After you run the pod install command, verify that the framework version matches the latest version on the official website.
If you integrate the short video SDK with minimal dependencies and need to upload media assets to ApsaraVideo VOD, you must also integrate the upload SDK. For more information, see Upload SDK.
Integrate V7.0.0 or later
pod 'AliVCSDK_ShortVideo', '~> 7.9.1'Integrate V6.21.0 or earlier
pod 'AliyunVideoSDKBasic', '~> 6.21.0' // Integrate the Basic Edition pod 'AliyunVideoSDKStd', '~> 6.21.0' // Integrate the Standard Edition pod 'AliyunVideoSDKPro', '~> 6.21.0' // Integrate the Professional Edition
Update the pod repository.
pod repo updateInstall the pod.
pod install
Configure the project
After you integrate the SDK, open the project and modify the following configurations:
In the section, add -ObjC.
Open the Info.plist file of the project and add the following permissions:
Privacy - Camera Usage Description Privacy - Microphone Usage Description Privacy - Photo Library Usage Description
Configure the license
After you obtain a license, configure the license file as follows. For more information about how to obtain a license, see Obtain a license for the short video SDK.
Import the downloaded license file into your app project. In the Info.plist file, add two keys. Set the first key to AlivcLicenseKey and its value to your LicenseKey. Set the second key to AlivcLicenseFile and its value to the path of the built-in certificate file relative to mainBundle. The following table provides an example.
Key | Value |
AlivcLicenseKey | The value of LicenseKey. Example: MoCTfuQ391Z01mNqG8f8745e23c8a457a8ff8d5faedc1**** |
AlivcLicenseFile | The path of the built-in certificate file relative to mainBundle. |
What to do next
Player integration
If you want to integrate both the short video SDK for iOS and the player SDK into your project, we recommend that you use the all-in-one SDK for iOS. This prevents class duplication issues that can cause compilation to fail.