Display Videos
Last updated
Last updated
You need a dashboard to display all the videos uploaded for users to see at a glance. Here, the will come in handy.
Install the cloudinary-react
package via the command line
Open up components/Display.js
and modify the code to be this below:
In the getVideos code above, we take advantage of a very slick Cloudinary trick that helps grab all videos with a particular tag, when using just one tag. Check it out again:
So we if had a tag like vimeo
, our url will end up with .../vimeo.json.
So in the code below, we got all the videos and stored in the videos state like so:
In the render method, we simply just looped through the videos state and passed the public_id of each video into the Cloudinary Video component. The Video component does the job of resolving the public_id from Cloudinary, getting the video url, and displaying it using HTML5 video on the webpage. An added advantage is this: Cloudinary automatically determines the best video type for your browser.
Furthermore, it allows the user have the best experience possible by choosing the best from the range of available video types and resolutions.
You should see the list of all videos. It should be similar to this:
You can also manipulate your videos on the fly, with the help of Cloudinary via the Transformation component.
Info Note: Replace <cloud-name>
in the code above with your cloud name from .
Info Note: By default, a new account has the resource lists disabled. Enable it in the
The Cloudinary React SDK has 4 major components: Image, Video, Transformation and CloudinaryContext. We are interested in the Video and CloudinaryContext for now. explained .