Code Monkey home page Code Monkey logo

videojs-vast-vpaid-waterfall's Introduction

videojs-vast-vpaid-waterfall

Allows for VAST and VPAID preroll, midroll, and postroll ads with waterfall. This means that if one ad in an array can't be run for any reason, it will attempt to run the next one.

Installation

Drop the JS and CSS files in the src folder somewhere in your project

Usage

You will need video.js, as well as

* Version must be no later than 0.1.9, as later versions will inexplicably fail

<script src="//path/to/video.min.js"></script>
<script src="//path/to/vast-client.js"></script>
<script src="//path/to/swfobject.js"></script>
<script src="//path/to/VPAIDHTML5Client.js"></script>
<script src="//path/to/VPAIDFLASHClient.js"></script>
<script src="//path/to/videojs-contrib-ads.js"></script>
<script src="//path/to/videojs-vast-vpaid-waterfall.js"></script>
<script>
	var player = videojs("my-video");

	player.vastWaterfall({
		preroll:
		[
			{
				ads: ["https://www.adserver.com/preroll/default/...",
				"https://www.adserver.com/preroll/backup1/...",
				"https://www.adserver.com/preroll/backup2/...",
				"https://www.adserver.com/prerolll/backup3/..."]
			}
		],
		midroll:
		[
			{
				time: 229,
				ads: ["https://www.adserver.com/midroll/default/...",
				"https://www.adserver.com/midroll/backup1/...",
				"https://www.adserver.com/midroll/backup2/...",
				"https://www.adserver.com/midroll/backup3/..."]
			},
			{
				time: 229,
				ads: ["https://www.adserver.com/midroll/default/...",
				"https://www.adserver.com/midroll/backup1/...",
				"https://www.adserver.com/midroll/backup2/...",
				"https://www.adserver.com/midroll/backup3/..."]
			}
		],
		postroll:
		[
			{
				ads: ["https://www.adserver.com/postroll/default/...",
				"https://www.adserver.com/postroll/backup1/...",
				"https://www.adserver.com/postroll/backup2/...",
				"https://www.adserver.com/postrolll/backup3/..."]
			}
		]
	});
</script>

Other options

markers

Adds markers to indicate when midroll markers will happen. Defaults to true. Markers will have the class vjs-midroll-marker, so their appearance can be customized with CSS.

debug

Prints debug messages. Defaults to false

skipDelay

Overrides any skip delay defined in the ad. Will cause a "skip" button to appear after n seconds

flashWrapperPath

Points to the file that will serve as the wrapper for VPAID Flash ads. Defaults to /VPAIDFlash.swf

License

MIT. Copyright (c) DoomTay

videojs-vast-vpaid-waterfall's People

Contributors

doomtay avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.