Welcome toTencent Cloud + community, get more Tencent mass technology practice dry goods oh ~
This article is published in cloud + community column by Tencent Cloud Video
Pay attention to the public, “tencent cloud video”, a key access technology dry | | preferential activities video solutions
“Love is like a blue sky with white clouds and a sudden storm…” “It seems that the work arranged for you is too little. How about this? Even if you like watching microvision so much, you will be given three days to build a short video APP similar to microvision. My god! Nothing but despair and despair! People often say that life is like a play, and the play is like life.
It took three days to build a short video APP, only to seek the help of Baidu. There were thousands of online solutions, and finally I chose the solution of Tencent Cloud. From the access process to the final presentation effect was very good.
Integrate independent short video function
If you want to integrate some functions of short video in your App, please refer to the following four steps:
01
Step1: apply for a test License
1.1 Log in to the official website of Tencent Cloud, enter the short video console, and fill in the corresponding information, where Package Name is the Android Package Name and Bundle Id is the iOS bundleId.
1.2 Generate License Information after creation. Key and License File are used in the integrated SDK.
02
Step2: Download SDK and import project
2.1 Go to the SDK Download page to download the SDK for iOS and Android
2.2 Complete the project configuration as instructed
The iOS platform
Copy SDK file, add Framework, add -objc, reference header file, short video publishing function integration. For details, see iOS Engineering Configuration.
The Android platform
There are two integration methods: JAR package and AAR. Please refer to the details and Android project configuration.
2.3 Don’t forget to verify that the configuration is correct:
The iOS platform
Reference the SDK at the beginning of viewController.m:
@importTXLiteAVSDK_UGC;Copy the code
Add code to the viewDidLoad method:
- (void)viewDidLoad {
[super viewDidLoad];
// Displays the SDK version information
NSLog(@"SDK Version = %@", [TXLiveBase getSDKVersionStr]);
}
Copy the code
If all the previous steps are done correctly, the HelloSDK project will compile smoothly. When you run the App in Debug mode, the Console pane of Xcode displays the SDK version information.
2017- 0926 - 16:16:15.767 HelloSDK[17929:7488566] SDK Version = 3.41761.
Copy the code
The Android platform
Reference the SDK’s class in mainActivity.java:
import com.tencent.rtmp.TXLiveBase;
Copy the code
Call the getSDKVersioin interface in onCreate to get the version number:
String sdkver = TXLiveBase.getSDKVersionStr();
Log.d("liteavsdk"."liteav sdk version is : " + sdkver);
Copy the code
If the preceding steps are correct, the demo project will be successfully compiled, and the following log information will be displayed in logcat after running:
0926 - 19:30:36.547 19577- 19577./ D/liteavsdk: liteav sdk version is : 3.92794.
Copy the code
At this point, the project configuration is complete.
03
Step3: integrated License
After the project configuration is complete, you must integrate the short video License to use basic functions. You’ve got the Key and LicenceUrl in the first step, and it only takes one line of code to configure it.
The iOS platform
Before using the short video feature in your application (preferably in the AppDelegate), set the key and URL to the interface below
[TXUGCBase setLicenceURL:url key:key];
Copy the code
The Android platform
Before using the short video feature in your application (recommended in Application), set the key and URL to the following interface
TXUGCBase.getInstance().setLicence(context, url, key);
Copy the code
Another thing to note:
1. You can choose whether to package the license file. If you do not package the license file, the SDK accesses the network for the first time. If you choose to package, iOS will copy txugcsdK. licence (name should be correct) to App. Android puts txugcsdk. licence (the correct name) in the asset root directory.
2. When your license expires, you can log in to Tencent Cloud Vod Console to renew the license. The SDK will automatically renew the license without any operation of your application
3. If the license verification fails, you can call the following code to check whether the license information is incorrect.
// iOS
NSLog(@"% @", [TXUGCBase getLicenceInfo]);
// Android
TXUGCBase.getInstance().getLicenceInfo();
Copy the code
04
Step4: integrate independent functions
If you want to add some short video functions (such as recording and uploading) to your App, you can refer to the following function integration document to complete the embedding of specified functions:
Access to functions
The iOS platform
Android
Project configuration
XCode
Android Studio
Video recording
API
API
Video editing
API
API
Video stitching
API
API
Upload video
API
API
Video playback
API
API
Dynamic effect face
API
API
The above are the main steps to quickly build short video APP service based on the official document guidance of Tencent Cloud, taking Android and iOS platforms as examples. If you have any other questions, please leave a message.
Question and answer
How to edit short video in UGSV?
reading
Compared with traditional video, what are the main features of short video development
What kind of industry is the one-to-one live broadcasting system mainly applied to
Short video APP development — Analysis of main functions
Machine learning in action! Quick introduction to online advertising business and CTR knowledge
This article has been authorized by the author to Tencent Cloud + community, more original text pleaseClick on the
Search concern public number “cloud plus community”, the first time to obtain technical dry goods, after concern reply 1024 send you a technical course gift package!
Massive technical practice experience, all in the cloud plus community!