@newrelic/video-videojs 4.1.1 → 4.2.0

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 CHANGED
@@ -1,3 +1,31 @@
1
+ ## [4.1.2](https://github.com/newrelic/video-videojs-js/compare/v4.1.1...v4.1.2) (2026-05-11)
2
+
3
+ ### Features
4
+
5
+ - **AWS MediaTailor Support:** Added comprehensive support for AWS MediaTailor SSAI with DASH
6
+ - Implemented MediaTailor tracker with manifest polling and ad tracking
7
+ - Added MediaTailor lab sample for testing and demonstration
8
+ - Enhanced DASH support for MediaTailor integration
9
+ - Added unit test cases for MediaTailor functionality
10
+ - Improved MediaTailor tracker reliability and event handling
11
+
12
+ ### Bug Fixes
13
+
14
+ - **Bitrate Data Types:** Updated bitrate data types for improved accuracy and consistency
15
+ - **Manifest Fetch Error Handling:** Added proper error handling for manifest fetch failures
16
+ - **MediaTailor Configuration:** Moved MediaTailor config variables to global scope for better accessibility
17
+
18
+ ### Documentation
19
+
20
+ - **SSAI Documentation:** Updated SSAI documentation to include MediaTailor integration details
21
+ - **MediaTailor Naming:** Clarified MediaTailor helper and state naming conventions
22
+
23
+ ### Build & Infrastructure
24
+
25
+ - **Release Workflow:** Standardized release workflow with smart detection
26
+ - **Dependencies:** Updated semantic-release dependencies and package-lock.json
27
+ - **Cleanup:** Removed unrelated test infrastructure files, scripts, and dependencies
28
+
1
29
  ## [4.1.1](https://github.com/newrelic/video-videojs-js/compare/v4.1.0...v4.1.1) (2026-04-17)
2
30
 
3
31
  ### Documentation
