{"id":28207,"date":"2021-06-07T19:33:27","date_gmt":"2021-06-07T19:33:27","guid":{"rendered":"http:\/\/Video-Slideshow-Generation-with-Cloudinary"},"modified":"2021-06-07T19:33:27","modified_gmt":"2021-06-07T19:33:27","slug":"video-slideshow-generation-with-cloudinary","status":"publish","type":"post","link":"https:\/\/cloudinary.com\/blog\/guest_post\/video-slideshow-generation-with-cloudinary\/","title":{"rendered":"Video Slideshow Generation with Cloudinary"},"content":{"rendered":"<div class=\"wp-block-cloudinary-markdown \"><p>When you have an e-commerce site or you want to add some visual customization for your users, creating a video slideshow with specific images can be a nice touch. If you have existing images and videos, all of them can be combined to make something special for your users and potentially increase your sales and user retention.<\/p>\n<p>In this article, we\u2019ll walk through how to make a custom video slideshow using Cloudinary. If you don\u2019t have a Cloudinary account already, you can <a href=\"https:\/\/cloudinary.com\/users\/register\/free\">sign up for a free one<\/a> and start adding images and videos that you can use for your website.<\/p>\n<p>When you log into your account, you\u2019ll be taken to the Dashboard. From there, navigate to the Media Library. This is where you can add any images and videos you want to use.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/jesse-thisdot\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/v1622901988\/e-603fc55d218a650069f5228b\/nwkwly6aslcxcqau4ggt.png\" alt=\"the media library view in your Cloudinary account\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"2000\" height=\"1153\"\/><\/p>\n<h2>Setting up the project<\/h2>\n<p>We\u2019ll be making a simple page to show custom videos to different users with React. To start, open a terminal (I\u2019m using <a href=\"https:\/\/code.visualstudio.com\/download\">VSCode<\/a>) and run:<\/p>\n<pre class=\"js-syntax-highlighted\"><span><code class=\"hljs shcb-wrap-lines\">npx create-react-app video-generator\ncd video-generator\n<\/code><\/span><\/pre>\n<p>You can delete the CSS files and remove the associated import statements in the <em>App.jsx<\/em> and <em>index.js<\/em> files.<\/p>\n<p>With your Cloudinary account and our newly created React app, we can start making custom slideshows!<\/p>\n<h2>Making a slideshow<\/h2>\n<p>In the <em>App.jsx<\/em> file, you can delete everything and just follow along here. First, we need to install the <code>styled-components<\/code> package so that we can arrange the videos on a page with some CSS-in-JS.<\/p>\n<pre class=\"js-syntax-highlighted\"><span><code class=\"hljs shcb-wrap-lines\">npm i styled-components\n<\/code><\/span><\/pre>\n<p>Now let\u2019s import a couple of packages at the top of the <em>App.jsx<\/em> file.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\"><span class=\"hljs-keyword\">import<\/span> React <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">\"react\"<\/span>;\n<span class=\"hljs-keyword\">import<\/span> styled <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">\"styled-components\"<\/span>;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>Next, we can create the <code>App<\/code> component and export it.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\"><span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">App<\/span>(<span class=\"hljs-params\"><\/span>) <\/span>{}\n\n<span class=\"hljs-keyword\">export<\/span> <span class=\"hljs-keyword\">default<\/span> App;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>Let\u2019s say you have data that shows the products people look at the most frequently on your site and you want to show three videos on your home page that highlights them. We\u2019ll start by making a couple of styled-components, one to style our videos and one to contain those videos.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\"><span class=\"hljs-keyword\">const<\/span> Video = styled.video<span class=\"hljs-string\">`\n  height: 200px;\n  padding: 24px;\n  width: 350px;\n`<\/span>;\n\n<span class=\"hljs-keyword\">const<\/span> VideoContainer = styled.div<span class=\"hljs-string\">`\n  display: flex;\n  flex-wrap: wrap;\n  justify-content: space-between;\n  width: 100%;\n`<\/span>;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>With these styled-components in place, we can start working on creating the video slideshows with Cloudinary.<\/p>\n<h3>Defining the slideshow elements<\/h3>\n<p>Videos are created using this URL syntax given in the <a href=\"https:\/\/cloudinary.com\/documentation\/video_slideshow_generation\">Cloudinary docs<\/a>:<\/p>\n<p><a href=\"https:\/\/res.cloudinary.com\/\">https:\/\/res.cloudinary.com\/<\/a><code>cloudname<\/code>\/video\/upload\/fn_render:<code>global-settings<\/code>;vars_(<code>slide-settings<\/code>(<code>individual-slide<\/code>))\/<code>global-transformations<\/code>\/<code>template<\/code>.<code>ext<\/code><\/p>\n<p>You can get the <code>cloudname<\/code> from your Cloudinary console.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/jesse-thisdot\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/v1622902235\/e-603fc55d218a650069f5228b\/ydbbkhgtdgcm7pf03zys.png\" alt=\"your cloud name in the Cloudinary console\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"634\" height=\"310\"\/><\/p>\n<p>The <code>global-settings<\/code> are general settings applied to your video, like the height and width that Cloudinary should return as well as the duration that the video should be.<\/p>\n<p>The <code>slide-settings<\/code> are responsible for the settings that apply to each slide. This will include things like how long the image is shown before switching to the next one, what kind of transition is applied between slides, and how long the transition lasts.<\/p>\n<p>The <code>individual-slide<\/code> section is how you add images or videos based on their <code>public_id<\/code> to your slideshow. We\u2019ll use this to add the specific images we want a little later.<\/p>\n<p>The <code>global-transformations<\/code> are how you can take advantage of the regular transformations Cloudinary has available, like automatically adjusting the quality of the video so that it\u2019s optimized for your users.<\/p>\n<p>The <code>template<\/code> is how we let Cloudinary know we\u2019re going to create a video slideshow. You\u2019ll need to upload the <a href=\"https:\/\/res.cloudinary.com\/demo\/video\/upload\/slideshow.clt\">template for the slideshow<\/a>.<\/p>\n<p><em>Since video slideshow generation is a beta feature, this is the only template you can work with for now.<\/em><\/p>\n<h3>Slideshow with only images<\/h3>\n<p>With that background info on how slideshow generation works, let\u2019s start adding a few things to our React app.<\/p>\n<p>Inside of the <code>App<\/code> component, we\u2019re going to add a new object with the parameters we need to pass to Cloudinary to generate our video. This will contain the <em>height<\/em>, <em>width<\/em>, <em>video duration<\/em>, <em>slide duration<\/em>, <em>transition duration<\/em>, and <em>images<\/em> you want to show in the video. We\u2019ll also create an array containing the <code>public_id<\/code> of each image we want to show in the slideshow.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\"><span class=\"hljs-keyword\">const<\/span> vidVars = {\n  <span class=\"hljs-attr\">w<\/span>: <span class=\"hljs-number\">500<\/span>,\n  <span class=\"hljs-attr\">h<\/span>: <span class=\"hljs-number\">500<\/span>,\n  <span class=\"hljs-attr\">du<\/span>: <span class=\"hljs-number\">15<\/span>,\n  <span class=\"hljs-attr\">sdur<\/span>: <span class=\"hljs-number\">3000<\/span>,\n  <span class=\"hljs-attr\">tdur<\/span>: <span class=\"hljs-number\">1500<\/span>,\n};\n\n<span class=\"hljs-keyword\">const<\/span> vidA = &#91;<span class=\"hljs-string\">\"3dogs\"<\/span>, <span class=\"hljs-string\">\"reindeer\"<\/span>, <span class=\"hljs-string\">\"cat\"<\/span>];\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>Now let\u2019s add the first video using our styled-components.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml shcb-wrap-lines\">return (\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">VideoContainer<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">Video<\/span> <span class=\"hljs-attr\">controls<\/span>&gt;<\/span>\n      <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">source<\/span>\n        <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\">{<\/span>`<span class=\"hljs-attr\">https:<\/span>\/\/<span class=\"hljs-attr\">res.cloudinary.com<\/span>\/<span class=\"hljs-attr\">milecia<\/span>\/<span class=\"hljs-attr\">video<\/span>\/<span class=\"hljs-attr\">upload<\/span>\/<span class=\"hljs-attr\">fn_render:w_<\/span>${\n          <span class=\"hljs-attr\">vidVars.w<\/span>\n        };<span class=\"hljs-attr\">h_<\/span>${<span class=\"hljs-attr\">vidVars.h<\/span>};<span class=\"hljs-attr\">du_<\/span>${<span class=\"hljs-attr\">vidVars.du<\/span>};<span class=\"hljs-attr\">vars_<\/span>(<span class=\"hljs-attr\">sdur_<\/span>${<span class=\"hljs-attr\">vidVars.sdur<\/span>};<span class=\"hljs-attr\">tdur_<\/span>${\n          <span class=\"hljs-attr\">vidVars.tdur<\/span>\n        };<span class=\"hljs-attr\">transition_s:circlecrop<\/span>;<span class=\"hljs-attr\">slides_<\/span>(${<span class=\"hljs-attr\">vidA<\/span>\n          <span class=\"hljs-attr\">.map<\/span>((<span class=\"hljs-attr\">mediaDoc<\/span>) =&gt;<\/span> `(media_i:${mediaDoc})`)\n          .join(\";\")}))\/f_auto,q_auto\/slideshow_hlhpzw.mp4`}\n        type=\"video\/mp4\"\n      \/&gt;\n      Your browser does not support the video tag.\n    <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">Video<\/span>&gt;<\/span>\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">VideoContainer<\/span>&gt;<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p><strong>Make sure you get the exact name of the slideshow template from your Media Library. You\u2019ll need to update the name in the URL we created. It will be something different from <code>slideshow_hlhpzw.mp4<\/code>.<\/strong><\/p>\n<p>We\u2019ve taken advantage of template strings in JavaScript to dynamically generate the slideshow URL for us using the general video settings object we created and the array of the public IDs of our images.<\/p>\n<p>If you run the app with the <code>npm start<\/code> command in your terminal, you should see something similar to this.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/jesse-thisdot\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/v1622902139\/e-603fc55d218a650069f5228b\/yzumxiidouf6tkr4bzbu.png\" alt=\"first video slideshow\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"1628\" height=\"886\"\/><\/p>\n<p>With the first video in place, let\u2019s add a couple more arrays defining the images we want to display in the other two slideshows.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\"><span class=\"hljs-keyword\">const<\/span> vidB = &#91;<span class=\"hljs-string\">\"reindeer\"<\/span>, <span class=\"hljs-string\">\"3dogs\"<\/span>, <span class=\"hljs-string\">\"dessert\"<\/span>];\n\n<span class=\"hljs-keyword\">const<\/span> vidC = &#91;<span class=\"hljs-string\">\"beach-boat\"<\/span>, <span class=\"hljs-string\">\"3dogs\"<\/span>, <span class=\"hljs-string\">\"reindeer\"<\/span>];\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>Now that we know the images we\u2019re going to show, let\u2019s go ahead and add the other two videos using the styled component.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml shcb-wrap-lines\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">Video<\/span> <span class=\"hljs-attr\">controls<\/span>&gt;<\/span>\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">source<\/span>\n    <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\">{<\/span>`<span class=\"hljs-attr\">https:<\/span>\/\/<span class=\"hljs-attr\">res.cloudinary.com<\/span>\/<span class=\"hljs-attr\">milecia<\/span>\/<span class=\"hljs-attr\">video<\/span>\/<span class=\"hljs-attr\">upload<\/span>\/<span class=\"hljs-attr\">fn_render:w_<\/span>${\n      <span class=\"hljs-attr\">vidVars.w<\/span>\n    };<span class=\"hljs-attr\">h_<\/span>${<span class=\"hljs-attr\">vidVars.h<\/span>};<span class=\"hljs-attr\">du_<\/span>${<span class=\"hljs-attr\">vidVars.du<\/span>};<span class=\"hljs-attr\">vars_<\/span>(<span class=\"hljs-attr\">sdur_<\/span>${<span class=\"hljs-attr\">vidVars.sdur<\/span>};<span class=\"hljs-attr\">tdur_<\/span>${\n      <span class=\"hljs-attr\">vidVars.tdur<\/span>\n    };<span class=\"hljs-attr\">transition_s:circlecrop<\/span>;<span class=\"hljs-attr\">slides_<\/span>(${<span class=\"hljs-attr\">vidB<\/span>\n      <span class=\"hljs-attr\">.map<\/span>((<span class=\"hljs-attr\">mediaDoc<\/span>) =&gt;<\/span> `(media_i:${mediaDoc})`)\n      .join(\";\")}))\/f_auto,q_auto\/slideshow_hlhpzw.mp4`}\n    type=\"video\/mp4\"\n  \/&gt;\n  Your browser does not support the video tag.\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">Video<\/span>&gt;<\/span>\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">Video<\/span> <span class=\"hljs-attr\">controls<\/span>&gt;<\/span>\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">source<\/span>\n    <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\">{<\/span>`<span class=\"hljs-attr\">https:<\/span>\/\/<span class=\"hljs-attr\">res.cloudinary.com<\/span>\/<span class=\"hljs-attr\">milecia<\/span>\/<span class=\"hljs-attr\">video<\/span>\/<span class=\"hljs-attr\">upload<\/span>\/<span class=\"hljs-attr\">fn_render:w_<\/span>${\n      <span class=\"hljs-attr\">vidVars.w<\/span>\n    };<span class=\"hljs-attr\">h_<\/span>${<span class=\"hljs-attr\">vidVars.h<\/span>};<span class=\"hljs-attr\">du_<\/span>${<span class=\"hljs-attr\">vidVars.du<\/span>};<span class=\"hljs-attr\">vars_<\/span>(<span class=\"hljs-attr\">sdur_<\/span>${<span class=\"hljs-attr\">vidVars.sdur<\/span>};<span class=\"hljs-attr\">tdur_<\/span>${\n      <span class=\"hljs-attr\">vidVars.tdur<\/span>\n    };<span class=\"hljs-attr\">transition_s:circlecrop<\/span>;<span class=\"hljs-attr\">slides_<\/span>(${<span class=\"hljs-attr\">vidC<\/span>\n      <span class=\"hljs-attr\">.map<\/span>((<span class=\"hljs-attr\">mediaDoc<\/span>) =&gt;<\/span> `(media_i:${mediaDoc})`)\n      .join(\";\")}))\/f_auto,q_auto\/slideshow_hlhpzw.mp4`}\n    type=\"video\/mp4\"\n  \/&gt;\n  Your browser does not support the video tag.\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">Video<\/span>&gt;<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>Now that you have all three videos in your app, you should see something like this in your browser.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/jesse-thisdot\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/v1622902168\/e-603fc55d218a650069f5228b\/q1vv7bpvk0smhwzjsfof.png\" alt=\"all three slideshows in the flexbox\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"2000\" height=\"715\"\/><\/p>\n<p>This is how we handle slideshow generation with just images, but we do have the option to include videos within our slideshows as well.<\/p>\n<h3>Slideshow with images and videos<\/h3>\n<p>Adding a video to the slideshow means we change a few settings in the URL we generate.<\/p>\n<p>Instead of using <code>media_i:public_id<\/code>, we\u2019ll have to use <code>media_v:public_id;type_s:video<\/code>. This will tell Cloudinary that the asset we\u2019re using is a video and it will be handled accordingly.<\/p>\n<p>We\u2019ll add an object with two arrays, one containing the images and the other containing the videos, to our <code>App<\/code> component.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\"><span class=\"hljs-keyword\">const<\/span> vidD = {\n  <span class=\"hljs-attr\">images<\/span>: &#91;<span class=\"hljs-string\">\"reindeer\"<\/span>, <span class=\"hljs-string\">\"sample\"<\/span>],\n  <span class=\"hljs-attr\">videos<\/span>: &#91;<span class=\"hljs-string\">\"elephants\"<\/span>, <span class=\"hljs-string\">\"sea-turtle\"<\/span>],\n};\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>Lastly, we\u2019ll add one more <code>&lt;Video&gt;<\/code> to the component.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php shcb-wrap-lines\">&lt;Video controls&gt;\n  &lt;source\n    src={`https:<span class=\"hljs-comment\">\/\/res.cloudinary.com\/milecia\/video\/upload\/fn_render:w_${<\/span>\n      vidVars.w\n    };h_${vidVars.h};du_${vidVars.du};vars_(sdur_${vidVars.sdur};tdur_${\n      vidVars.tdur\n    };transition_s:circlecrop;slides_(${vidD.images\n      .map((mediaDoc) =&gt; `(media_i:${mediaDoc})`)\n      .join(<span class=\"hljs-string\">\";\"<\/span>)}${vidD.videos\n      .map((mediaDoc) =&gt; `(media_v:${mediaDoc};type_s:video)`)\n      .join(<span class=\"hljs-string\">\";\"<\/span>)}))\/f_auto,q_auto\/slideshow_hlhpzw.mp4`}\n    type=<span class=\"hljs-string\">\"video\/mp4\"<\/span>\n  \/&gt;\n  Your browser does not support the video tag.\n&lt;\/Video&gt;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<h2>Completed code<\/h2>\n<p>You can take a look at the complete code in <a href=\"https:\/\/codesandbox.io\/s\/wonderful-moser-87hlf\">this CodeSandbox<\/a> or <a href=\"https:\/\/github.com\/flippedcoder\/blog-examples\">clone the GitHub repo<\/a>!<\/p>\n<\/div>\n  \n  <div class=\"wp-block-cloudinary-code-sandbox \">\n    <iframe\n      src=\"https:\/\/codesandbox.io\/embed\/wonderful-moser-87hlf?theme=dark&amp;codemirror=1&amp;highlights=&amp;editorsize=50&amp;fontsize=14&amp;expanddevtools=0&amp;hidedevtools=0&amp;eslint=0&amp;forcerefresh=0&amp;hidenavigation=0&amp;initialpath=%2F&amp;module=%2Fsrc%2FApp.js&amp;moduleview=0&amp;previewwindow=&amp;view=&amp;runonclick=1\"\n      height=\"500\"\n      style=\"width: 100%;\"\n      title=\"react-video-slideshow\"\n      loading=\"lazy\"\n      allow=\"accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking\"\n      sandbox=\"allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts\"\n    ><\/iframe>\n  <\/div>\n\n  <div class=\"wp-block-cloudinary-markdown \"><h2>Conclusion<\/h2>\n<p>Working with videos can be tricky, but Cloudinary does make it easier. Keep in mind that this is a beta feature, so it\u2019ll likely change a bit later.<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":41,"featured_media":28208,"comment_status":"","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_cloudinary_featured_overwrite":false,"footnotes":""},"categories":[1],"tags":[134,370,177,246,371,303],"class_list":["post-28207","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-guest-post","tag-image","tag-javascript","tag-react","tag-under-review","tag-video"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.6 (Yoast SEO v26.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Video Slideshow Generation with Cloudinary<\/title>\n<meta name=\"description\" content=\"You can create your own custom video slideshows with images you already have quickly using Cloudinary. In this article, we&#039;ll set up a few different slideshows showing you how to create your own videos.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudinary.com\/blog\/guest_post\/video-slideshow-generation-with-cloudinary\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Video Slideshow Generation with Cloudinary\" \/>\n<meta property=\"og:description\" content=\"You can create your own custom video slideshows with images you already have quickly using Cloudinary. In this article, we&#039;ll set up a few different slideshows showing you how to create your own videos.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudinary.com\/blog\/guest_post\/video-slideshow-generation-with-cloudinary\/\" \/>\n<meta property=\"og:site_name\" content=\"Cloudinary Blog\" \/>\n<meta property=\"article:published_time\" content=\"2021-06-07T19:33:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681925114\/Web_Assets\/blog\/9a0e589e1797b5229fbfcf4c8bd03dff32ce054e-1000x420-1_282088baa2\/9a0e589e1797b5229fbfcf4c8bd03dff32ce054e-1000x420-1_282088baa2.png?_i=AA\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"420\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"NewsArticle\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/video-slideshow-generation-with-cloudinary\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/video-slideshow-generation-with-cloudinary\/\"},\"author\":{\"name\":\"\",\"@id\":\"\"},\"headline\":\"Video Slideshow Generation with Cloudinary\",\"datePublished\":\"2021-06-07T19:33:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/video-slideshow-generation-with-cloudinary\/\"},\"wordCount\":5,\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/video-slideshow-generation-with-cloudinary\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681925114\/Web_Assets\/blog\/9a0e589e1797b5229fbfcf4c8bd03dff32ce054e-1000x420-1_282088baa2\/9a0e589e1797b5229fbfcf4c8bd03dff32ce054e-1000x420-1_282088baa2.png?_i=AA\",\"keywords\":[\"Guest Post\",\"Image\",\"Javascript\",\"React\",\"Under Review\",\"Video\"],\"inLanguage\":\"en-US\",\"copyrightYear\":\"2021\",\"copyrightHolder\":{\"@id\":\"https:\/\/cloudinary.com\/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/video-slideshow-generation-with-cloudinary\/\",\"url\":\"https:\/\/cloudinary.com\/blog\/guest_post\/video-slideshow-generation-with-cloudinary\/\",\"name\":\"Video Slideshow Generation with Cloudinary\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/video-slideshow-generation-with-cloudinary\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/video-slideshow-generation-with-cloudinary\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681925114\/Web_Assets\/blog\/9a0e589e1797b5229fbfcf4c8bd03dff32ce054e-1000x420-1_282088baa2\/9a0e589e1797b5229fbfcf4c8bd03dff32ce054e-1000x420-1_282088baa2.png?_i=AA\",\"datePublished\":\"2021-06-07T19:33:27+00:00\",\"description\":\"You can create your own custom video slideshows with images you already have quickly using Cloudinary. In this article, we'll set up a few different slideshows showing you how to create your own videos.\",\"breadcrumb\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/video-slideshow-generation-with-cloudinary\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudinary.com\/blog\/guest_post\/video-slideshow-generation-with-cloudinary\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/video-slideshow-generation-with-cloudinary\/#primaryimage\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681925114\/Web_Assets\/blog\/9a0e589e1797b5229fbfcf4c8bd03dff32ce054e-1000x420-1_282088baa2\/9a0e589e1797b5229fbfcf4c8bd03dff32ce054e-1000x420-1_282088baa2.png?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681925114\/Web_Assets\/blog\/9a0e589e1797b5229fbfcf4c8bd03dff32ce054e-1000x420-1_282088baa2\/9a0e589e1797b5229fbfcf4c8bd03dff32ce054e-1000x420-1_282088baa2.png?_i=AA\",\"width\":1000,\"height\":420},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/video-slideshow-generation-with-cloudinary\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudinary.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Video Slideshow Generation with Cloudinary\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\",\"url\":\"https:\/\/cloudinary.com\/blog\/\",\"name\":\"Cloudinary Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cloudinary.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\",\"name\":\"Cloudinary Blog\",\"url\":\"https:\/\/cloudinary.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA\",\"width\":312,\"height\":60,\"caption\":\"Cloudinary Blog\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Video Slideshow Generation with Cloudinary","description":"You can create your own custom video slideshows with images you already have quickly using Cloudinary. In this article, we'll set up a few different slideshows showing you how to create your own videos.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cloudinary.com\/blog\/guest_post\/video-slideshow-generation-with-cloudinary\/","og_locale":"en_US","og_type":"article","og_title":"Video Slideshow Generation with Cloudinary","og_description":"You can create your own custom video slideshows with images you already have quickly using Cloudinary. In this article, we'll set up a few different slideshows showing you how to create your own videos.","og_url":"https:\/\/cloudinary.com\/blog\/guest_post\/video-slideshow-generation-with-cloudinary\/","og_site_name":"Cloudinary Blog","article_published_time":"2021-06-07T19:33:27+00:00","og_image":[{"width":1000,"height":420,"url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681925114\/Web_Assets\/blog\/9a0e589e1797b5229fbfcf4c8bd03dff32ce054e-1000x420-1_282088baa2\/9a0e589e1797b5229fbfcf4c8bd03dff32ce054e-1000x420-1_282088baa2.png?_i=AA","type":"image\/png"}],"twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/video-slideshow-generation-with-cloudinary\/#article","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/video-slideshow-generation-with-cloudinary\/"},"author":{"name":"","@id":""},"headline":"Video Slideshow Generation with Cloudinary","datePublished":"2021-06-07T19:33:27+00:00","mainEntityOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/video-slideshow-generation-with-cloudinary\/"},"wordCount":5,"publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/video-slideshow-generation-with-cloudinary\/#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681925114\/Web_Assets\/blog\/9a0e589e1797b5229fbfcf4c8bd03dff32ce054e-1000x420-1_282088baa2\/9a0e589e1797b5229fbfcf4c8bd03dff32ce054e-1000x420-1_282088baa2.png?_i=AA","keywords":["Guest Post","Image","Javascript","React","Under Review","Video"],"inLanguage":"en-US","copyrightYear":"2021","copyrightHolder":{"@id":"https:\/\/cloudinary.com\/#organization"}},{"@type":"WebPage","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/video-slideshow-generation-with-cloudinary\/","url":"https:\/\/cloudinary.com\/blog\/guest_post\/video-slideshow-generation-with-cloudinary\/","name":"Video Slideshow Generation with Cloudinary","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/video-slideshow-generation-with-cloudinary\/#primaryimage"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/video-slideshow-generation-with-cloudinary\/#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681925114\/Web_Assets\/blog\/9a0e589e1797b5229fbfcf4c8bd03dff32ce054e-1000x420-1_282088baa2\/9a0e589e1797b5229fbfcf4c8bd03dff32ce054e-1000x420-1_282088baa2.png?_i=AA","datePublished":"2021-06-07T19:33:27+00:00","description":"You can create your own custom video slideshows with images you already have quickly using Cloudinary. In this article, we'll set up a few different slideshows showing you how to create your own videos.","breadcrumb":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/video-slideshow-generation-with-cloudinary\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudinary.com\/blog\/guest_post\/video-slideshow-generation-with-cloudinary\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/video-slideshow-generation-with-cloudinary\/#primaryimage","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681925114\/Web_Assets\/blog\/9a0e589e1797b5229fbfcf4c8bd03dff32ce054e-1000x420-1_282088baa2\/9a0e589e1797b5229fbfcf4c8bd03dff32ce054e-1000x420-1_282088baa2.png?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681925114\/Web_Assets\/blog\/9a0e589e1797b5229fbfcf4c8bd03dff32ce054e-1000x420-1_282088baa2\/9a0e589e1797b5229fbfcf4c8bd03dff32ce054e-1000x420-1_282088baa2.png?_i=AA","width":1000,"height":420},{"@type":"BreadcrumbList","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/video-slideshow-generation-with-cloudinary\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudinary.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Video Slideshow Generation with Cloudinary"}]},{"@type":"WebSite","@id":"https:\/\/cloudinary.com\/blog\/#website","url":"https:\/\/cloudinary.com\/blog\/","name":"Cloudinary Blog","description":"","publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudinary.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/cloudinary.com\/blog\/#organization","name":"Cloudinary Blog","url":"https:\/\/cloudinary.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA","width":312,"height":60,"caption":"Cloudinary Blog"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":""}]}},"jetpack_featured_media_url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681925114\/Web_Assets\/blog\/9a0e589e1797b5229fbfcf4c8bd03dff32ce054e-1000x420-1_282088baa2\/9a0e589e1797b5229fbfcf4c8bd03dff32ce054e-1000x420-1_282088baa2.png?_i=AA","_links":{"self":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/28207","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/comments?post=28207"}],"version-history":[{"count":0,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/28207\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media\/28208"}],"wp:attachment":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media?parent=28207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/categories?post=28207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/tags?post=28207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}