Upload Videos
Last updated
Last updated
You need a storage space for the videos that users will upload.
Cloudinary provides cloud storage and an awesome upload widget that allows users to upload videos or any type of file from their local computer, Facebook, Dropbox, Google Drive and Instagram.
See the Pen by Cloudinary () on .
Success Note: Head over to and create an account for free.
Open up your public/index.html
file and include Cloudinary's widget script just immediately after the stylesheet link.
Head over to src/components/Upload.js
. You'll modify the code to have an uploadWidget
function.
In the code above, we added a third argument, tags. Cloudinary provides this for automatic video tagging. Every video that is uploaded to this app will be automatically tagged, miniflix. In addition, you can provide as many tags as you want. This feature is very useful when you want to search for videos too!
In the uploadWidget function, we called the cloudinary.openUploadWidget function and attached it to the “Upload Video” button. When the user clicks the button, it opens the widget.
The sources
parameter accepts an array of string values defining the tabs to add to the upload widget, where each source defines a new upload tab within the widget.
Head over to the /upload
route and try uploading a video.
Upload Widget
Uploading the video...
The upload widget takes in . However, we used the following: cloud_name
, upload_preset
, sources
and tags
in this code lab.
Info Note: Replace the cloud_name
& upload_preset
values with your credentials from the .
It uploads the video straight to Cloudinary and returns a response object about the recently uploaded video that contains so many parameters such as the unique publicid, secureurl, url, originalfilename, thumbnailurl, createdate, duration and .