Application collectors
Dolby OptiView Media Player
v2.6.0 • For the Javascript Collector
The Dolby OptiView Media Player Extension is a configuration option for the Javascript Collector by Datazoom that makes the following additional data points automatically collectable in real time.
Integration Instructions
Datazoom provides plugins for data collection through our Beacon Services. Insert this JS line into your HTML Replace the This inserts Datazoom's data collection SDK into the page. To activate data collection for the Dolby Millicast instance, start monitoring a A For each video element managed by the The following is a complete example of Dolby Millicast integration with a For the If the data collection must be stopped for any reason, invoke the We have made it convenient to manage your collector integration by providing NPM (Node Package Manager) support. Please see installation details here.Plugin Integration
<script src='https://platform.datazoom.io/beacon/v1/config?configuration_id=CONFIG_ID'></script>
CONFIG_ID value with the collector configuration ID.Activate Data Collection for Dolby Millicast
millicast.View instance with the following snippet:monitor = datazoom.monitorMillicastView(
millicastView, { element: videoElement, vmid: MC_MAIN_VMID, amid: MC_MAIN_AMID }
);
millicast.View instance can be used to manage one or multiple video elements. In the call above, in addition to the instance object the details about the primary video element can also be specified as shown above, where vmid and amid are for the corresponding video/audio media ID. millicast.View instance, a Datazoom context is created automatically. The context can be retrieved to use functionalities common to all Datazoom context objects. For example, the context can be used to set custom metadata:let mediaElementContext = monitor.getMediaElementContext(videoElement);
if (mediaElementContext) {
mediaElementContext.setMetadata({ label: MC_MAIN_VMID });
}
millicast.View instance managing a single video element:<!DOCTYPE html>
<html lang="en">
<head>
<script src="https://cdn.jsdelivr.net/npm/@millicast/sdk@latest/dist/millicast.umd.js"></script>
<script src='https://platform.datazoom.io/beacon/v1/config?configuration_id=CONFIG_ID'></script>
</head>
<body>
<div>
<video id="video" controls autoplay muted style="width:480px;height:270px"></video>
<hr/>
<button id="start">Start</button>
</div>
<script>
const MC_STREAM_NAME = "multiview";
const MC_ACCOUNT_ID = "k9Mwad";
const MC_MAIN_VMID = "0";
const MC_MAIN_AMID = "1";
let millicastView;
let monitor;
async function initMillicastView() {
const videoElement = document.getElementById("video");
const tokenGenerator = () => millicast.Director.getSubscriber({
streamName: MC_STREAM_NAME,
streamAccountId: MC_ACCOUNT_ID
});
millicastView = new millicast.View(MC_STREAM_NAME, tokenGenerator, videoElement);
monitor = datazoom.monitorMillicastView(
millicastView, { element: videoElement, vmid: MC_MAIN_VMID, amid: MC_MAIN_AMID }
);
let mediaElementContext = monitor.getMediaElementContext(videoElement);
if (mediaElementContext) {
mediaElementContext.setMetadata({ label: MC_MAIN_VMID });
}
try {
await millicastView.connect();
}
catch (e) {
console.log("Connection failed", e);
}
millicastView.webRTCPeer.initStats();
}
document.getElementById("start").onclick = initMillicastView;
</script>
</body>
</html>
millicast.View instance to start generating detail information about WebRTC stats (periodically), the application should invoke millicastView.webRTCPeer.initStats(); as demonstrated above.Stop Data Collection
destroy() method of the millicast.View monitor (and the underlying Datazoom contexts will be destroyed automatically), as in the following example:if (monitor) {
monitor.destroy();
monitor = null;
}
NPM (Node Package Manager)
Follow this link to learn more about Dolby Optiview.
Ad Frameworks Extensions
If your Javascript application has a media player with an ad framework, Datazoom’s Javascript Collector with a Dolby OptiView Media Player can be extended with the following ad framework extensions.
Supported Data Points
Events
Discrete occurrences driven by user interactions or system actions
Metadata
Attributes
Dolby Millicast
User
Fluxdata
Metrics measuring changing parameters over time
-
Content Session Start Timestamp
-
Current Audio Track
-
Current Subtitles
-
Number of Content Plays
-
Number of Content Requests
-
Number of Errors
-
Number of Errors - Content
-
Pause Duration
-
Pause Duration - Content
-
Playback Duration
-
Playback Duration - Content
-
Playback Duration - Promo
-
Player State
-
Player Viewable
-
Player Viewable Percent
-
Playhead Position
-
Time Since Content Request
-
Time Since Content Started
-
Time Since Last Heartbeat
-
Time Since Last Pause
- Volume