[Update 30 May 2018: In our API v3 the upload process and tagging process are now separate. You can refer to this blog on how to add videos to account and then add tags to videos programmatically. The API methods in this blog are now deprecated.]
While creating a video content management system, you might need to have a video uploading system for your viewers, or at least an admin panel to upload videos and manage the uploaded videos. With VdoCipher video upload API, your website shall be ready in a minute and you can ask your users to upload videos directly on your website. The videos will go to our servers and you can see the status in your account dashboard and via API.
Show me the code
http://api.vdocipher.com/v2/formOtp?tags[]=tag1&tags[]=tag2
The above API call generates a one-time-key for uploading the video. The tags GET param is a list of tags to be added to the video uploaded using this key. Now, the only thing required is to use this form key in the following code to create an upload form. Simply, replace the $OTP in the following code to the key returned by the above call.
<div id='vdo$OTP' ></div> <script src='https://de122v0opjemw.cloudfront.net/utils/formInit.php?o=$OTP'></script>
Note: Remove the jquery script if it is already loaded.
How it works?
The above script loads a form with simple HTML file input. When the user’s chooses a video in this input, the form queries the API server. The policy file and AccessKey are loaded directly from API server and added to form tag. This script uses Blueimp jQuery-File-Upload and jquery iframe transport to send the uploaded file directly to VdoCipher Amazon S3 bucket. The iframe transport helps to keep the page from loading after the upload. so you do not need to worry about the fine details and get started in minutes.
Using the Tagging API to list user’s video
In a very general case, you will need to display the videos uploaded by a particular user. You need the right tokens to find the uploaded files. You can use tags to enable such a filtered view. The videos endpoint is used to list videos which are tagged with a keyword. This keyword can be the username of the user who uploaded the video. Note that you can add multiple tags to the same video. Read more about VdoCipher Tagging API.
Supercharge Your Business with Videos
At VdoCipher we maintain the strongest content protection for videos. We also deliver the best viewer experience with brand friendly customisations. We'd love to hear from you, and help boost your video streaming business.
Leave a Reply