Examples

In-Banner

Preview

Code

copy

<script>
  window.srAsyncInit = function() {
    SR({
      partnerID: 'your-streamrail-api-key',
      muted: true,
      autoplay: true,
      contentAutoplay: true,
      loop: true,
      ads: {
        schedule: [{
          position: 'pre-roll',
          server: {
            tag: 'https://cors.streamrail.com/get?url=https://sdk.streamrail.com/demos/vast/nissan.xml'
          }
        }]
      },
      width: 300,
      height: 250,
    });
  };

  (function(d, s, id){
     var js, srjs = d.getElementsByTagName(s)[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement(s); js.id = id;
     js.src = "https://sdk.streamrail.com/player/sr.ads.js";
     srjs.parentNode.insertBefore(js, srjs);
   }(document, 'script', 'streamrail-jssdk'));
</script>