---
title: Media agent for Video JS v5.0.0
source: https://docs.newrelic.com/docs/release-notes/streaming-browser-release-notes/streaming-browser-agent-videojs-26-09-17
---

-   **Breaking change:** This release adds a `package.json#exports` map. Deep imports into internal paths of this package will no longer resolve — only the root export (`@newrelic/video-videojs-js`) and the new `/browser` subpath are valid import targets. Update any direct deep-imports before upgrading.

### New features

-   **`/browser` subpath export:** A `@newrelic/video-videojs-js/browser` entry point is now available that excludes unused Vega/connected-device code, reducing bundle size for browser consumers.
-   **`notifyAdSkipped()` (MediaTailor):** Host apps with a custom skip-ad UI can report a user-initiated skip. Emits the skipped ad-end event when in an ad; no-op otherwise. Mirrors the equivalent API on the iOS/Android trackers.
-   **`stopTracking()` (MediaTailor):** Reversible teardown that stops polling and unregisters listeners without disposing the tracker, so it can be resumed later. Shares the method name used by the iOS/Android trackers.
-   **`AD_ERROR` events (MediaTailor):** Non-terminal failures now surface as `AD_ERROR` events in NRDB with a semantic `errorCode` (`NO_FILL`, `ADS_TIMEOUT`, `TRACKING_FETCH_FAILED`, `TOKEN_EXPIRED`, `MISSING_AVAIL_START`, `MANIFEST_TRACKING_MISMATCH`) instead of only appearing in the debug log.
-   **`adPrimaryId` attribute (MediaTailor):** `AD_START`, `AD_END`, and `AD_QUARTILE` now carry `adPrimaryId` (the VAST `creativeId`, falling back to `availId:adId`) so `count(DISTINCT adPrimaryId)` counts true creatives, not per-avail ad IDs.

### Improvements

-   **`@newrelic/video-core` updated to 5.1.0**, which includes a TypeScript conversion, upstream bug fixes, and dependency patches.
-   **Configurable poll cadence (MediaTailor):** `config.ad.pollIntervalMs` overrides the manifest-derived live poll interval (clamped to 100–5000 ms) for battery- or CPU-constrained clients. Behavior is unchanged when the option is omitted.
-   **Tracking URL from HLS manifest (MediaTailor):** The tracker now reads the tracking endpoint from an `#EXT-X-DATERANGE CLASS="tracking"` tag when present, removing the need to pass an explicit `trackingUrl` on non-AWS CDNs. An explicit option still takes precedence.
-   **Source-change reset (MediaTailor):** Swapping `player.src()` now resets the tracker — cancels in-flight fetches, clears the stale ad schedule, and re-derives the tracking endpoint — instead of continuing to poll the previous session's endpoint.

### Bug fixes

-   MediaTailor: Only the first ad in a multi-ad pod was tracked. The paging loop re-fetched the same avail on every page; the tracker now fetches the full window in a single tokenless request.
-   MediaTailor: The tracking endpoint could not be derived for implicit-session media-playlist URLs, so Tier-1 ad detection never ran for those sessions.
-   MediaTailor: `config.ad.segmentPrefix` was silently ignored because it was mapped to the wrong internal key.
-   MediaTailor: A DASH period was classified as an ad when only one of several representations resolved to an ad-marked URL. Classification now requires every representation to match.
-   MediaTailor: `AD_END` was not fired when a pod ended before its enclosing break boundary, causing completions to be undercounted.
-   MediaTailor: Pod-count mismatches between manifest and tracking data silently corrupted break geometry; the tracker now reconciles counts explicitly and emits `MANIFEST_TRACKING_MISMATCH`.
-   MediaTailor: Avails with a missing `startTimeInSeconds` were silently dropped, undercounting impressions in NRDB; the tracker now falls back to the first ad's start and emits `MISSING_AVAIL_START`.
-   MediaTailor: Live sliding-window re-merges duplicated or dropped ad breaks when start times jittered; breaks now deduplicate by stable identity (`availId` + `availProgramDateTime`).
-   MediaTailor: No-fill avails emitted phantom `AD_START`/quartile events; they now emit only break boundaries plus `AD_ERROR(NO_FILL)`.
-   MediaTailor: Expired tracking pagination tokens (`HTTP 400`) were not handled; the token is now dropped and retried once before emitting `TOKEN_EXPIRED` and stopping polling.
-   MediaTailor: Manifest fetches did not re-check `isDisposed` after each `await`, risking state mutation on a disposed tracker.
-   `AD_RESUME` was fired on first play into an ad, not only after a genuine pause.
-   Disposing mid-ad did not emit the outstanding `AD_END`/`AD_BREAK_END`, leaving the break dangling.
-   DASH EventStream `presentationTime` values were treated as raw ticks instead of being converted to seconds, misplacing ads at wrong offsets.
-   HLS `#EXT-X-CUE-OUT`-parsed ad breaks did not initialize quartile flags, causing quartile events to fire more than once per ad.
