npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

flowplayer-vast

v1.1.11

Published

VAST 2.0 support within Flowplayer 6 HTML

Downloads

37

Readme

flowplayer-vast

VAST 2.0 support within Flowplayer 6 HTML

Note: This project is a work in progress and may not fulfill all of the VAST 2.0 spec yet.

Behavior

  1. Create a flowplayer instance like you normally would (make sure you use the playlist feature).
  2. Invoke the attach method to start the vast loading process.
  3. The player will will until the vast load has completed (or failed) and rewrite the playlist.
  • Only the first video returned in the VAST response is used.
  • If the creative is of type "application/javascript" the playlist is left as is and the event vpaid_js is invoked on the player object.
  1. The player will be locked until the ad has been viewed then removed from the playlist.

Simple Usage

This plugin requires that you use the flowplayer playlist functionality.

var vast = require('flowplayer-vast');

var container = document.getElementById('div');

var player = flowplayer(container, {
    playlist: [],
    wmode: 'transparent' // support onclick event for IE for ad clicks
});

vast.init(container, player, 'http://serer.com/vast.xml');

Advanced Usage

var vast = require('flowplayer-vast');

var container = document.getElementById('div');
var playlist = [];

vast.loadPreroll(container, 'http://serer.com/vast.xml', function(preroll){
    if (preroll && preroll.video) {
        playlist.unshift(preroll.video);
    }

    var player = flowplayer(container, {
        playlist: playlist,
        wmode: 'transparent' // support onclick event for IE for ad clicks
    });

    if (preroll) {
        vast.attachEvents(container, player);

        // if you have the flowplayer-vpaid plugin setup
        if (preroll.swf) {
            return player.trigger('vpaid_swf', [preroll.swf]);
        }

        if (preroll.js) {
            return player.trigger('vpaid_js', [preroll.js]);
        }
    }
});

VPAID (JS)

To support vpaid responses for javascript, you can either use the flowplayer-vpaid project or implement your own like so:

player.on('vpaid_js', function (e, config) {
    // configure vpaid environment
});

Changelog

  • 1.1.10: Fix for skipping in Flowplayer 7
  • 1.1.9: Only attach event if element exists
  • 1.1.8: Always disable (if player is auto paused/resume, ads will be skippable)
  • 1.1.7: Fix when there is no title
  • 1.1.6: Fix from last change
  • 1.1.5: Allow pausing and volume changing of ads
  • 1.1.4: Fixes issue on iPad where user is unable to play after clicking ad
  • 1.1.3: Ability to keep preroll in rotation
  • 1.1.2: Timeout for loading vast URL and chrome bug
  • 1.1.0: More granular API, edge case fixes across device
  • 1.0.4: Only mark complete if it has not been skipped
  • 1.0.3: Bug fix
  • 1.0.2: Fixed for vpaid js ads
  • 1.0.1: Moved to browserify
  • 1.0.0: Initial release