Video upload from client refers to uploading local videos to the VOD platform by an end user of application. This document describes how to upload videos using a client.
Get the security credentials (i.e.,
SecretKey) required to call the server API in the following steps:
The client needs to apply to the signature distribution server of the application for an upload signature. For detailed directions, please see Signature for Upload from Client. Below are samples of generating signatures in different programming languages:
- Upload from client is to directly upload video files from a client to the VOD platform, without the need to relay files through the application server. Therefore, VOD has to authenticate the client that initiates the request.
- The application shall not disclose
SecretKey, which has ultimate permissions, to the client in order to avoid serious security breaches. Therefore, before initiating a request, the client needs to apply for an upload signature.
VOD provides SDKs for multiple platforms to help upload videos from client with ease. For more information, please see:
procedureparameter when generating the upload signature, and the parameter value should the name of the desired task flow template. VOD supports creating task flow templates and naming them. When initiating a task flow, you can use the task flow template name to indicate the desired task.
storageRegionparameter when the upload signature is generated, and the parameter value should be a region abbreviation.
oneTimeValidto 1 when the application backend distributes the signature. For more information, please see Signature for Upload from Client.
The one-time signature can be used only once. Though this approach is more secure, the application has to perform extra processing. For example, when upload fails, you cannot simply use the SDK to upload the video again; instead, you need to apply for a new upload signature.
You can enable the resumable upload feature for the application as shown below:
The effective time for resumption is 1 day, i.e., if the upload of a video is interrupted and then resumed within 1 day, it can be directly resumed; otherwise, the full video will be uploaded again by default.
procedureparameter in the signature for upload from client to specify the video processing method after video upload is completed. For more information, please see Specifying a Task Flow During Upload.
sourceContextparameter to the signature for upload from client to carry the user identity information. The video upload completion notification will pass this parameter to the application backend. For more information, please see Event Notification.
After a video upload is completed, VOD will initiate an event notification - video upload completion to the application backend, through which the application backend can become aware of the video upload event. To receive event notifications, you need to go to Console - Callbacks to enable event notification. Event notification - video upload completion mainly contains the following information:
FileIdand URL of the uploaded video.
SourceType: this field is always
ServerUpload, indicating that the upload originates from a server.
SourceContext: this is a custom passthrough field specified by the application backend during signature distribution, which corresponds to the
sourceContextparameter in the signature.
For more information, please see: