@newrelic/video-core 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +362 -0
- package/LICENSE.txt +201 -0
- package/README.md +95 -0
- package/THIRD_PARTY_NOTICES.md +825 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.LICENSE.txt +6 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.LICENSE.txt +6 -0
- package/dist/umd/nrvideo.min.js +1 -0
- package/dist/umd/nrvideo.min.js.LICENSE.txt +6 -0
- package/package.json +55 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [3.0.1] - 2025-05-14
|
|
6
|
+
|
|
7
|
+
### Enhancements
|
|
8
|
+
|
|
9
|
+
* **Publishing to npm:** The package can now be published to npm, making it easily accessible.
|
|
10
|
+
|
|
11
|
+
### Build
|
|
12
|
+
|
|
13
|
+
* **Distribution Formats:** Added `cjs`, `esm`, and `umd` builds to the `dist` folder, ensuring compatibility with CommonJS, ES Modules, and UMD module formats.
|
|
14
|
+
|
|
15
|
+
## [3.0.0] - 2025/02/20
|
|
16
|
+
|
|
17
|
+
### New Event Type Introduced [VideoAction, VideoErrorAction, VideoAdAction, VideoCustomAction]
|
|
18
|
+
|
|
19
|
+
- PageAction Deprecated.
|
|
20
|
+
- New Attributes Introduced.
|
|
21
|
+
- The `recordCustomEvent` function is used to send data.
|
|
22
|
+
|
|
23
|
+
## [0.32.4] - 2024/05/08
|
|
24
|
+
|
|
25
|
+
### Fix
|
|
26
|
+
|
|
27
|
+
- Fix `isAd` attribute value in `sendError`.
|
|
28
|
+
|
|
29
|
+
## [0.32.3] - 2023/09/08
|
|
30
|
+
|
|
31
|
+
### Fix
|
|
32
|
+
|
|
33
|
+
- Fix issue in `tracker.customData.deviceType`.
|
|
34
|
+
|
|
35
|
+
## [0.32.2] - 2021/04/27
|
|
36
|
+
|
|
37
|
+
### Update
|
|
38
|
+
|
|
39
|
+
- Improve `totalAdPlaytime`.
|
|
40
|
+
|
|
41
|
+
## [0.32.1] - 2021/04/26
|
|
42
|
+
|
|
43
|
+
### Fix
|
|
44
|
+
|
|
45
|
+
- Only put `totalAdPlaytime` on START.
|
|
46
|
+
|
|
47
|
+
## [0.32.0] - 2021/04/26
|
|
48
|
+
|
|
49
|
+
### Add
|
|
50
|
+
|
|
51
|
+
- Attribute `totalAdPlaytime`.
|
|
52
|
+
|
|
53
|
+
## [0.31.0] - 2021/02/08
|
|
54
|
+
|
|
55
|
+
### Add
|
|
56
|
+
|
|
57
|
+
- Function `state.removeTimeSinceAttribute(...)`, to remove a custom timeSince attribute.
|
|
58
|
+
|
|
59
|
+
## [0.30.0] - 2020/11/18
|
|
60
|
+
|
|
61
|
+
### Fix
|
|
62
|
+
|
|
63
|
+
- Reset `totalPlaytime` after an END.
|
|
64
|
+
|
|
65
|
+
## [0.29.0] - 2020/11/11
|
|
66
|
+
|
|
67
|
+
### Add
|
|
68
|
+
|
|
69
|
+
- Attribute `timeSinceSeekEnd` to BUFFER events.
|
|
70
|
+
|
|
71
|
+
## [0.28.0] - 2020/10/23
|
|
72
|
+
|
|
73
|
+
### Fix
|
|
74
|
+
|
|
75
|
+
- Initial bufferType when video is a live stream.
|
|
76
|
+
|
|
77
|
+
## [0.27.0] - 2020/10/20
|
|
78
|
+
|
|
79
|
+
### Fix
|
|
80
|
+
|
|
81
|
+
- Increment time margin for initial `bufferType`.
|
|
82
|
+
|
|
83
|
+
## [0.26.0] - 2020/10/08
|
|
84
|
+
|
|
85
|
+
### Fix
|
|
86
|
+
|
|
87
|
+
- When buffering happens before START, BUFFER events not being sent.
|
|
88
|
+
|
|
89
|
+
## [0.25.0] - 2020/10/02
|
|
90
|
+
|
|
91
|
+
### Add
|
|
92
|
+
|
|
93
|
+
- Attribute `isBackgroundEvent` to indicate when an event happend during the browser tab is in background.
|
|
94
|
+
|
|
95
|
+
## [0.24.0] - 2020/10/01
|
|
96
|
+
|
|
97
|
+
### Fix
|
|
98
|
+
|
|
99
|
+
- Report `bufferType` as "pause" when it happens right after a RESUME event.
|
|
100
|
+
|
|
101
|
+
## [0.23.0] - 2020/09/29
|
|
102
|
+
|
|
103
|
+
### Add
|
|
104
|
+
|
|
105
|
+
- Method `sendCustom` to send a custom action with a timeSince attribute.
|
|
106
|
+
|
|
107
|
+
## [0.22.0] - 2020/09/01
|
|
108
|
+
|
|
109
|
+
### Fix
|
|
110
|
+
|
|
111
|
+
- Use the same `bufferType` value for both BUFFER events.
|
|
112
|
+
|
|
113
|
+
## [0.21.0] - 2020/08/13
|
|
114
|
+
|
|
115
|
+
### Add
|
|
116
|
+
|
|
117
|
+
- Call `trackerInit` method when a tracker is added.
|
|
118
|
+
|
|
119
|
+
## [0.20.0] - 2020/08/11
|
|
120
|
+
|
|
121
|
+
### Add
|
|
122
|
+
|
|
123
|
+
- `bufferType` attribute to all BUFFER events.
|
|
124
|
+
- `timeSinceResumed` attribute to all BUFFER events.
|
|
125
|
+
|
|
126
|
+
## [0.19.0] - 2020/06/15
|
|
127
|
+
|
|
128
|
+
### Fix
|
|
129
|
+
|
|
130
|
+
- `isInitialBuffering` attribute.
|
|
131
|
+
|
|
132
|
+
## [0.18.0] - 2020/06/15
|
|
133
|
+
|
|
134
|
+
### Fix
|
|
135
|
+
|
|
136
|
+
- `adPosition`, use state.isStarted from parent tracker (contents tracker) to determine current ad position.
|
|
137
|
+
|
|
138
|
+
## [0.17.0] - 2020/05/13
|
|
139
|
+
|
|
140
|
+
### Fix
|
|
141
|
+
|
|
142
|
+
- Minor issues on CAF Receiver environment.
|
|
143
|
+
|
|
144
|
+
## [0.16.0] - 2020/04/30
|
|
145
|
+
|
|
146
|
+
### Update
|
|
147
|
+
|
|
148
|
+
- `diff` package to version 3.5.0.
|
|
149
|
+
|
|
150
|
+
## [0.15.0] - 2020/04/30
|
|
151
|
+
|
|
152
|
+
### Fix
|
|
153
|
+
|
|
154
|
+
- Updated dependencies to fix multiple vulnerabilities reported by `npm audit`.
|
|
155
|
+
|
|
156
|
+
## [0.14.0] - 2020/04/23
|
|
157
|
+
|
|
158
|
+
### Add
|
|
159
|
+
|
|
160
|
+
- Event backend system.
|
|
161
|
+
|
|
162
|
+
## [0.13.0] - 2019/12/03
|
|
163
|
+
|
|
164
|
+
### Fix
|
|
165
|
+
|
|
166
|
+
- Issue with `isInitialBuffering` attribute.
|
|
167
|
+
|
|
168
|
+
## [0.12.0] - 2019/12/02
|
|
169
|
+
|
|
170
|
+
### Add
|
|
171
|
+
|
|
172
|
+
- Add `isInitialBuffering` attribute.
|
|
173
|
+
|
|
174
|
+
## [0.11.0] - 2019/11/22
|
|
175
|
+
|
|
176
|
+
### Fix
|
|
177
|
+
|
|
178
|
+
- Fix issue with AD_BREAK_END and recovering CONTENT tracker state.
|
|
179
|
+
|
|
180
|
+
## [0.10.0] - 2018/02/08
|
|
181
|
+
|
|
182
|
+
### Add
|
|
183
|
+
|
|
184
|
+
- Add `playtimeSinceLastEvent` and `totalPlaytime` as attributes.
|
|
185
|
+
|
|
186
|
+
## [0.9.3] - 2018/01/02
|
|
187
|
+
|
|
188
|
+
### Fix
|
|
189
|
+
|
|
190
|
+
- Fix `isAd` not being correctly reported.
|
|
191
|
+
|
|
192
|
+
## [0.9.2] - 2017/12/19
|
|
193
|
+
|
|
194
|
+
### Fix
|
|
195
|
+
|
|
196
|
+
- Reset `timeSinceAdStart` at `CONTENT_REQUEST`.
|
|
197
|
+
|
|
198
|
+
## [0.9.1] - 2017/11/21
|
|
199
|
+
|
|
200
|
+
### Fix
|
|
201
|
+
|
|
202
|
+
- Fix `Tracker#sendHeartbeat` not passing attributes.
|
|
203
|
+
|
|
204
|
+
### Change
|
|
205
|
+
|
|
206
|
+
- `sendXXXXX` methods from `VideoTracker` will now use `send` internally instead of `emit`.
|
|
207
|
+
- Added a boolean as a parameter in `VideoTracker#getRenditionShift(bool)`. If true, it will store the new rendition. This way you can call `getRenditionShift()` without disrupting `RENDITION_CHANGE` events.
|
|
208
|
+
|
|
209
|
+
## [0.9.0] - 2017/11/10
|
|
210
|
+
|
|
211
|
+
### Add
|
|
212
|
+
|
|
213
|
+
- Add `isPlayerReady` to `VideoTrackerState`.
|
|
214
|
+
- Add `shift` in `*_RENDITION_CHANGE` events. Will report `up` or `down` depending on the change of rendition bitrate since last change.
|
|
215
|
+
|
|
216
|
+
### Remove
|
|
217
|
+
|
|
218
|
+
- Remove `TRACKER_READY` and `PLAYER_INIT` events.
|
|
219
|
+
- Remove `sendPlayerInit` from `VideoTracker`.
|
|
220
|
+
- Remove `timeSincePlayerInit` from `VideoTrackerState`. Use `timeSinceLoad`.
|
|
221
|
+
- Remove `goPlayerInit` and `isPlayerReadying` from `VideoTrackerState`.
|
|
222
|
+
|
|
223
|
+
### Change
|
|
224
|
+
|
|
225
|
+
- First `HEARTBEAT` will now contain `timeSinceLastHeartbeat` counting since it was started.
|
|
226
|
+
- Extend events of `VideoTracker` to cover all posibilities: from `END` to `CONTENT_END` and `AD_END`.
|
|
227
|
+
|
|
228
|
+
## [0.8.0] - 2017/11/03
|
|
229
|
+
|
|
230
|
+
### Add
|
|
231
|
+
|
|
232
|
+
- Add `adCreativeId`, `adPartner` and `contentId/adId` attributes.
|
|
233
|
+
|
|
234
|
+
## [0.7.0] - 2017/11/02
|
|
235
|
+
|
|
236
|
+
### Add
|
|
237
|
+
|
|
238
|
+
- Add `numberOfVideos` attribute, it shows the amount of videos reproduced.
|
|
239
|
+
|
|
240
|
+
### Fix
|
|
241
|
+
|
|
242
|
+
- Fix a bug with `viewId` being incremented ad `CONTENT_START` instead on on `CONTENT_REQUEST`.
|
|
243
|
+
|
|
244
|
+
## [0.6.1] - 2017/10/17
|
|
245
|
+
|
|
246
|
+
### Add
|
|
247
|
+
|
|
248
|
+
- Add `addEventHandler` to `Log.debugCommonVideoEvents`.
|
|
249
|
+
|
|
250
|
+
## [0.6.0] - 2017/10/16
|
|
251
|
+
|
|
252
|
+
### Change
|
|
253
|
+
|
|
254
|
+
- Move `heartbeat` support from `VideoTracker` to `Tracker`.
|
|
255
|
+
|
|
256
|
+
### Fix
|
|
257
|
+
|
|
258
|
+
- Fix minnor bug with `Tracker` class not reporting `customData`.
|
|
259
|
+
|
|
260
|
+
## [0.5.0] - 2017/09/28
|
|
261
|
+
|
|
262
|
+
### Add
|
|
263
|
+
|
|
264
|
+
- `viewSession` attribute.
|
|
265
|
+
- `VideoTrackerState#goViewCountUp` to increment `viewCount`.
|
|
266
|
+
|
|
267
|
+
### Fix
|
|
268
|
+
|
|
269
|
+
- `viewCount` going up BEFORE `CONTENT_END` is sent.
|
|
270
|
+
|
|
271
|
+
### Remove
|
|
272
|
+
|
|
273
|
+
- `VideoTracker#getViewId`.
|
|
274
|
+
|
|
275
|
+
## [0.4.4] - 2017/09/28
|
|
276
|
+
|
|
277
|
+
### Fix
|
|
278
|
+
|
|
279
|
+
- `VideoTracker` not reporting user-defined attributes correctly.
|
|
280
|
+
|
|
281
|
+
## [0.4.3] - 2017/09/26
|
|
282
|
+
|
|
283
|
+
### Add
|
|
284
|
+
|
|
285
|
+
- Expose `Chrono` class.
|
|
286
|
+
|
|
287
|
+
## [0.4.2] - 2017/09/26
|
|
288
|
+
|
|
289
|
+
### Change
|
|
290
|
+
|
|
291
|
+
- Changed `timeSinceTrackerReady` behaviour.
|
|
292
|
+
|
|
293
|
+
### Fix
|
|
294
|
+
|
|
295
|
+
- `TrackerState` class not found error.
|
|
296
|
+
|
|
297
|
+
## [0.4.1] - 2017/09/26
|
|
298
|
+
|
|
299
|
+
### Change
|
|
300
|
+
|
|
301
|
+
- Move `getTrackerName` and `getTrackerVersion` from `VideoTracker` to `Tracker` class.
|
|
302
|
+
|
|
303
|
+
## [0.4.0] - 2017/09/26
|
|
304
|
+
|
|
305
|
+
### Change
|
|
306
|
+
|
|
307
|
+
- Rename `Tracker` to `VideoTracker` and `TrackerState` to `VideoTrackerState`.
|
|
308
|
+
- Create a new `Tracker` intermediate class between `Emitter` and `VideoTracker` to provide support for non-video platforms.
|
|
309
|
+
|
|
310
|
+
## [0.3.1] - 2017/09/20
|
|
311
|
+
|
|
312
|
+
### Added
|
|
313
|
+
|
|
314
|
+
- Add `coreVersion` as attribute for all events.
|
|
315
|
+
|
|
316
|
+
## [0.3.0] - 2017/09/19
|
|
317
|
+
|
|
318
|
+
### Added
|
|
319
|
+
|
|
320
|
+
- Add `getHeartbeat` for `Tracker` class.
|
|
321
|
+
|
|
322
|
+
### Change
|
|
323
|
+
|
|
324
|
+
- Set default hearbeat to 30s.
|
|
325
|
+
|
|
326
|
+
## [0.2.1] - 2017/09/19
|
|
327
|
+
|
|
328
|
+
## Change
|
|
329
|
+
|
|
330
|
+
- If you do not define a heartbeat for an adsTracker, it will take its parent value.
|
|
331
|
+
|
|
332
|
+
## [0.2.0] - 2017/09/18
|
|
333
|
+
|
|
334
|
+
### Add
|
|
335
|
+
|
|
336
|
+
- Add `setOptions` for `Tracker` class.
|
|
337
|
+
|
|
338
|
+
## [0.1.3] - 2017/09/12
|
|
339
|
+
|
|
340
|
+
### Fix
|
|
341
|
+
|
|
342
|
+
- Stop heartbeat when disposing.
|
|
343
|
+
|
|
344
|
+
## [0.1.2] - 2017/08/28
|
|
345
|
+
|
|
346
|
+
### Remove
|
|
347
|
+
|
|
348
|
+
- Remove `adIsFullscreen`, `adIsAutoplayed`, `adIsLive`, `adPlayrate` and `adPreload` attributes from ad events.
|
|
349
|
+
|
|
350
|
+
## [0.1.1] - 2017/08/23
|
|
351
|
+
|
|
352
|
+
### Fix
|
|
353
|
+
|
|
354
|
+
- `Tracker#sendXXXXX` methods, now they distinguish between ads and no ads for `timeSinceXXXX` attrs.
|
|
355
|
+
|
|
356
|
+
### Added
|
|
357
|
+
|
|
358
|
+
- Add `CONTRIBUTING.md` file
|
|
359
|
+
|
|
360
|
+
## [0.1.0] - 2017/08/06
|
|
361
|
+
|
|
362
|
+
- First Version
|
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2019 New Relic, Inc.
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
[](https://github.com/newrelic/open-source-office/blob/master/examples/categories/index.md#community-project)
|
|
2
|
+
|
|
3
|
+
# New Relic Video Core - JavaScript
|
|
4
|
+
|
|
5
|
+
The New Relic video tracking core library is the base for all video trackers in the browser platform. It contains the classes and core mechanisms used by the player specific trackers.
|
|
6
|
+
It segregates the events into different event types based on action, such as video-related events going to `VideoAction`, ad-related events to `VideoAdAction`, errors to `VideoErrorAction`, and custom actions to `VideoCustomAction`.
|
|
7
|
+
|
|
8
|
+
## Build
|
|
9
|
+
|
|
10
|
+
Install dependencies:
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
$ npm install
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
And build:
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
$ npm run build:dev
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Or if you need a production build:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
$ npm run build
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
Add **scripts** inside `dist` folder to your page.
|
|
31
|
+
|
|
32
|
+
> If you want to know how to generate `dist` folder, refer to **npm commands** section.
|
|
33
|
+
|
|
34
|
+
### Registering Trackers
|
|
35
|
+
|
|
36
|
+
`nrvideo` provides a class called `VideoTracker` that will serve as an interface with
|
|
37
|
+
_Browser Agent_, allowing you to manage and send events to New Relic.
|
|
38
|
+
|
|
39
|
+
First of all, you have to add a tracker in the core class:
|
|
40
|
+
|
|
41
|
+
```javascript
|
|
42
|
+
var tracker = new VideoTracker(player);
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Once the tracker is added, any event it emits will be sent to New Relic and processed by the following functions:
|
|
46
|
+
|
|
47
|
+
```javascript
|
|
48
|
+
tracker.sendVideoAction("VideoEvent", { data: 1 });
|
|
49
|
+
tracker.sendVideoAdAction("AdEvent", { data: "test-1" });
|
|
50
|
+
tracker.sendVideoErrorAction("ErrorEvent", { data: "error-test" });
|
|
51
|
+
tracker.sendVideoCustomAction("CustomEvent", { data: "custom-test" });
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Of course, you may want to use built-in events for video. Luckily for you, this core library
|
|
55
|
+
provides an easy way of sending video-related content, using `tracker.sendXXXXX` methods.
|
|
56
|
+
|
|
57
|
+
```javascript
|
|
58
|
+
tracker.sendRequest(); // Will send CONTENT_REQUEST
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Search for `Tracker#sendXXXX` events in the documentation to read more about it.
|
|
62
|
+
|
|
63
|
+
## Data Model
|
|
64
|
+
|
|
65
|
+
To understand which actions and attributes are captured and emitted by the tracker under different event types, see [DataModel.md](./DATAMODEL.md).
|
|
66
|
+
|
|
67
|
+
## Documentation
|
|
68
|
+
|
|
69
|
+
All classes are documented using autodocs. The documents, generated with [jsdoc](https://github.com/jsdoc/jsdoc), can be found in the `documentation` directory of the current repo.
|
|
70
|
+
|
|
71
|
+
# Open source license
|
|
72
|
+
|
|
73
|
+
This project is distributed under the [Apache 2 license](LICENSE).
|
|
74
|
+
|
|
75
|
+
# Support
|
|
76
|
+
|
|
77
|
+
New Relic has open-sourced this project. This project is provided AS-IS WITHOUT WARRANTY OR DEDICATED SUPPORT. Issues and contributions should be reported to the project here on GitHub.
|
|
78
|
+
|
|
79
|
+
We encourage you to bring your experiences and questions to the [Explorers Hub](https://discuss.newrelic.com) where our community members collaborate on solutions and new ideas.
|
|
80
|
+
|
|
81
|
+
## Community
|
|
82
|
+
|
|
83
|
+
New Relic hosts and moderates an online forum where customers can interact with New Relic employees as well as other customers to get help and share best practices. Like all official New Relic open source projects, there's a related Community topic in the New Relic Explorers Hub. You can find this project's topic/threads here:
|
|
84
|
+
|
|
85
|
+
https://discuss.newrelic.com/t/video-core-js-tracker/100303
|
|
86
|
+
|
|
87
|
+
## Issues / enhancement requests
|
|
88
|
+
|
|
89
|
+
Issues and enhancement requests can be submitted in the [Issues tab of this repository](../../issues). Please search for and review the existing open issues before submitting a new issue.
|
|
90
|
+
|
|
91
|
+
# Contributing
|
|
92
|
+
|
|
93
|
+
Contributions are encouraged! If you submit an enhancement request, we'll invite you to contribute the change yourself. Please review our [Contributors Guide](CONTRIBUTING.md).
|
|
94
|
+
|
|
95
|
+
Keep in mind that when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant. If you'd like to execute our corporate CLA, or if you have any questions, please drop us an email at opensource+videoagent@newrelic.com.
|