You can use Xcode or Android Studio to compile and debug the UGSV demo app's source code as follows. The execution effect is as shown below:
Download the UGSV demo app's source code here.
For more information, see License Application.
Click Build in Xcode or Android Studio to compile and run the source code. Tencent's test server address http://demo.vod2.myqcloud.com/lite/
is configured in the source code, so you can quickly run the UGSV app in the debugging environment.
The UGSV demo app depends on two backend services:
If you use the default server address http://demo.vod2.myqcloud.com/lite/
in the UGSV demo app's source code, both the VOD service and list server are provided by Tencent Cloud. However, they can be used only for debugging and trial as there is a limit on the concurrent requests.
You can also set up your own backend server as follows:
When the UGSV demo app uploads a video, it requires a Tencent Cloud key, i.e., SecretId
and SecretKey
, which need to be obtained from the Tencent Cloud console and configured on the business server.
SecretId
and SecretKey
.Create a CVM instance in the CVM console.
Select Custom Configuration and enter the image marketplace to select an image.
Configure the disk, network, and CVM access password. Keep the password secure. Then, configure a security group.
Log in to the created CVM instance.
You can click Log In in the Operation column of the instance to access the instance through Tencent Cloud's web shell or use PuTTY or SecureCRT to log in to it over SSH.
Modify the CVM instance configuration information.
Set appId
, SecretId
, and SecretKey
in the following script to the APPID
, SecretId
, and SecretKey
obtained in step 2. Then, log in to the CVM instance and directly run the modified script in the instance.
5.1 Modify and copy the following configuration locally. Then, log in to the CVM instance and paste and run the code in the console.
echo '{
"dbconfig":{
"host":"127.0.0.1",
"user":"litvideo",
"password":"litvideo",
"database":"db_litvideo",
"port":3306,
"supportBigNumbers": true,
"connectionLimit":10
},
"tencentyunaccount":{
"appid":"Your AppId",
"SubAppId":"",
"SecretId": "Your SecretId",
"SecretKey": "Your SecretKey",
"bucket":"xiaoshipin",
"region":"ap-guangzhou"
},
"server":{
"ip":"0.0.0.0",
"port":8001,
"reliablecb":true
}
}' > /home/ubuntu/vod-xiaoshipin-server/conf/localconfig.json
8001
.Start the service:
cd /home/ubuntu/vod-xiaoshipin-server/;pm2 start app.js --name 'litvideo';
To stop or restart the service, run the following commands:
Restart the service:
pm2 restart litvideo;
Stop the service:
pm2 delete litvideo;
5.3 View the CVM instance's public IP in step 4 and enter http://IP
in the browser to check whether the service has started successfully.
kHttpServerAddr
in the iOS/Demo/XiaoShiPin/TCConstants.h
file to the public IP address of your CVM instance.APP_SVR_URL
in the XiaoShiPin_Professional_Android/Demo/ugckit/src/main/java/com/tencent/qcloud/ugckit/UGCKitConstants.java
file to the public IP address of your CVM instance.Note:If no certificate is configured for the CVM instance, then HTTP, not HTTPS, must be used in the CVM address.
At this point, the server mode of the UGSV demo app has been configured, and you can run the app to try out its features.
Was this page helpful?