- AdSense for Flowplayer
- Plugin initialization
- Plugin configuration
- CSS classes
- Known constraints
- Video advert examples
- Migration from version 1.1.x
- Migration from version 1.0.x
AdSense for Flowplayer
Sign up to the Flowplayer AdSense partnership program to obtain your own AdSense plugin.
- Important The IMA SDK must be loaded exactly as above, not from your own server.
Flowplayer 6.x is required since version v1.1.0 of the plugin.
The plugin is automatically loaded into each player unless disabled explicitly.
Video tag based
The plugin provides the
flowplayer_ima.conf() command for AdSense
configuration of VIDEO tag based installations. As nested JSON
syntax would be too complex to translate into HTML data attributes this
method can be used in an inline SCRIPT tag instead. Especially useful with
automatic installations where you still want to address specific
The above example would look roughly like this in an automatic installation:
Manual installation with jQuery
When installing into jQuery-selected container elements the plugin can be set up either way:
- by specifying
imain the argument to the
flowplayer()jQuery plugin or
- by scripting flowplayer_ima.conf() inside the container
The plugin configuration is simple, flexible and powerful. All settings are
specified in the
ima (Interactive Media Adverts) configuration object.
can be specified
in ascending order of precedence. Higher level configuration persists, unless overridden.
|ima||object||AdSense configuration on this level (global, player, clip).||JSON |
HTML data attribute equivalent: as argument to a
|ima||boolean||If set to ||JSON or HTML data attribute|
These are the top-level plugin configuration options:
|ads||array||A list of advert objects describing timed advert requests, one per advert, for one feature clip.|
|playlist||array||A list of clip level |
Handy for VIDEO tag based playlist installations, as alternative to inlining flowplayer_ima.conf into each playlist item.
|redirects||integer||Maximum number of redirects to try before ad load is aborted. |
|Redirects||integer||Deprecated. Use |
|showTitle||boolean||v2.0.1 For Flowplayer version 6.x only. Whether to display official linear advert title while advert is shown. |
Each object of an
ads array accepts the following options to compose an advert
|time||integer||Where the advert should be positioned. |
In terms of a video advert:
|ad_type||string||The type of advert to show. |
Accepts the following values:
Types can be combined by concatenating them with underscores.
|adsafe||string||How adverts are filtered by their content. |
|adtest||boolean||Set this to |
Accepts also String values
|cust_age||integer||The prefered age target group of the advert. |
Accepts an exact value, and also an age group as per AdWord docs on demographic targeting.
|cust_gender||integer||The prefered gender target group of the advert, as per AdWord docs on demographic targeting. |
|description_url||string||Full URL of a HTML page describing the feature content. |
Default value: site given on signup for our AdSense program.
Giving specific locations is recommended.
|hl||string||The desired language of the ad content. |
Accepts two or three letter language code.
|max_ad_duration||integer||Maximum video advert length in milliseconds. |
Default value: 100 seconds.
|min_ad_duration||integer||Minimum video advert length in milliseconds. |
Default value: 0 seconds.
|overlay||string / boolean||Whether full-slot graphical adverts are allowed. |
Accepted values are:
|sdmax||integer||Maximum skippable video advert length in milliseconds. |
Default value: unlimited.
It is recommended to create metadata pages for each video and supply them as
Please check the best practices and optimization tips.
ima can be configured in the global configuration for all players on
The following option customizes all players on the page and should only be set once in the global configuration:
|enableFlashAds||boolean||v2.1.6 Flash adverts are disabled by default. Setting this to |
|locale||string||The language used by the IMA SDK for UI elements: can be any 2 letter code.|
|Locale||string||Deprecated. Use |
Disabling the plugin
The plugin can be disabled for specific players by setting
the player configuration, or adding the the
data-ima="false" attribute to the
player container element.
Embed code with adverts
To offer embed code which will show adverts on the embedding site you must set up iframe embedding. Try it with this player. Its embed code will show an iframe of this page. The result can be found here.
If you are using our Wordpress plugin, you can upload the asf plugin assests, specify the paths in the Worpdress plugin settings, and configure ad type and time in the video settings.
The plugin assigns the following CSS class names to the container element as state indicators when adverts are shown:
is-ad-visiblewhile an advert is shown
is-ad-nonlinearwhile a non-linear (bottom third overlay) advert is shown
All events give access to the advert via the third argument given in the callback. Information on the ad can be retrieved using the IMA methods listed here.
As per above the notation of Flowplayer ad event types (names) is:
SDK ad event type}
The third argument of the
ima_ad_error event gives direct access to the error
message and error code:
To turn on the IMA SDK's debug logging to the browser console load its debug
ima3_debug.js instead of
- Does not work with manual jQuery installations into multiple containers using a class selector
- Internet Explorer 9 and below is not supported by the Google IMA API
- The plugin only supports the IMA3 HTML5 API
- the Google IMA3 SDK currently does not support skippable ads on iOS
you must have copyright / licenses for your streams
Skippable video ads may only be served in the pre-roll positon (time: 0) or in mid-rolls, provided the duration of the feature exceeds the sum duration of video ads and the feature is at least 10 minutes.
- To show a video advert the feature must have a duration of at least 1 minute.
- To show a non-linear advert the feature must have a duration of at least 30 seconds.
- For further details check your site and setup for compliance with the Google Adsense for Video policies.
- If you're in the EU, make sure to comply with the Google / EU user consent policy
As a publisher, you receive 70% of the Google payout. You will be paid monthly if your accumulated revenue exceeds EUR 100.
Note: Google pays us at the end of a month for the previous month and additionally reserves the right to chargeback within 60 days in case of invalid traffic, so there will be a 60 day delay in payout at the end of a monthly period. If you want to use your own video ad network or your own ad server, you can use our VAST plugin.
Video advert examples
Migration from version 1.1.x
- The plugin does not require the loading of a CSS stylesheet
Migration from version 1.0.x
- The plugin requires Flowplayer version 6.x
- The plugin does not depend on the jQuery library anymore
- The plugin does not need to be initialized explicitly anymore
- The configuration is less complex and slimmed down
no_adsparameters are gone
- Simply specify an
adsarray inside an
imaconfiguration object and possibly some common options on a higher configuration level