This topic describes the environment requirements, integration methods, and permission configurations of the audio and video terminal SDK for iOS.
Environment requirements
| Item | Requirement |
|---|---|
| iOS | iOS 9.0 or later. |
| macOS High Sierra | macOS High Sierra 10.13 or later. |
| Xcode | We recommend that you use Xcode. The operations in this topic are based on Xcode. To download Xcode, visit Xcode. |
SDK description
The audio and video terminal SDK V1.2.0 and later provide different SDK packages based on business scenarios. You can select an SDK package based on your business requirements. An SDK package is easy to use and smaller in size. The following table describes the SDK packages.
| SDK package | Scenario | SDK combination |
| AliVCSDK_Standard | All-in-one (retouching not included) | Push SDK, the short video SDK, and ApsaraVideo Player SDK. The Real-Time Streaming (RTS) and Real-Time Communication (RTC) modules are included in Push SDK. |
| AliVCSDK_Premium | All-in-one (retouching included) | Push SDK (RTS and RTC included), the short video SDK, Queen SDK, and ApsaraVideo Player SDK |
| AliVCSDK_BasicLive | Basic live streaming | Push SDK and ApsaraVideo Player SDK |
| AliVCSDK_StandardLive | Basic live streaming (retouching included) | Push SDK, ApsaraVideo Player SDK, and Queen SDK |
| AliVCSDK_UGC | Short videos | Short video SDK and ApsaraVideo Player SDK |
| AliVCSDK_UGCPro | Short videos (retouching included) | Short video SDK, Queen SDK, and ApsaraVideo Player SDK |
| AliVCSDK_InteractiveLive | Interactive live streaming, which is suitable for business in RTS and RTC scenarios. | Push SDK (RTS and RTC included) and ApsaraVideo Player SDK |
| AliVCSDK_PremiumLive | Interactive live streaming (retouching included), which is suitable for business in RTS and RTC scenarios. | Push SDK (RTS and RTC included), Queen SDK, and ApsaraVideo Player SDK |
(Recommended) Integrate the SDK online
- After you select an SDK package, add the SDK dependencies to the Podfile file.
# Select one of the following SDK combinations based on your business requirements. #1. Push SDK (RTS and RTC included), the short video SDK, and ApsaraVideo Player SDK pod 'AliVCSDK_Standard', '6.0.0' #2. Push SDK (RTS and RTC included), the short video SDK, Queen SDK, and ApsaraVideo Player SDK pod 'AliVCSDK_Premium', '6.0.0' #3. Push SDK and ApsaraVideo Player SDK pod 'AliVCSDK_BasicLive', '6.0.0' #4. Push SDK, ApsaraVideo Player SDK, and Queen SDK pod 'AliVCSDK_StandardLive', '6.0.0' #5. Short video SDK and ApsaraVideo Player SDK pod 'AliVCSDK_UGC', '6.0.0' #6. Short video SDK, Queen SDK, and ApsaraVideo Player SDK pod 'AliVCSDK_UGCPro', '6.0.0' #7. Push SDK (RTS and RTC included) and ApsaraVideo Player SDK pod 'AliVCSDK_InteractiveLive', '6.0.0' #8. Push SDK (RTS and RTC included), Queen SDK, and ApsaraVideo Player SDK pod 'AliVCSDK_PremiumLive', '6.0.0' - Run the following command:
pod install
Integrate the SDK offline
To perform offline integration, you need to download two libraries of the specified versions and a resource bundle. The following table describes the frameworks and resource bundle required for offline integration.
| Package | Description | Download link |
| AliVCSDK_xxx | The library of the audio and video terminal SDK. Note "xxx" indicates the name of a library. For more information, see SDK description. | |
| alivcffmpeg | The dynamic libraries of FFmpeg. Note When you use SDK packages such as AliVCSDK_Premium, AliVCSDK_Standard, AliVCSDK_UGC, and AliVCSDK_UGCPro, you need to integrate the FFmpeg dynamic libraries. Other SDK packages do not require the FFmpeg dynamic libraries. | Download link |
| AliyunVideoSDKPro.bundle | The resource bundle of short videos. Note When you use SDK packages such as AliVCSDK_Premium, AliVCSDK_Standard, AliVCSDK_UGC, and AliVCSDK_UGCPro, and you want to use the features related to short videos, you need to integrate the resource bundle. Other SDK packages do not require the resource bundle of short videos. | The download link of AliyunVideoSDKPro.bundle is included in the AliVCSDK_xxx library. For more information, see the download link of the AliVCSDK_xxx library. |
- Add dynamic libraries.
- Click the General tab. Find the Frameworks, Libraries, and Embedded Content section.
- Click the Plus icon, and then click Add Other… to import the
AliVCSDK_xxx.frameworkandalivcffmpeg.frameworkdependencies. The name of the AliVCSDK_xxx.framework dependency is based on the SDK package that you use. If the alivcffmpeg.framework dependency is not required, you do not need to import this dependency. - After the libraries are imported, select Embed & Sign.
- Add other dependencies.
- Click the General tab. Find the Frameworks, Libraries, and Embedded Content section.
- Click the Plus icon to add the following dependencies:
MobileCoreServices.framework,SystemConfiguration.framework,CoreTelephony.framework,CoreMedia.framework,VideoToolbox.framework,AVFoundation.framework, andlibresolv.tbd.
- (Optional) Import the resource bundle. Import the
AliyunVideoSDKPro.bundleresource bundle to your project.
- Before you submit your app to App Store, you must strip dynamic libraries of the x86-based simulator architecture. If you do not strip the dynamic libraries, your submission will be rejected by App Store. The integration of the audio and video terminal SDK for iOS in pod mode is automatically processed.
- If an error occurs during compilation, perform the following operations: Click the Build Settings tab. In the Apple Clang - Language section, set the Compile Sources As parameter to Objective-C++.
Configure permissions
After the SDK package is integrated, open the project and perform the following steps to modify configurations:
- Choose Build Setting > Linking > Other Linker Flags and add -ObjC.
- Choose Build Setting > Build Options and set the Enable Bitcode parameter to NO.
- 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
Configure a license
If you access an SDK for the first time, you must apply for a license and obtain the corresponding license key and license file. For more information, see Usage notes on licenses.
After you obtain the license file, import it to the project and add two keys to the Info.plist file. The following table describes the keys and their values.
| Key | value |
AlivcLicenseKey | The value of LicenseKey. |
AlivcLicenseFile | The path in which the license file is stored in the mainBundle folder. |
API references
For more information about methods of the audio and video terminal SDK, see Overview.
FAQ
For FAQ about SDK integration, see FAQ.