package/README.md CHANGED
@@ -29,6 +29,7 @@ The New Relic Video.js Tracker provides comprehensive video analytics for applic
29
29
  - [API Reference](#api-reference)
30
30
  - [Bitrate Metrics](#bitrate-metrics)
31
31
  - [Ad Tracking Support](#ad-tracking-support)
32
+ - [SSAI Guide](#ssai-guide)
32
33
  - [Data Model](#data-model)
33
34
  - [Support](#support)
34
35
  - [Contribute](#contribute)
@@ -305,6 +306,53 @@ if (shouldEnableTracking(currentUser.id)) {
305
306
 
306
307
  ## Configuration Options
307
308
 
309
+ ### Ad Tracking
310
+
311
+ `config.ad.type` declares which ad category the tracker should wire up. **If not set, no ad tracking runs** — this is the safe default. Omitting it while passing other options triggers a console warning.
312
+
313
+ #### CSAI — Client-Side Ad Insertion
314
+
315
+ All CSAI frameworks (IMA, Brightcove IMA, Freewheel) share the `adsready` event path. The tracker auto-detects which one is present — no sub-type needed. Just declare `CSAI`.
316
+
317
+ | Value | Constant | Behaviour |
318
+ | -------- | ---------------- | -------------------------------------------------------------------------- |
319
+ | `'csai'` | `AD_TRACKING.CSAI` | Auto-detects: Brightcove IMA → IMA → Freewheel → generic fallback |
320
+
321
+ #### SSAI — Server-Side Ad Insertion
322
+
323
+ Each SSAI platform has its own SDK and a completely different activation path — they cannot be auto-detected. **A sub-type is always required.**
324
+
325
+ | Value | Constant | Behaviour |
326
+ | ------------ | ---------------------- | ----------------------------------------------------------------------- |
327
+ | `'ssai:dai'` | `AD_TRACKING.SSAI.DAI` | Google DAI (`google.ima.dai.api`) |
328
+ | `'ssai:mt'` | `AD_TRACKING.SSAI.MT` | AWS MediaTailor |
329
+
330
+ ```javascript
331
+ import { AD_TRACKING } from '@newrelic/video-videojs';
332
+
333
+ // CSAI — one value covers all client-side frameworks
334
+ new VideojsTracker(player, { config: { ad: { type: AD_TRACKING.CSAI } } });
335
+
336
+ // SSAI — sub-type always required
337
+ new VideojsTracker(player, { config: { ad: { type: AD_TRACKING.SSAI.DAI } } });
338
+ new VideojsTracker(player, { config: { ad: { type: AD_TRACKING.SSAI.MT } } });
339
+
340
+ // SSAI.MT with custom CDN config
341
+ new VideojsTracker(player, {
342
+ config: {
343
+ ad: {
344
+ type: AD_TRACKING.SSAI.MT,
345
+ segmentPrefix: '/my-cdn-path/',
346
+ },
347
+ },
348
+ });
349
+
350
+ // Change at runtime before first loadstart / adsready
351
+ tracker.setAdTracking(AD_TRACKING.CSAI);
352
+ ```
353
+
354
+ > **Extending later:** add a new key to `AD_TRACKING.SSAI` — validation derives from the object automatically. No other changes needed.
355
+
308
356
  ### QoE (Quality of Experience) Settings
309
357
 
310
358
  | Option | Type | Default | Description |
@@ -377,6 +425,18 @@ tracker.setOptions({
377
425
  });
378
426
  ```
379
427
 
428
+ #### `tracker.setAdTracking(type)`
429
+
430
+ Change the ad tracking mode after the tracker is created. Must be called before the first `loadstart` or `adsready` event to take effect.
431
+
432
+ ```javascript
433
+ import { AD_TRACKING } from '@newrelic/video-videojs';
434
+
435
+ // Valid values: 'csai' | 'ssai:dai' | 'ssai:mt'
436
+ tracker.setAdTracking(AD_TRACKING.CSAI);
437
+ tracker.setAdTracking(AD_TRACKING.SSAI.MT);
438
+ ```
439
+
380
440
  ### Example: Complete Integration
381
441
 
382
442
  ```javascript
@@ -436,29 +496,76 @@ The tracker captures four distinct bitrate metrics providing complete quality an
436
496
 
437
497
  ## Ad Tracking Support
438
498
 
439
- The tracker provides comprehensive ad tracking capabilities:
440
-
441
499
  ### Supported Ad Technologies
442
500
 
443
- - **IMA (Interactive Media Ads)** - Google IMA SDK integration
444
- - **Freewheel** - Freewheel ad platform support
445
- - **SSAI (Server-Side Ad Insertion)** - Dynamic Ad Insertion (DAI) support
501
+ | Category | Frameworks detected | Constant |
502
+ |---|---|---|
503
+ | CSAI | Google IMA, Brightcove IMA, Freewheel, generic | `AD_TRACKING.CSAI` |
504
+ | SSAI | Google DAI | `AD_TRACKING.SSAI.DAI` |
505
+ | SSAI | AWS MediaTailor | `AD_TRACKING.SSAI.MT` |
446
506
 
447
- ### SSAI/DAI Integration
507
+ See [Configuration Options → Ad Tracking](#ad-tracking) for full usage and examples.
448
508
 
449
- Server-Side Ad Insertion is fully supported with automatic detection and tracking:
509
+ ### Google DAI Integration
450
510
 
451
511
  ```javascript
452
- // SSAI is automatically detected - no additional configuration needed
453
- const tracker = new VideojsTracker(player, options);
512
+ import { AD_TRACKING } from '@newrelic/video-videojs';
513
+ const tracker = new VideojsTracker(player, { config: { ad: { type: AD_TRACKING.SSAI.DAI } } });
514
+ ```
515
+
516
+ See [samples/dai/index.html](./samples/dai/index.html) for a complete example.
517
+
518
+ ### AWS MediaTailor Integration
519
+
520
+ Supports HLS/DASH, VOD/LIVE, multiple ads per break, quartile tracking, and tracking metadata enrichment.
521
+
522
+ ```javascript
523
+ import { AD_TRACKING } from '@newrelic/video-videojs';
524
+
525
+ player.src({
526
+ src: 'https://your-mediatailor-endpoint.mediatailor.region.amazonaws.com/v1/master/...',
527
+ type: 'application/x-mpegURL'
528
+ });
529
+
530
+ const tracker = new VideojsTracker(player, { config: { ad: { type: AD_TRACKING.SSAI.MT } } });
531
+
532
+ // With custom CDN config
533
+ const tracker = new VideojsTracker(player, {
534
+ config: {
535
+ ad: {
536
+ type: AD_TRACKING.SSAI.MT,
537
+ segmentPrefix: '/my-cdn-path/',
538
+ },
539
+ },
540
+ });
541
+ ```
542
+
543
+ Works with default AWS hostnames and custom CDN domains. See [docs/ssai.md](./docs/ssai.md) for custom CDN setup and advanced options.
544
+
545
+ ## SSAI Guide
546
+
547
+ For customer-facing SSAI integration details, supported MediaTailor behavior, troubleshooting guidance, and sample usage, see [docs/ssai.md](./docs/ssai.md).
548
+
549
+
550
+ ## Testing
551
+
552
+ This project includes comprehensive unit tests for all tracker functionality.
553
+
554
+ ```bash
555
+ # Install dependencies
556
+ npm install
557
+
558
+ # Run tests
559
+ npm test
560
+
561
+ # Run tests with coverage
562
+ npm run test:coverage
454
563
 
455
- // The tracker will automatically capture:
456
- // - Ad breaks, starts, and completions
457
- // - Ad quartiles and click events
458
- // - SSAI-specific metadata
564
+ # Run tests in watch mode
565
+ npm run test:watch
459
566
  ```
460
567
 
461
- **Example:** See [samples/dai/index.html](./samples/dai/index.html) for a complete SSAI implementation.
568
+ For more details, see [test/README.md](./test/README.md).
462
569
 
463
570
  ## Data Model
464
571