Video uploading from the client refers to uploading local videos to VOD by an application user.
TXUGCPublish
?The video upload feature has been separated from the SDK and made open source in the demo. You need to integrate the UGSV upload feature by following the steps below:
Download the demo.
Copy the upload .jar package in the app\libs\upload
directory to the ..\app\libs\upload
directory of your project.
Copy the source code directory Demo\app\src\main\java\com\tencent\liteav\demo\videoupload
of the UGSV upload feature to your project directory and rename the package in the source code.
Open build.gradle
in the App
directory of your project and add code that references the .jar package:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs/upload')
}
Configure application permissions in AndroidManifest.xml
.
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
Please check whether the VOD service is activated.
Please check whether the addresses of the video file and image are correct and whether the corresponding files can be found in the specified paths.
Before a client initiates an upload, it needs to apply for an upload signature from your application server. If the application server approves the upload request, it will generate an upload signature as described in Signature for Upload from Client. The client must carry this signature so that VOD can verify whether the upload is authorized.
A signature for uploading from the client is generated as follows:
For more information, see Signature for Upload from Client.
No, there isn’t a limit on the length or size of a file uploaded.
Currently, you cannot upload images alone, but you can upload a thumbnail image along with a video. For details, see Video Upload.
Was this page helpful?