JWPlayer plugin

Introduction

Bradmax analytics supports plugin for JW Player, which collects playback information and sends it to bradmax platform. Reports about video usage from collected data is presented in bradmax client panel (https://bradmax.com/client/panel/).

Integration of bradmax analytics statistics with JW Player is quick and easy process. It needs only plugin file and some additional configuration for player. See example below.

Plugin file

Raw JavaScript file: https://bradmax.com/static/bradmax-analytics-for-players/latest/bradmax.analytics.js

Zipped JavaScript file: https://bradmax.com/static/bradmax-analytics-for-players/latest/bradmax.analytics.zip

Minimal example

Initial steps:

  1. Use plugin JavaScript from https://bradmax.com/static/bradmax-analytics-for-players/latest/bradmax.analytics.js as in example below or copy it to your server and update link to it.
  2. Check clientToken in bradmax client panel (https://bradmax.com/client/panel/ > Analytics > Info > clientToken).
  3. Prepare HTML file
<!DOCTYPE html>
<html>
<head>
    <title>JwPlayer / Bradmax analytics</title>
    <script src="//content.jwplatform.com/libraries/IDzF9Zmk.js"></script>
    <script>
    function initApp() {
        var config = {
            "file": "https://bradmax.com/static/video/tears_of_steel.mp4",
            "image": "https://bradmax.com/static/images/startsplash.jpg",
            "title": "jwplayer plugin for bradmax analytics",
            "description": "downloaded from content.jwplatform.com/videos",
            "plugins": {
                "https://bradmax.com/static/bradmax-analytics-for-players/latest/bradmax.analytics.js": {
                    "clientToken": "SJnO!AzdDggLdOyAIdBg5DIjjeIOMAFd9gADV" /* Copy your token instead of this one. */
                }
            }
        };

        jwplayer("mp4player").setup(config);
    }

    document.addEventListener("DOMContentLoaded", initApp);
    </script>
</head>
<body>
    <h2>JwPlayer / Bradmax analytics</h2>
    <div id="mp4player"></div>
</body>
</html>

Example above will track only general information about playback and only: Audience, Technology and Geo reports will be available.

Tracking video details example

Parameter “mediaMetadata” has to be added into configuration object. See example below. More info about mediaMetadata

var config = {
    "file": "https://bradmax.com/static/video/tears_of_steel.mp4",
    "image": "https://bradmax.com/static/images/startsplash.jpg",
    "title": "jwplayer bradmax analytics ",
    "description": "downloaded from content.jwplatform.com/videos",
    "plugins": {
        "https://bradmax.com/static/bradmax-analytics-for-players/latest/bradmax.analytics.js": {
            "clientToken": "SJnO!AzdDggLdOyAIdBg5DIjjeIOMAFd9gADV",
            "mediaMetadata": {
                "materialId": "701",
                "relatedId": "7001",
                "duration": 734,
                "title": "Tears of steel",
                "tags": ["test", "entertaiment"]
            }
        }
    }
};

Tracking engagement rate example

It is only needed to add parameter

trackEngagementRate: true

into configuration object.

var config = {
    "file": "https://bradmax.com/static/video/tears_of_steel.mp4",
    "image": "https://bradmax.com/static/images/startsplash.jpg",
    "title": "jwplayer bradmax analytics ",
    "description": "downloaded from content.jwplatform.com/videos",
    "plugins": {
        "https://bradmax.com/static/bradmax-analytics-for-players/latest/bradmax.analytics.js": {
            "clientToken": "SJnO!AzdDggLdOyAIdBg5DIjjeIOMAFd9gADV",
            "trackEngagementRate": true,
            "mediaMetadata": {
                "materialId": "701",
                "relatedId": "7001",
                "duration": 734,
                "title": "Tears of steel",
                "tags": ["test", "entertaiment"]
            }
        }
    }
};

Tracking realtime statistics example

It is only needed to add parameter

trackRealtimeStats: true

into configuration object.

var config = {
    "file": "https://bradmax.com/static/video/tears_of_steel.mp4",
    "image": "https://bradmax.com/static/images/startsplash.jpg",
    "title": "jwplayer bradmax analytics ",
    "description": "downloaded from content.jwplatform.com/videos",
    "plugins": {
        "https://bradmax.com/static/bradmax-analytics-for-players/latest/bradmax.analytics.js": {
            "clientToken": "SJnO!AzdDggLdOyAIdBg5DIjjeIOMAFd9gADV",
            "trackEngagementRate": true,
            "trackRealtimeStats": true,
            "mediaMetadata": {
                "materialId": "701",
                "relatedId": "7001",
                "duration": 734,
                "title": "Tears of steel",
                "tags": ["test", "entertaiment"]
            }
        }
    }
};