videoanalytics.io

HTML5 video analytics

Usage no npm install needed!

<script type="module">
  import videoanalyticsIo from 'https://cdn.skypack.dev/videoanalytics.io';
</script>

README

videoanalytics.io

Build Status Coverage Status dependencies Status devDependencies Status Slack Status

Thanks for checking out the videoanalytics.io npm module. It's still a work-in-progress. Check back soon for updates! If you'd like to contribute to the project, join the Slack group and drop us a line!

Installation

The fastest way to get started is to serve JavaScript from the unpkg CDN:

<!-- Unminified -->
<script src="https://unpkg.com/videoanalytics.io@0.1.3/dist/videoanalytics.io.js"></script>

<!-- Minified -->
<script src="https://unpkg.com/videoanalytics.io@0.1.3/dist/videoanalytics.io.min.js"></script>

If you'd like to use npm, it's as easy as:

npm -i --save videoanalytics.io

Getting Started

const vAnalytics = new VideoAnalyticsIO();
vAnalytics.init((data, done) => {
  // do what you want with data
  console.log(data);
  done();
});

Configuration

vAnalytics.init([options], callback);
  • EVENTS_TO_TRACK: an array of user interactions to track (e.g., play, pause, seek)
  • NUM_DECIMAL_PLACES: an integer for the number of decimal places to round (e.g., 12.68)
  • NUM_EVENTS_BEFORE_SENDING: an integer for the number of events per video to store before calling your provided callback function

The default options can be seen in src/config.defaults.js.

Examples

For full examples, see the examples/ directory.

License

BSD 3-Clause License