This topic describes how to quickly integrate the MediaBox SDK for audio and video on iOS for various business scenarios.
Usage notes
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
Category | Description |
macOS | macOS High Sierra 10.13 or later. |
Xcode | The steps in this topic are based on Xcode. Download it from Xcode. |
iOS version | iOS 9.0 or later. |
Step 1: Integrate the SDK
Integrate using CocoaPods (Recommended)
Run the
pod initcommand in the project directory to create a Podfile.Modify the Podfile to add the SDK dependency.
The SDK version number in this topic is for reference only. To obtain the latest version, see Scenario-specific SDKs.
# Choose and integrate one of the following four SDKs based on your business scenario. #1. All-in-one SDK: Supports playback, ultra-low latency live streaming, live streaming, short video, real-time communication (RTC) co-streaming, and basic retouching. pod 'AliVCSDK_Standard', '7.10.0' #2. Basic Live SDK: Supports playback, stream ingest, basic retouching, and ultra-low latency live streaming. pod 'AliVCSDK_BasicLive', '7.10.0' #3. Short Video SDK: Supports playback, short video, and basic retouching. pod 'AliVCSDK_UGC', '7.10.0' #4. Interactive Live SDK: Supports playback, ultra-low latency live streaming, stream ingest, RTC co-streaming, and basic retouching. pod 'AliVCSDK_InteractiveLive', '7.10.0'Run the
pod installcommand to install the SDK.After the command is executed, a *.xcworkspace file is generated. This file indicates that the SDK is integrated.
Manually integrate the SDK
Before you submit your app to the App Store, you must strip the x86 architecture for the emulator from the dynamic libraries. Otherwise, your submission will be rejected. This step is handled automatically when you integrate the SDK using CocoaPods.
If a compilation error occurs, go to in your Xcode project and set the value to Objective-C++.
Download and decompress the required scenario-specific SDK for iOS.
Add the SDK dependencies.
In your Xcode project, go to . Import the
AliVCSDK_***.frameworkandalivcffmpeg.frameworkdependencies. Import other dependencies from the SDK package as needed. For each imported dependency, set Embed to Embed & Sign.Add other library dependencies.
In your Xcode project, go to . Import the
MobileCoreServices.framework,SystemConfiguration.framework,CoreTelephony.framework,CoreMedia.framework,VideoToolbox.framework,AVFoundation.framework, andlibresolv.tbddependencies.Add the resource bundle if one is included in the SDK package.
Import the
AliyunVideoSDKPro.bundledependency into your project.
Step 2: Configure license authorization
The first time you integrate the SDK, you must manage the license and configure license authorization.
Step 3: Configure app permissions
In your Xcode project, go to and add the -ObjC linker option.
In your Xcode project, go to and set the value to NO.
Modify the Info.plist file to configure app permissions.
Privacy - Camera Usage Description Privacy - Microphone Usage Description Privacy - Photo Library Usage Description
FAQ
For more information, see the feature-specific sections in FAQ.