This topic describes how to quickly integrate the MediaBox SDK for audio and video for iOS for various business scenarios.
Usage notes
For information about how 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.
Prerequisites
Category | Description |
macOS | macOS High Sierra 10.13 or later. |
Xcode | The procedure in this topic is based on Xcode. Download it at: Xcode. |
iOS version | iOS 9.0 or later. |
Step 1: Integrate the SDK
Integrate using CocoaPods (Recommended)
In your project directory, run the
pod initcommand 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 needs. # 1. Standard All-in-One SDK: Player + Real-Time Streaming (RTS) + Live + Short Video + RTC Co-streaming + Basic Retouching pod 'AliVCSDK_Standard', '7.9.1' # 2. Basic Live SDK: Player + Stream Ingest + Basic Retouching + RTS pod 'AliVCSDK_BasicLive', '7.9.1' # 3. Short Video SDK: Player + Short Video + Basic Retouching pod 'AliVCSDK_UGC', '7.9.1' # 4. Interactive Live SDK: Player + RTS + Stream Ingest + RTC Co-streaming + Basic Retouching pod 'AliVCSDK_InteractiveLive', '7.9.1'Run the
pod installcommand to install the SDK.After the command runs, an *.xcworkspace file is generated, which indicates that the SDK is integrated.
Manually integrate the SDK
To submit your app to the App Store, you must remove the emulator version (x86 architecture) of the dynamic library. Otherwise, the submission will be rejected. The CocoaPods integration method handles this automatically.
If a compilation error occurs, go to in your Xcode project and set it to Objective-C++.
Download and decompress the specified scenario-specific SDK for iOS.
Add SDK dependencies.
In your Xcode project, go to . Import the
AliVCSDK_***.frameworkandalivcffmpeg.frameworkdependencies. Import other dependencies from the SDK package as needed. 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 the SDK package contains one.
Import the
AliyunVideoSDKPro.bundledependency into the project.
Step 2: Configure the license
When you integrate the SDK for the first time, you must manage the license and configure license authorization.
Step 3: Configure app permissions
In your Xcode project, go to . Add the -ObjC linker option.
In your Xcode project, go to . 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 the FAQ.