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
1<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:1monitor = datazoom.monitorMillicastView(2 millicastView, { element: videoElement, vmid: MC_MAIN_VMID, amid: MC_MAIN_AMID }3);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:1let mediaElementContext = monitor.getMediaElementContext(videoElement);2if (mediaElementContext) {3 mediaElementContext.setMetadata({ label: MC_MAIN_VMID });4}millicast.View instance managing a single video element:1<!DOCTYPE html>2<html lang="en">34<head>5 <script src="https://cdn.jsdelivr.net/npm/@millicast/sdk@latest/dist/millicast.umd.js"></script>6 <script src='https://platform.datazoom.io/beacon/v1/config?configuration_id=CONFIG_ID'></script>7</head>89<body>1011<div>12 <video id="video" controls autoplay muted style="width:480px;height:270px"></video>13 <hr/>14 <button id="start">Start</button>15</div>1617<script>1819const MC_STREAM_NAME = "multiview";20const MC_ACCOUNT_ID = "k9Mwad";21const MC_MAIN_VMID = "0";22const MC_MAIN_AMID = "1";2324let millicastView;25let monitor;2627async function initMillicastView() {28 const videoElement = document.getElementById("video");29 const tokenGenerator = () => millicast.Director.getSubscriber({30 streamName: MC_STREAM_NAME,31 streamAccountId: MC_ACCOUNT_ID32 });3334 millicastView = new millicast.View(MC_STREAM_NAME, tokenGenerator, videoElement);3536 monitor = datazoom.monitorMillicastView(37 millicastView, { element: videoElement, vmid: MC_MAIN_VMID, amid: MC_MAIN_AMID }38 );3940 let mediaElementContext = monitor.getMediaElementContext(videoElement);41 if (mediaElementContext) {42 mediaElementContext.setMetadata({ label: MC_MAIN_VMID });43 }4445 try {46 await millicastView.connect();47 }48 catch (e) {49 console.log("Connection failed", e);50 }5152 millicastView.webRTCPeer.initStats();53}5455document.getElementById("start").onclick = initMillicastView;5657</script>5859</body>6061</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:1if (monitor) {2 monitor.destroy();3 monitor = null;4}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
-
Audio Track
-
Content Error Count (App Session)
-
Content Media Request Count (App Session)
-
Content Media Request Recency (Content Session)
-
Content Pause Duration (Content Session)
-
Content Playback Duration (Content Session)
-
Content Playback Start Count (App Session)
-
Content Playback Start Recency (Content Session)
-
Content Session Start Timestamp
-
Error Count (App Session)
-
Heartbeat Recency (Content Session)
-
Pause Duration (Content Session)
-
Pause Recency (Content Session)
-
Playback Duration (Content Session)
-
Player State
-
Player Viewable
-
Player Viewable Percent
-
Playhead Position
-
Promo Playback Duration (Content Session)
-
Subtitle Track
- Volume