This is the documentation of the "Improve out-stream SDK" project.
- General video player capabilities like muting, pause/ play, timer, advertisement label.
- Make sure existing IMA SDK solutions on the page are conflicting with the outstream solution.
- Preload advertisement and load fallback VAST tag or fallback display ad slot on failure.
- Options:
- Set the player to be initially muted, or not.
- Decide to keep the player open whenever the ad finishes, and even load a display ad after.
- Enable pause or sticky mode when player moves out of view.
- Enable the header bidding solution.
- Poster image.
- Show/ hide animation speed.
- Hide certain video player UI elements.
- Background color.
- Font styles advertisement label.
- Add localization for translatable strings.
- Allow multiple outstream solutions to run on one page.
- Test with Polaris solutions.
<div id="outstream"></div>
<script type="text/javascript">
window['OUTSTREAM_OPTIONS'] = {
'debug': false,
'containerId': 'outstream',
'onEvent': function(event) {
switch (event.name) {
case 'SDK_READY':
// ...
break;
case 'SDK_ERROR':
// ...
break;
}
},
};
(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 = './lib/main.js?v=1';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'idoutstream-jssdk'));
</script>
Web pages including the SDK can be easily debugged by calling the following from within a browser developer console:
idoutstream.openConsole();
The idoutstream
namespace is set when creating the SDK instance.
The SDK is maintained on a public github repository. https://github.com/gamedistribution/improve-out-stream
Deployment of the SDK to production environments is done through TeamCity.
Install the following programs:
Pull in the rest of the requirements using npm:
npm install
Setup a local node server, watch changes and update your browser view automatically:
grunt
Make a production build:
grunt build
All SDK events, which can be hooked into, are described below.
Event | Description |
---|---|
SDK_READY | When the SDK is ready. |
SDK_ERROR | When the SDK has hit a critical error. |
The SDK events are custom ads for handling any thing related to the IMA SDK itself.
Event | Description |
---|---|
AD_SDK_LOADER_READY | When the adsLoader instance is ready to create an adsManager instance |
AD_SDK_MANAGER_READY | When the adsManager instance is ready with ads. |
AD_SDK_REQUEST_ADS | When new ads are requested. |
AD_SDK_ERROR | When the SDK hits a critical error. |
AD_SDK_FINISHED | When the SDK is finished running the ad. |
AD_CANCELED | When the ad is cancelled or stopped because its done running an ad. |
AD_SAFETY_TIMER | When the safety timer is cleared. |
The SDK uses the Google IMA SDK for loading ads. All events of this SDK are also available to the publisher. https://developers.google.com/interactive-media-ads/docs/sdks/html5/
Event | Description |
---|---|
AD_ERROR | When the ad it self has an error. |
AD_BREAK_READY | Fired when an ad rule or a VMAP ad break would have played if autoPlayAdBreaks is false. |
AD_METADATA | Fired when an ads list is loaded. |
ALL_ADS_COMPLETED | Fired when the ads manager is done playing all the ads. |
CLICK | Fired when the ad is clicked. |
COMPLETE | Fired when the ad completes playing. |
CONTENT_PAUSE_REQUESTED | Fired when content should be paused. This usually happens right before an ad is about to cover the content. |
CONTENT_RESUME_REQUESTED | Fired when content should be resumed. This usually happens when an ad finishes or collapses. |
DURATION_CHANGE | Fired when the ad's duration changes. |
FIRST_QUARTILE | Fired when the ad playhead crosses first quartile. |
IMPRESSION | Fired when the impression URL has been pinged. |
INTERACTION | Fired when an ad triggers the interaction callback. Ad interactions contain an interaction ID string in the ad data. |
LINEAR_CHANGED | Fired when the displayed ad changes from linear to nonlinear, or vice versa. |
LOADED | Fired when ad data is available. |
LOG | Fired when a non-fatal error is encountered. The user need not take any action since the SDK will continue with the same or next ad playback depending on the error situation. |
MIDPOINT | Fired when the ad playhead crosses midpoint. |
PAUSED | Fired when the ad is paused. |
RESUMED | Fired when the ad is resumed. |
SKIPPABLE_STATE_CHANGED | Fired when the displayed ads skippable state is changed. |
SKIPPED | Fired when the ad is skipped by the user. |
STARTED | Fired when the ad starts playing. |
THIRD_QUARTILE | Fired when the ad playhead crosses third quartile. |
USER_CLOSE | Fired when the ad is closed by the user. |
VOLUME_CHANGED | Fired when the ad volume has changed. |
VOLUME_MUTED | Fired when the ad volume has been muted. |