Examples

VPAID2/HTML5 VPAID

Preview

Code

copy

<div id="ad-container"></div>
<script>
		 window.srAsyncInit = function() {
		 	SR('ad-container', {
		 		partnerID: 'your streamrail api key',
		 		muted: true,
		 		autoplay: true,
		 		content: {
		 			linkUrl: 'http://www.streamrail.com/',
		 			url: 'https://www.streamrail.com/videos/new/bg.mp4'
		 		},
		 		ads: {
		 			schedule: [{
		 				position: 'pre-roll',
		 				server: {
		 					tag: 'https://ssp.streamrail.net/ssp/vpaid/569fa9ee5fbe690002000001/56adedd3b667970002000003?cb=[CB]&pos=[AD_POSITION]&width=[WIDTH]&height=[HEIGHT]&video_duration=[VIDEO_DURATION]&video_description=[VIDEO_DESCRIPTION]&video_url=[VIDEO_URL]&video_id=[VIDEO_ID]&video_title=[VIDEO_TITLE]&autoplay=[AUTOPLAY]&mute=[MUTE]'
		 				}
		 			}]
		 		}
		 	});
		 };

		(function(d, s, id){
		 var js, fjs = 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";
		 fjs.parentNode.insertBefore(js, fjs);
		}(document, 'script', 'streamrail-jssdk'));
</script>