@newrelic/video-videojs 4.2.0 → 4.2.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 CHANGED
@@ -1,3 +1,64 @@
1
+ ## [4.2.1](https://github.com/newrelic/video-videojs-js/compare/v4.2.0...v4.2.1) (2026-06-18)
2
+
3
+ ### Features
4
+
5
+ - **Quality/Rendition Change Tracking:** Added optional support for automatic rendition change detection and reporting
6
+ - Integrated optional `videojs-contrib-quality-levels` plugin for quality level monitoring
7
+ - Implemented automatic rendition change event tracking with bitrate information
8
+ - Added lazy initialization of quality levels plugin support
9
+ - Tracks old and new bitrate during quality transitions
10
+ - Graceful fallback when quality levels plugin is not loaded
11
+
12
+ ### Documentation
13
+
14
+ - **Quality/Rendition Tracking Guide:** Comprehensive documentation for enabling optional quality tracking
15
+ - Installation instructions for `videojs-contrib-quality-levels` plugin
16
+ - Detailed explanation of how the feature works
17
+ - Console debugging information for troubleshooting
18
+ - NRQL query examples for analyzing quality changes
19
+ - Updated README with Quality/Rendition Tracking section
20
+ - Feature Highlights section now includes rendition change tracking
21
+
22
+ ## [4.2.0](https://github.com/newrelic/video-videojs-js/compare/v4.1.2...v4.2.0) (2026-06-10)
23
+
24
+ ### Features
25
+
26
+ - **MediaTailor Custom CDN Support:** Replaced URL-based auto-detection with explicit opt-in
27
+ - Customers now pass `mediatailor: true` (or `mediatailor: { trackingUrl, adSegmentPrefix }`) to enable the tracker — supports both default AWS hostnames and custom CDN domains
28
+ - Added `MT_DEFAULT_AD_SEGMENT_PATH` (`/tm/`) constant for AWS-recommended CDN ad-segment path; ad segments rewritten to a custom CDN domain under `/tm/` are detected automatically
29
+ - `isMediaTailorSegment()` now checks the default AWS segments hostname, the `/tm/` path, and an optional customer-supplied `adSegmentPrefix`
30
+ - Threaded `adSegmentPrefix` through HLS (VHS) and DASH manifest parsing
31
+ - Added explicit session initialisation via `mediatailor: { trackingUrl }` for POST `/v1/session/` flows
32
+
33
+ - **Ad Tracking Configuration:** Introduced `config.ad.type` to control ad tracker selection
34
+ - Exposed `AD_TRACKING` constant with CSAI (flat value covering IMA / Brightcove IMA / Freewheel / generic) and SSAI sub-types (`DAI`, `MT`)
35
+ - SSAI requires an explicit sub-type — each platform needs its own SDK and cannot be auto-detected
36
+ - `SSAI.MT` implies `mediatailor: true`
37
+ - When `config.ad.type` is unset, falls back to CSAI auto-detection with a warning (backward compatible for v4.1.2 users)
38
+ - Co-located `segmentPrefix` and `trackingUrl` under `config.ad`
39
+ - Added `DaiAdsTracker` to static exports
40
+
41
+ - **Logging Improvements:**
42
+ - Exposed `VideojsTracker.Log` as a static so UMD callers can set log level
43
+ - Logs active ad segment detection mode at tracker startup
44
+ - Logs the matched ad segment detection path on first ad break (once per session)
45
+ - Logs which CSAI framework was auto-detected (BrightcoveIma / IMA / Freewheel / generic)
46
+ - Replaced `console.log/warn/error` with `nrvideo.Log` across MediaTailor files
47
+
48
+ ### Bug Fixes
49
+
50
+ - **Buffer End:** Fixed buffer end handling in tracker
51
+ - **Plugin Registration:** Fixed `register-plugin.js` silently dropping the options object and not forwarding it to the `TrackerJS` constructor
52
+
53
+ ### Documentation
54
+
55
+ - **README & SSAI Docs:** Updated for custom CDN support, clarified when `trackingUrl` and `adSegmentPrefix` overrides are needed, cleaned up `sessionId` references
56
+ - **SSAI Troubleshooting:** Corrected `adSegmentPrefix` references to `config.ad.segmentPrefix`
57
+
58
+ ### Samples
59
+
60
+ - **MediaTailor Lab:** Rewrote sample app with a clean minimal UI — license key / app ID / playback URL / format toggle, smart Load button (handles both session init and direct playback URLs), NR log level toggle, debug log showing detected mode, credentials persisted in localStorage
61
+
1
62
  ## [4.1.2](https://github.com/newrelic/video-videojs-js/compare/v4.1.1...v4.1.2) (2026-05-11)
2
63
 
3
64
  ### Features
package/README.md CHANGED
@@ -15,6 +15,7 @@ The New Relic Video.js Tracker provides comprehensive video analytics for applic
15
15
  - 🔧 **Multi-Tech Support** - Works with VHS, hls.js, and Shaka Player
16
16
  - 📈 **QoE Metrics** - Quality of Experience aggregation for startup time, buffering, and playback quality
17
17
  - 🎨 **Event Segregation** - Organized event types: `VideoAction`, `VideoAdAction`, `VideoErrorAction`, `VideoCustomAction`
18
+ - 🌐 **Rendition Change Tracking** - Monitor quality/rendition changes with automatic rendition change event reporting
18
19
  - 🚀 **Easy Integration** - NPM package or direct script include
19
20
 
