GithubHelp home page GithubHelp logo

bbbo / flowplayer-ima Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thatguystone/flowplayer-ima

0.0 3.0 0.0 436 KB

A simple Interactive Media Ads plugin for FP

License: GNU General Public License v3.0

flowplayer-ima's Introduction

Flowplayer plugin for basic Google Interactive Media Ads (IMA/VAST) support

Provides basic support for VAST ads. You can only give it a URL to some VAST xml, and it will play whatever it finds in there.

If you need to schedule ads in your clips, or schedule prerolls, or anything like that, feel free to write it and open a pull request, or if enough people want it, I'll look into it.

Usage

In a Playlist

You can use the plugin just like any other streaming plugin:

flowplayer("fp", "http://releases.flowplayer.org/swf/flowplayer-3.2.16.swf", {
	plugins: {
		ima: {
			url: "flowplayer.ima-3.2.7.swf"
		}
	},

	playlist: [
		{
			provider: 'ima',
			url: 'http://ad.doubleclick.net/pfadx/N270.132652.1516607168321/B3442378.3;dcadv=1379578;sz=0x0;ord=79879;dcmt=text/xml'
		},
		{
			url: 'http://pseudo01.hddn.com/vod/demo.flowplayervod/Extremists.flv'
		}
	]
});

Force Playing

If you're feeling daring, you can FORCE flowplayer to play your clip; be careful as this overrides everything and just plays the clip, no matter what.

	f = flowplayer('player'...)
	f.getPlugin('ima').playAd('http://some/path/to/vast.xml');

Compile

Add this as a plugin to your flowplayer compilation (how to compile flowplayer is outside this scope), and update your BuiltInConfig.as with the following:

	package  {
		import com.iheart.ima.InteractiveMediaAdsProvider;

		public class BuiltInConfig {
			private var ima:InteractiveMediaAdsProvider;

			public static const config:Object = {
					ima: {
						"url": "com.iheart.ima.InteractiveMediaAdsProvider"
					}
				}
			};
		}
	}

And in your build.properties file for flowplayer (NOT the plugin) add:

	plugin-swc=/path/to/ima/lib/

Fun Bugs

There's currently a bug in FP's JS api, however, that causes the plugin not to have any external methods applied to it. To fix this, you have to do:

	f.getPlugin('ima')._fireEvent('onUpdate');

Then you can continue use as normal.

Downloadable Plugin

You can find it here. You can use it just like any other plugin in flowplayer.

	plugins: {
		ima: {
			url: 'flowplayer.ima-3.2.7.swf'
		}
	}

flowplayer-ima's People

Contributors

thatguystone avatar

Watchers

 avatar  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.