# storyteq-connector-jw-player

> A JWPlayer connector for the StoryTEQ API to simplify video loading, parameter values and video analytics.

Latest version **1.0.21** (published 2019-09-17) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install storyteq-connector-jw-player
pnpm add storyteq-connector-jw-player
yarn add storyteq-connector-jw-player
bun add storyteq-connector-jw-player
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.21 |
| Published | 2019-09-17 |
| First published | 2018-06-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 29 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | teq@storyteq.com |
| Maintainers | storyteq_user |
| Keywords | storyteq, storyteq-api, storyteq-connector, jwplayer, storyteq-jwplayer |

## Links

- npm: https://www.npmjs.com/package/storyteq-connector-jw-player
- Repository: https://github.com/storyteq/storyteq-connector-jw-player
- Homepage: https://github.com/storyteq/storyteq-connector-jw-player#readme
- Issues: https://github.com/storyteq/storyteq-connector-jw-player/issues
- npm.io page: https://npm.io/package/storyteq-connector-jw-player

## Recent versions

- 1.0.21 (latest) — 2019-09-17
- 1.0.20 — 2019-06-28
- 1.0.19 — 2019-04-16
- 1.0.18 — 2019-03-20
- 1.0.17 — 2019-02-27
- 1.0.16 — 2019-02-27
- 1.0.15 — 2018-12-24
- 1.0.14 — 2018-12-13
- 1.0.13 — 2018-12-12
- 1.0.12 — 2018-10-30
- 1.0.11 — 2018-07-12
- 1.0.10 — 2018-07-02
- 1.0.9 — 2018-07-02
- 1.0.8 — 2018-07-02
- 1.0.7 — 2018-06-11
- … 7 more at https://npm.io/package/storyteq-connector-jw-player/versions

## README

# storyteq-connector-jw-player
A JWPlayer connector for the StoryTEQ API to simplify the loading of video data and tracking video analytics. The connector uses the unique hash generated by StoryTEQ API when creating a video as a reference to load video data and generate analytics. 

The analytics are visible in the StoryTEQ dashboard which is currently in beta. Please [contact us](mailto:teq@storyteq.com) if you haven't received a login yet.

## Dependencies
Loading the connector into your page is fairly easy, you can include the script directly from our CDN. Make sure to include the  script in the head of your page like this:
```
<script  type="text/javascript"  src="https://storage.googleapis.com/storyteq/platform/connector/storyteq-connector-jw-player.min.js"></script>
```
Otherwise you can install the connector as an npm package using the following command:
```
npm install storyteq-connector-jw-player
```
Or manually import the connector by downloading this repository.
```
<script  type="text/javascript"  src="storyteq-connector-jw-player.js"></script>
```
Altough JW player is included in the connector, it's possible to use your own JW player license (version 8). In that case please include the StoryTEQ connector after loading your own JW player.
```
<script type="text/javascript" src="https://content.jwplatform.com/libraries/aBC1DEf2.js"></script>
<script type="text/javascript" src="https://storage.googleapis.com/storyteq/platform/connector/storyteq-connector-jw-player.min.js"></script>
```
## Usage
After loading the script into your page, the connector needs to be configured. This is done by defining values for a few parameters in the following fashion:

```
var connector = new StoryteqConnectorJwPlayer({
	videoPlayerId : 'jwplayer',
	videoParameterName : 'key'
});
``` 
Not all parameters are required. Please check out the table below and  ```example.html``` in this repository for an example of a fully specced connector.

|parameter|type|description|required|
|--|--|--|--|
|videoPlayerId|string|The id of the HTML-element where the video player should be loaded.|yes|
|videoHash|string|The hash used to directly retrieve the video and send analytics events to.|not required if videoParameterName or mediaData is filled|
|videoParameterName|string|The URL parameter where the hash is obtained from.|not required if videoHash or mediaData is filled|
|mediaData|json|The full media data if already previously obtained from the API.|not required if videoHash or videoParameterName is filled|
|mediaid|string|JWPlayer mediaid, used for JWPlayer tracking.|no|
|dataCallbackFunction|string|The name of the function which is called after video data has been loaded from the StoryTEQ API. This video data can for example be used for greeting the visitor with a personal message or prefilling a form. Video data parameter keys are similar to your template parameter keys.|no|
|verbose|bool|Enable console logging for the connector.|no|
|defaultUrls|object|Define fallback URL's for when no hash is provided in the URL.|no|
|playerSetup|object|Define other player properties according to https://developer.jwplayer.com/jw-player/docs/developer-guide/customization/configuration-reference/|no|
## Testing
If everything is set up correctly, you can test the connector. To create a valid URL, attach the videoParameterName as a GET parameter to your base URL, then add the video's unique hash as a value. For example:
```
https://domain.com?key=9e0627ae3c707b451c9ac8e1408563a1
```
When you visit your page, the generated video should automatically be loaded.
## Support
If you run into trouble using the connector, please [contact us](mailto:teq@storyteq.com).

---
_Source: https://npm.io/package/storyteq-connector-jw-player · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
