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

videojsadx

v3.2.1

Published

Adx ads integration for VideoJS

Downloads

31

Readme

Installation

  • Install with npm npm i videojsadx OR
  • Add hosted code link in https://cdn.jsdelivr.net/npm/videojsadx@[version_number]/dist/videojsadx.js

Additionally have to add this script in "head"

<script src="https://imasdk.googleapis.com/js/sdkloader/ima3.js"></script>

Description

VideoJS AdX combines videojs, video-ima, cotrib-ads to simply display videos with AdX integration

Usage

Call function with your parameters

<div class="stpd-video-container" id="video-container-1">
  <script>
    window.stpdVideo = window.stpdVideo || { que: [] };
    window.stpdVideo.que.push(function() {
    return window.stpdVideo.setConfig({
      videoSrc: 'https://example.com/uploads/my-video.mp4',
      thumbnailSrc: 'https://signe.stpd.io/wp-content/uploads/2023/06/1667-11.jpg',
      thumbnailTitle: 'Video title',
      initialAutoplay: true,
      muted: false,
      playlist: [
        { videoSrc: 'https://example.com/uploads/my-video-1.mp4', thumbnailSrc: 'https://example.com/uploads/my-video-thumbnail-1.jpg', thumbnailTitle:'Video title 1' },
        { videoSrc: 'https://example.com/uploads/my-video-2.mp4', thumbnailSrc: 'https://example.com/uploads/my-video-thumbnail-2.jpg' },
        { videoSrc: 'https://example.com/uploads/my-video-3.mp4', thumbnailSrc: 'https://example.com/uploads/my-video-thumbnail-3.jpg' }
      ],
      playlistAutoTitles: true,
      playlistAutoplay: true,
      miniPlayer: [
        { showOnlyOnAds: false, width: '400px', position: 'br', spacing: ['50px', '50px'] }
      ],
      miniPlayerMobile: [
        { showOnlyOnAds: false, width: '60%', position: 'bl', spacing: ['100px', '50%'] }
      ],
      adUnit: 'http://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&output=xml_vmap1&unviewed_position_start=1&cust_params=sample_ar%3Dpremidpostpod%26deployment%3Dgmf-js&cmsid=496&vid=short_onecue&correlator=',
      overlayAdElement: '<' + 'div id="my-ad">\n' +
              '<' + 'script type="text/javascript">\n' +
              'console.log("triggering some banner");\n' +
              '<' + '/script>\n' +
              '<' + '/div>',
      debug: true
    }, 'video-container-1');
    });
  </script>
</div>

Parameter description:

  • <div class="stpd-video-container" id="video-container-1">

    • For multiple insertions change ID's for each element.
  • }, 'video-container-1');

    • If ID changed, change here as well
  • videoSrc:

    • Initial video on page load
  • thumbnailSrc:

    • Initial video thumbnail
  • thumbnailTitle:

    • Initial video title
  • initialAutoplay:

    • Autoplay on page load
  • muted:

    • Play with sound on page load (NB! If initial autoplay also is turned on, video won't autoplay until users first interaction with page (click) because of global enhancing user experience policy.)
  • playlist:

    • Can be removed if no playlist required.
    • Initial video automatically included as the first playlist element
    • videoSrc:
      • Video source for playlist item
    • thumbnailSrc:
      • Thumbnail source for playlist item
      • If video source local, thumbnail will be autogenerated if not provided
    • thumbnailTitle:
      • Video title for playlist item
      • If any of playlist items has title, others will be auto populated
  • playlistAutoTitles:

    • Automatically populate playlist items with titles even if none provided
  • playlistAutoplay:

    • Playlist autoplay
  • miniPlayer:

    • DESKTOP
    • Can be removed if no mini player required.
    • showOnlyOnAds:
      • Show mini player only when ad is playing or all the time.
    • width:
      • Mini player width (px / % / ect). Height will be adjusted to aspect ratio.
    • position:
      • Values: { tl / tr / bl / br }
    • spacing:
      • Values: [ { t / b } px / % / ect , { l / r } px / % / ect ]
  • miniPlayerMobile:

    • MOBILE
    • Can be removed if no mini player required.
    • showOnlyOnAds:
      • Show mini player only when ad is playing or all the time.
    • width:
      • Mini player width (px / % / ect). Height will be adjusted to aspect ratio.
    • position:
      • Values: { tl / tr / bl / br }
    • spacing:
      • Values: [ { t / b } px / % / ect , { l / r } px / % / ect ]
  • adUnit:

    • AdX ad unit.
  • overlayAdElement:

    • Overlay Ad tag code (with divs and stuff). (!NB code only. If this is not an independent code, all calls need to be added manually)
  • watermark:

    • Values { true / false / URL } (Setupad logo enabled by default)
  • debug:

    • Can be removed if no debug required