https://github.com/apivideo/api.video-videojs-analytics
api.video player analytics plugin for videojs
https://github.com/apivideo/api.video-videojs-analytics
player video video-analytics video-player videojs videojs-plugin
Last synced: 6 months ago
JSON representation
api.video player analytics plugin for videojs
- Host: GitHub
- URL: https://github.com/apivideo/api.video-videojs-analytics
- Owner: apivideo
- License: mit
- Created: 2021-03-23T17:52:17.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-07-30T13:42:52.000Z (about 1 year ago)
- Last Synced: 2025-03-23T19:44:42.208Z (7 months ago)
- Topics: player, video, video-analytics, video-player, videojs, videojs-plugin
- Language: TypeScript
- Homepage: https://api.video
- Size: 384 KB
- Stars: 17
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://twitter.com/intent/follow?screen_name=api_video) [](https://github.com/apivideo/api.video-videojs-analytics) [](https://community.api.video)

 api.video videojs analytics plugin
[api.video](https://api.video) is the video infrastructure for product builders. Lightning fast video APIs for integrating, scaling, and managing on-demand & low latency live streaming features in your app.
## Table of contents
- [Table of contents](#table-of-contents)
- [Project description](#project-description)
- [Getting started](#getting-started)
- [Installation](#installation)
- [Method #1: requirejs](#method-1-requirejs)
- [Method #2: typescript](#method-2-typescript)
- [Method #3: simple include in a javascript project](#method-3-simple-include-in-a-javascript-project)## Project description
video.js plugin to call the api.video analytics collector.
## Getting started
### Installation
#### Method #1: requirejs
If you use requirejs you can add the plugin as a dependency to your project with
```sh
$ npm install --save @api.video/videojs-player-analytics
```You can then use the plugin in your script:
```javascript
var videojs = require('video.js');
var { VideoJsApiVideoAnalytics } = require('@api.video/videojs-player-analytics');videojs.registerPlugin('apiVideoAnalytics', VideoJsApiVideoAnalytics);
const player = videojs('my-video');
player.apiVideoAnalytics();
```#### Method #2: typescript
If you use Typescript you can add the plugin as a dependency to your project with
```sh
$ npm install --save @api.video/videojs-player-analytics
```You can then use the plugin in your script:
```typescript
import videojs from 'video.js';
import { VideoJsApiVideoAnalytics } from '@api.video/videojs-player-analytics';videojs.registerPlugin('apiVideoAnalytics', VideoJsApiVideoAnalytics);
const player = videojs('my-video');
player.apiVideoAnalytics();```
#### Method #3: simple include in a javascript project
Include the plugin in your HTML file like so:
```html
videojs.registerPlugin('apiVideoAnalytics', VideoJsApiVideoAnalytics);
var player = videojs('video-example');
player.apiVideoAnalytics();
```