Skip to content

Commit ae2a45b

Browse files
Merge pull request #28 from newrelic/develop
fix: timeSinceLastError and timeSinceLastAdError added
2 parents 89bc5cc + 1939c77 commit ae2a45b

File tree

2 files changed

+30
-14
lines changed

2 files changed

+30
-14
lines changed

DATAMODEL.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ An Attribute is a piece of data associated with an event. Attributes provide add
6363
| totalAdPlaytime | Total time ad is played for this video session. |
6464
| elapsedTime | Active time video watched between two consecutive heartbeats |
6565
| bufferType | When buffer starts, i.e., initial, seek, pause & connection. |
66+
| timeSinceLastError | Time in milliseconds since the last content error occurred. Only included after an error has occurred. |
6667
| asn | Autonomous System Number: a unique number identifying a group of IP networks that serves the content to the end user. |
6768
| asnLatitude | The latitude of the geographic center of the postal code where the Autonomous System Network is registered. This is not the end user's latitude. |
6869
| asnLongitude | The longitude of the geographic center of the postal code where the Autonomous System Network is registered. This is not the end user's longitude. |
@@ -125,6 +126,7 @@ An Attribute is a piece of data associated with an event. Attributes provide add
125126
| adPartner | The ad partner, e.g., ima, freewheel. |
126127
| isBackgroundEvent | If the player is hidden by another window. |
127128
| bufferType | When buffer starts, i.e., initial, seek, pause & connection. |
129+
| timeSinceLastAdError | Time in milliseconds since the last ad error occurred. Only included after an ad error has occurred. |
128130
| asn | Autonomous System Number: a unique number identifying a group of IP networks that serves the content to the end user. |
129131
| asnLatitude | The latitude of the geographic center of the postal code where the Autonomous System Network is registered. This is not the end user's latitude. |
130132
| asnLongitude | The longitude of the geographic center of the postal code where the Autonomous System Network is registered. This is not the end user's longitude. |

src/tracker.js

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -170,20 +170,34 @@ export default class DashTracker extends nrvideo.VideoTracker {
170170
'qualityChangeRendered',
171171
]);
172172

173-
this.player.on('streamInitialized', this.onReady.bind(this));
174-
this.player.on('playbackMetaDataLoaded', this.onDownload.bind(this));
175-
this.player.on('playbackLoadedData', this.onDownload.bind(this));
176-
this.player.on('canPlay', this.onPlay.bind(this));
177-
this.player.on('playbackPlaying', this.onPlaying.bind(this));
178-
this.player.on('playbackPaused', this.onPause.bind(this));
179-
this.player.on('playbackSeeking', this.onSeeking.bind(this));
180-
this.player.on('playbackSeeked', this.onSeeked.bind(this));
181-
this.player.on('error', this.onError.bind(this));
182-
this.player.on('playbackError', this.onError.bind(this));
183-
this.player.on('playbackEnded', this.onEnded.bind(this));
184-
this.player.on('bufferStalled', this.onBufferingStalled.bind(this));
185-
this.player.on('bufferLoaded', this.onBufferingLoaded.bind(this));
186-
this.player.on('qualityChangeRendered', this.onAdaptation.bind(this));
173+
// BIND LISTENER METHODS
174+
this.onReady = this.onReady.bind(this);
175+
this.onDownload = this.onDownload.bind(this);
176+
this.onPlay = this.onPlay.bind(this);
177+
this.onPlaying = this.onPlaying.bind(this);
178+
this.onPause = this.onPause.bind(this);
179+
this.onSeeking = this.onSeeking.bind(this);
180+
this.onSeeked = this.onSeeked.bind(this);
181+
this.onError = this.onError.bind(this);
182+
this.onEnded = this.onEnded.bind(this);
183+
this.onBufferingStalled = this.onBufferingStalled.bind(this);
184+
this.onBufferingLoaded = this.onBufferingLoaded.bind(this);
185+
this.onAdaptation = this.onAdaptation.bind(this);
186+
187+
this.player.on('streamInitialized', this.onReady);
188+
this.player.on('playbackMetaDataLoaded', this.onDownload);
189+
this.player.on('playbackLoadedData', this.onDownload);
190+
this.player.on('canPlay', this.onPlay);
191+
this.player.on('playbackPlaying', this.onPlaying);
192+
this.player.on('playbackPaused', this.onPause);
193+
this.player.on('playbackSeeking', this.onSeeking);
194+
this.player.on('playbackSeeked', this.onSeeked);
195+
this.player.on('error', this.onError);
196+
this.player.on('playbackError', this.onError);
197+
this.player.on('playbackEnded', this.onEnded);
198+
this.player.on('bufferStalled', this.onBufferingStalled);
199+
this.player.on('bufferLoaded', this.onBufferingLoaded);
200+
this.player.on('qualityChangeRendered', this.onAdaptation);
187201
}
188202

189203
unregisterListeners() {

0 commit comments

Comments
 (0)