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

@dominicpascal/inplayer-paywall

v3.0.2

Published

Forked inplayer.com paywall library

Downloads

4

Readme

InPlayer Paywall v3

For of inplayer.com paywall library

inplayer.com

Installation

Install the package from npm and import it in your project.

npm install --save @inplayer-org/paywall

Alternately include the script like so:

<script src="https://assets.inplayer.com/paywall/0.1.0/paywall.min.js"></script>

Loading an asset with an ID

// Basic example  InPlayerPaywall(merchantUUID, [Object{id, ...options}])

<script>
  var paywall = new InplayerPaywall('c6f4002f-7415-4eb6-ab03-72b0f7aff0e8',
     [
      {
        id: 40112
      }
     ]
)
</script>

Loading an asset with external ID

<script>
  // This id is an external one, the type has to be specified as well.
  var paywall = new InplayerPaywall('c6f4002f-7415-4eb6-ab03-72b0f7aff0e8',
     [
      {
         external: {
            type: 'brightcove',
            id: 5784466086001,
         },
      },
     ]
)
</script>

Main available ASSET options

  • noPreview
  • brandingId

Example:

<script>
  // No preview option and branding option
  var paywall = new InplayerPaywall('c6f4002f-7415-4eb6-ab03-72b0f7aff0e8',
     [
      {
        id: 40112,
        noPreview: true, // Default is false - the preview wont show if enabled
        brandingId: "51424", // Enables usage of branding different than the default one
      }
     ]
)
</script>

Additional ASSET options

  • Additional CSS/JS scripts import
  • Additional Query Params for asset initialization

Example:

// Importing scripts (CSS/JS)

<script>
  var paywall = new InplayerPaywall('c6f4002f-7415-4eb6-ab03-72b0f7aff0e8',
     [
      {
        id: 40112,
        noPreview: true, // Default is false - the preview wont show if enabled
        brandingId: "51424", // Enables usage of branding different than the default one
        options: {
           scripts: [
             {  src: 'https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js',
                type: 'script',
                id: 'my-custom-id',
                async: false //whether the script should be loaded async (default=true)
             },
             {
                href: 'https://ajax.googleapis.com/jquery.mobile.min.css',
                type: 'css',
             }             
           ],
        }
      }
     ]
)
</script>

// Adding Query Params in the request for the asset
<script>
  var paywall = new InplayerPaywall('c6f4002f-7415-4eb6-ab03-72b0f7aff0e8',
     [
      {
        id: 40112,
        noPreview: true, // Default is false - the preview wont show if enabled
        brandingId: "51424", // Enables usage of branding different than the default one
        options: {
          params: {
            language: 'en',
            myParam: 'any value'
          }
        }
      }
     ]
)
</script>

Additional Paywall options

  • default paywall language
  • show/hide the user menu
  • show/hide the logo in the modal

Example:

<script>
  // InplayerPaywall(merchant UUID, [Object{id, ...opts}], {...opts})
  var paywall = new InplayerPaywall('c6f4002f-7415-4eb6-ab03-72b0f7aff0e8',
     [
      {
         id: 1234
      },
     ],
     {
       language: 'EN',//sets the default language
       hideUserMenu: true, // hides the user menu dropdown (default=false)
       hideLogo: true, //hides the logo in the modal header (default=false)
     }
)
</script>

Standalone Paywall functions

  • setLanguage
  • setLoginScreen
  • setRegisterScreen
  • setMyAccountScreen
  • showPaywall
  • logoutUser

Example:

<script>
  var paywall = new InplayerPaywall('c6f4002f-7415-4eb6-ab03-72b0f7aff0e8',
     [
      {
         id: 1234
      },
     ],
  );

  paywall.setLanguage('EN'); //sets the active paywall language
  paywall.setLoginScreen(); //displays the paywall login screen
  paywall.logoutUser(); //logs out the logged in user
  paywall.setRegisterScreen(); //displays the register screen
  paywall.setMyAccountScreen(); //displays the my account screen (the user needs to be authenticated)
  paywall.showPaywall(); //displays the paywall (same as when you would click on the buy button)
</script>