...
to 1: Instantiate the API object
The The correct site code must be setup. The site code is delivered by the owner of the streaming solution.
Code Block borderColor grey bgColor #eeeeee borderStyle solid lang javascript var sensors = new SpringStreams("site code");
- One instance of the object
SpringStreams
has to be setup once on the framework. From there, one or more streams can be transmitted to the measurement by thetrack
method.
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
var sensors = new SpringStreams("test"); |
test
= The site code in this case is “test”. You have to replace the site code "test" by the site code (unique name provided by springKantar) for the measured site.
To measure any player – even proprietary ones – an adapter to the specific player can be used to pass on data to the sensors of the measurement system. This adapter provides the following three functions:
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
var sensors = new SpringStreams("test"); |
test
= The site code in this case is “test”. You have to replace the site code “test” by the site code (unique name provided by springKantar) for the measured site.
A media player embedded into the website can now be measured directly. For this, the object which is to be measured is required. In most cases this will be available through the id
of the object’s tag. In the following example an object with the ID wmplayer
with a reference to the Windows Media Player is being used.
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
var sensors = new SpringStreams("test"); |
test
is the identification of the website in this case. This identification has to be replaced by the own identification provided by springKantar.
A video
- or audio
element (see: http://www.w3schools.com/tags/ref_av_dom.asp) embedded into the website can now be measured directly. In order to perform the measurement, the object to be measured is needed. Usually this is available via the id
of the object-tag. In this example, the object with the ID video5
is used with a reference to an HTML video element.
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
var sensors:SpringStreams = new SpringStreams("test"); |
test
= The site code in this case is “test”. You have to replace the site code “test” by the site code (unique name provided by springKantar) for the measured site.
The measurements are passed on via an http call to the measurement systems. In the case that this call should be done via SSL (HTTPS) this can be achieved by passing on this information to the sensor:
...