Installation (Web)
Obtain the appropriate bundle from the download URL provided by AVEQ. The bundle you receive depends on which video player you use:
surfmeter-client-analytics— plain HTML5<video>elementsurfmeter-videojs-analytics— Video.jssurfmeter-shakaplayer-analytics— Google Shaka Playersurfmeter-theoplayer-analytics— THEOplayersurfmeter-chromecast-analytics— Chromecast (CAF Web Receiver)
Add the bundle to your HTML page via a script tag:
<script src="surfmeter-client-analytics-v1.22.0.js"></script>
Replace the filename with the one you have been provided with.
Load the bundle before the player library. The SDK logs the network requests of the player to determine the bitrate of the video in browsers that do not report it otherwise (Firefox and Safari). If the player is loaded first, it can keep its own reference to the browser's fetch function, and the SDK does not see its requests. You can create the analytics instance later, for example when the video starts.
The bundles are the same for all customers. When you create the analytics instance, set the remoteEndpoint option to the address of your analytics server, as described in the usage guide. Without it, the SDK does not send data to your server.
The changelog lists what changed in each version.
Browser support
The bundles use ES2017 JavaScript syntax. We test them in current versions of Chrome, Firefox and Safari. We also tested the plain HTML5 video, Video.js, Shaka Player and Chromecast bundles in Chromium 69. For Chromecast, this test used a replacement for the Cast SDK, not a device.
We have not tested the bundles on Smart TVs. Chromecast devices of the first and second generation use a browser that is too old for these bundles, and the SDK does not support them.
Player prerequisites
Each adapter expects its player library to be loaded separately (via script tag or npm). The adapter bundles do not include the player itself.
- Video.js: Requires
videojs-contrib-quality-levelsfor bitrate/resolution/frame rate tracking. Without it, the adapter still works but collects only standard HTML video element metrics. - Shaka Player:
shakamust be available on the global scope. - THEOplayer: Requires THEOplayer v8+.
THEOplayermust be available on the global scope. - Chromecast: Requires the Google Cast Web Receiver SDK (
cast_receiver_framework.js).