1.0.21 • Published 5 years ago

storyteq-connector-jw-player v1.0.21

Weekly downloads
5
License
ISC
Repository
github
Last release
5 years ago

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 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.

parametertypedescriptionrequired
videoPlayerIdstringThe id of the HTML-element where the video player should be loaded.yes
videoHashstringThe hash used to directly retrieve the video and send analytics events to.not required if videoParameterName or mediaData is filled
videoParameterNamestringThe URL parameter where the hash is obtained from.not required if videoHash or mediaData is filled
mediaDatajsonThe full media data if already previously obtained from the API.not required if videoHash or videoParameterName is filled
mediaidstringJWPlayer mediaid, used for JWPlayer tracking.no
dataCallbackFunctionstringThe 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
verboseboolEnable console logging for the connector.no
defaultUrlsobjectDefine fallback URL's for when no hash is provided in the URL.no
playerSetupobjectDefine 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.

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago