Skip to content

OlympusatDevelopment/polymer-playerlytics

Repository files navigation

Playerlytics Player

Playerlytics is a player polymer component wrapper

on npm: https://www.npmjs.com/package/polymer-playerlytics on github: https://github.com/OlympusatDevelopment/polymer-playerlytics

Getting started

  1. From Command Line run npm i -S polymer-playerlytics
  2. If you're installing thi sin WordPRess, just install it in your theme folder. You may have to npm init there if you don't already have a package.json file set up.

Usage

Everything you need is in this package to make it easier to use in non-bower projects. I think...

  1. In your <head> tag, add this for regular sites:
    <script src="node_modules/polymer-playerlytics/bower_components/webcomponentsjs/webcomponents-loader.js"></script>

    <link href="node_modules/polymer-playerlytics/playerlytics-player.html" rel="import">

And this on WordPress sites (in header.php):

    <script src="<?php echo get_stylesheet_directory_uri(); ?>/node_modules/polymer-playerlytics/bower_components/webcomponentsjs/webcomponents-loader.js"></script>

    <link href="<?php echo get_stylesheet_directory_uri(); ?>/node_modules/polymer-playerlytics/playerlytics-player.html" rel="import">
  1. Now that we've imported the webcomponents polyfill and linked to the playerlytics-player.html file, we can use the custom component in our html files.
    <!-- zmSKL1B1q-c   CMNry4PE93Y -->
    <playerlytics-player video-id="zmSKL1B1q-c" youtube></playerlytics-player> 

About

Playerlytics is a player polymer component wrapper

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published