Flowplayer · Intro before feature with advert

A non-advert intro and a feature with an advert pre-roll.

<head/>

Include the ASF assets after loading all other Flowplayer assets:

<!-- Flowplayer -->
<script src="//releases.flowplayer.org/7.0.4/flowplayer.min.js"></script>
 
<!-- Flowplayer hlsjs plugin -->
<script src="//releases.flowplayer.org/hlsjs/flowplayer.hlsjs.min.js"></script>
 
<!-- Google IMA SDK -->
<script src="//imasdk.googleapis.com/js/sdkloader/ima3.js"></script>
<!-- Flowplayer ASF plugin -->
<script src="//releases.flowplayer.org/asf/flowplayer.org/2.1.6/asf.min.js"></script>

HTML

asf.min.js is the AdSense plugin for Flowplayer - you will get your own version of it when you sign up with our AdSense program. This plugin will be tied to your personal ad slot so that the ad impressions and clicks will be associated with your account, and the ad revenue will be assigned to you.

This page uses //releases.flowplayer.org/asf/flowplayer.org/2.1.6/asf.min.js which was built for the flowplayer.org domain and its subdomains. Make sure you are using the build we created for you, otherwise you will not see any revenues.

<style>

.flowplayer {
background-image: url(//flowplayer.com/media/img/logo-blue.png);
background-size: 95%;
background-color: #fff !important;
-webkit-box-shadow: 0 0 20px #b8b8b8;
-moz-box-shadow: 0 0 20px #b8b8b8;
box-shadow: 0 0 20px #b8b8b8;
}

CSS

<script>

Adverts are shown where and when you configure them. In this case a pre-roll for the second clip.

window.onload = function () {
 
flowplayer("#player", {
 
// asf configuration for this player
ima: {
// make the Google robots crawl the current page
description_url: location.href,
 
// this should only be set when you are testing your installation
adtest: true
},
 
splash: true,
playlist: [{
 
// no ads in for intro clip
 
rtmp: "rtmp://s3b78u0kbtx79q.cloudfront.net/cfx/st",
sources: [
{ type: "video/mp4", src: "//edge.flowplayer.org/black/470x250.mp4" },
{ type: "video/flash", src: "mp4:black/470x250" }
]
}, {
 
// set up adverts for second clip
ima: {
ads: [{
// a pre-roll advert for this feature
time: 0,
ad_type: "standardvideo",
max_ad_duration: 60000
}]
},
 
sources: [
{ type: "application/x-mpegurl", src: "//edge.flowplayer.org/drive.m3u8" },
{ type: "video/mp4", src: "//edge.flowplayer.org/drive.mp4" }
]
}]
});
 
};

JavaScript

<body/>

<div id="player"></div>

HTML

AdSense for Flowplayer demos