20
21
  ## Table of Contents
@@ -29,6 +30,7 @@ The New Relic Video.js Tracker provides comprehensive video analytics for applic
29
30
  - [API Reference](#api-reference)
30
31
  - [Bitrate Metrics](#bitrate-metrics)
31
32
  - [Ad Tracking Support](#ad-tracking-support)
33
+ - [Quality/Rendition Tracking](#qualityrendition-tracking)
32
34
  - [SSAI Guide](#ssai-guide)
33
35
  - [Data Model](#data-model)
34
36
  - [Support](#support)
@@ -105,6 +107,9 @@ Before using the tracker, ensure you have:
105
107
  - **New Relic Account** - Active New Relic account with valid application credentials (`beacon`, `applicationId`, `licenseKey`)
106
108
  - **Video.js Player** - Video.js player integrated in your application
107
109
 
110
+ **Optional:**
111
+ - **Quality Tracking Plugin** - To track rendition/quality changes, optionally install `videojs-contrib-quality-levels` (see [Quality/Rendition Tracking](#qualityrendition-tracking) section for details). This is not required — the tracker works perfectly without it.
112
+
108
113
  ## Usage
109
114
 
110
115
  ### Getting Your Configuration
@@ -542,6 +547,89 @@ const tracker = new VideojsTracker(player, {
542
547
 
543
548
  Works with default AWS hostnames and custom CDN domains. See [docs/ssai.md](./docs/ssai.md) for custom CDN setup and advanced options.
544
549
 
550
+ ## Quality/Rendition Tracking
551
+
552
+ The tracker can automatically detect and report rendition (quality) changes when adaptive bitrate (ABR) video is played. This is an **optional feature** — the tracker works perfectly fine without it.
553
+
554
+ ### Optional: Enable Quality Tracking
555
+
556
+ To enable quality/rendition change tracking, install and include the **videojs-contrib-quality-levels** plugin:
557
+
558
+ **Step 1: Install the plugin**
559
+
560
+ ```bash
561
+ npm install videojs-contrib-quality-levels
562
+ ```
563
+
564
+ **Step 2: Include in your HTML** (before the tracker script):
565
+
566
+ ```html
567
+ <!-- Video.js Player -->
568
+ <link href="https://vjs.zencdn.net/7.20.3/video-js.css" rel="stylesheet" />
569
+ <script src="https://vjs.zencdn.net/7.20.3/video.js"></script>
570
+
571
+ <!-- Quality Levels Plugin (Optional - only needed for rendition tracking) -->
572
+ <script src="https://cdn.jsdelivr.net/npm/videojs-contrib-quality-levels/dist/videojs-contrib-quality-levels.min.js"></script>
573
+
574
+ <!-- New Relic Video.js Tracker -->
575
+ <script src="path/to/newrelic-video-videojs.min.js"></script>
576
+ ```
577
+
578
+ ### How It Works
579
+
580
+ When the plugin is enabled:
581
+ - The tracker monitors the quality levels plugin for rendition change events
582
+ - When a rendition change occurs (automatic ABR or user-initiated), a `RENDITION_CHANGE` event is sent to New Relic
583
+ - The event includes quality metadata: bitrate, width, height, and label
584
+ - Quality changes are tracked for both content and ad playback
585
+
586
+ If the plugin is **not** loaded:
587
+ - The tracker continues to work normally
588
+ - All video events are tracked (play, pause, buffering, seeking, etc.)
589
+ - Quality/rendition change events are simply not captured
590
+ - A debug message logs to the console: `[QualityLevels] player.qualityLevels is not a function`
591
+
592
+ ### Console Debugging
593
+
594
+ During development, if the plugin is enabled, the tracker logs quality change events to the console:
595
+
596
+ ```
597
+ [QualityLevels] Plugin initialized successfully
598
+ [QualityLevels] Change event fired!
599
+ [QualityLevels] selectedIndex: 1
600
+ [QualityLevels] Selected level: {width: 1280, height: 720, bitrate: 2500000, …}
601
+ [QualityLevels] Sending rendition changed event
602
+ ```
603
+
604
+ If you see this message instead:
605
+ ```
606
+ [QualityLevels] player.qualityLevels is not a function
607
+ ```
608
+
609
+ It means the plugin is not loaded or not available. This is fine — the tracker will continue tracking all other video metrics.
610
+
611
+ ### NRQL Query Examples
612
+
613
+ When quality tracking is enabled:
614
+
615
+ ```sql
616
+ -- Track rendition changes over time
617
+ SELECT count(*) FROM VideoAction
618
+ WHERE actionName = 'CONTENT_RENDITION_CHANGE'
619
+ FACET contentBitrate SINCE 1 day ago
620
+
621
+ -- Monitor average bitrate during playback
622
+ SELECT average(contentBitrate) FROM VideoAction
623
+ WHERE actionName = 'CONTENT_HEARTBEAT'
624
+ FACET contentRenditionWidth, contentRenditionHeight
625
+ SINCE 1 hour ago
626
+
627
+ -- Analyze quality upgrades vs downgrades
628
+ SELECT contentBitrate FROM VideoAction
629
+ WHERE actionName = 'CONTENT_RENDITION_CHANGE'
630
+ SINCE 24 hours ago
631
+ ```
632
+
545
633
  ## SSAI Guide
546
634
 
547
635
  For customer-facing SSAI integration details, supported MediaTailor behavior, troubleshooting guidance, and sample usage, see [docs/ssai.md](./docs/ssai.md).