Cloudinary Video Player

VAST and VPAID

Ads and monetization documentation

Example Code:

      

        <video
          id="player"
          controls
          muted
          autoplay
          class="cld-video-player"
          width="500"
        ></video>

      
      

        var cld = cloudinary.Cloudinary.new({ cloud_name: 'demo' });

        // Initialize player
        var player = cld.videoPlayer('player', {
          plugins: {
            vastClient: {
              adTagUrl: "https://rtr.innovid.com/r1.5554946ab01d97.36996823;cb={random_number}",
              adCancelTimeout: 5000,
              adsEnabled: true,
              playAdAlways: true
            }
          }
        });

        // Pass a sorter to sort list in alphabetical order by publicId
        var sorter = function(a, b) {
          if (a.publicId < b.publicId) return 1;
          if (a.publicId > b.publicId) return -1;
          return 0;
        };

        // Fetch playlist by tag. Since this operation involves an API call
        // the function returns a Promise when the operation completes.
        // The return value is 'player'.
        player.playlistByTag('demo', {
          sorter: sorter,
          autoAdvance: 0,
          repeat: true
        }).then(function(player) {
          var divElem = document.querySelector("div#playlist-data");
          var list = player.playlist().list().map(function(source) {
            return source.publicId()
          }).join(', ');

          divElem.innerText = "Playlist: " + list
        });