Connecting With Cloudinary
Understand the Connection Process
Note this code snippet in the index.html
file:
Lines 2-26
implement the core upload capability by first creating a media recording with videoElement.srcObject
. Below that are the definitions of the properties for the rec
variable, which instructs the recorder on how to act in various situations.
The rec.onstop
property is of particular interest. When a recording is complete, the recorder obtains the recorded data and sends them as a single blob to Cloudinary with Cloudinary's Upload Presets.
To further handle the videos you have uploaded, leverage Cloudinary. First, create an account there.
Find Out Your Cloud Name
Cloudinary then takes you to your Dashboard (media console), in which your cloud name is displayed under Account Details (see the screenshot below). Replace the CLOUDINARY_CLOUD_NAME
and CLOUDINARY_API_KEY
variable in the index.html
file in the previous code segments with that name.
Create a Cloudinary Upload Preset
Cloudinary Upload Presets enable you to set up the default behavior of your image uploads. That means that, instead of having to add parameters to apply to your images every time you upload one, you can define tags, transformations, and other analysis presets from your Cloudinary console. Simply specify the preset name in your code and you’re good to go!
To create a preset, go to the Upload Settings screen and click the Add upload preset link:
The Add upload preset screen is then displayed:
Type a name of your choice under Preset name, set Mode to Unsigned, and then specify the other details, as appropriate.
Now go back to the index.html
file and replace CLOUDINARY_UPLOAD_PRESET
with the name of your preset.
Test Uploads to Cloudinary
Now that you've added all your Cloudinary details to the index.html
file, go to your Chrome browser and run your demo app. Afterwards, you'll see this display:
Last updated