@dolby-optiview/ads-sdk 1.1.1 → 1.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.
@@ -29,13 +29,14 @@ of the public contract and are never renamed.
29
29
  | `DA-ANVATO-CUE-END-REJECTED` | break | warn | ptsSource: 'anvatoCue' — an Anvato type=cue_end was observed for the active break but its stream-clock length differs from the break duration by more than 2s, so it is ignored and the resume keeps its computed target. Emitted once per break; context: breakId, mediaTime, lengthSec, durationSec. |
30
30
  | `DA-PRELOAD-FAILED` | preload | warn | Ad preload failed; the asset will be loaded on demand at break start. |
31
31
  | `DA-PRELOAD-MODE-RESOLVED` | preload | info | The configured ad preload mode was resolved for this session; context carries both the configured and the resolved mode. |
32
- | `DA-PRELOAD-PATH` | preload | info | The preload path actually taken for a break's ad (parallel buffer / detached prefetch / none) and the creative container (stream vs progressive). |
32
+ | `DA-PRELOAD-PATH` | preload | info | The preload path actually taken for a break's ad (parallel buffer / detached prefetch / first-frame warm-up on the ad player / none) and the creative container (stream vs progressive). |
33
33
  | `DA-BREAK-EARLY-RETURN` | break | info | The active break was removed from a polled manifest (early return); the break ends immediately and content resumes at break start plus the seconds already played. |
34
34
  | `DA-BREAK-WINDOW-ESCAPED` | break | warn | An active wallclock break outlived its window on the stream clock (ad stall, bogus trigger position, or a re-fired completed break); the SDK ended it and returned to content. context.overrunSec says by how much. |
35
35
  | `DA-BREAK-EVENT-UNSUPPORTED` | break | warn | A break is triggered by a spec event this SDK version does not schedule on this platform (web schedules `start`, `pause` and `end`; Android and iOS do not schedule `end` yet); the break was ignored. context.event names the event. |
36
36
  | `DA-BREAK-SUPPRESSED-OVERLAP` | break | warn | A break was suppressed because an ad was already playing. |
37
37
  | `DA-BREAK-TRANSITION` | break | info | Measured duration of a playback transition into an ad break, between two ads, between chained breaks, or back to content. |
38
38
  | `DA-AD-SURFACE-REVEALED` | break | info | The ad surface became visible: how long it was held back waiting for the ad's first frame, and whether it was revealed because that frame arrived or because the wait timed out. |
39
+ | `DA-BREAK-CUT-LATE` | break | warn | timebase: 'wallclock', all platforms — content was cut more than 0.5s after the break's manifest start on the stream's Program Date Time, so the viewer saw the stream's own break (slate) instead of the ad until then; typically the ad's first frame was not ready at the cut and content kept playing under the cross-fade. The replaced window is unaffected: the resume anchor is the content time of the manifest start whatever the cut landed on. Context carries breakId, lateSec (cut minus start on the PDT axis), start (the manifest start), cutPdt (the PDT at the cut), cutAt (currentTime at the cut) and anchor; iOS/Android add waitedForAdMs when the cut waited for the ad surface. |
39
40
  | `DA-PREROLL-CONTENT-HELD` | break | info | Content playback was held at session start until a pending pre-roll began, so no content is shown before the ad. |
40
41
  | `DA-PREROLL-CONTENT-WAIT-TIMEOUT` | break | info | A pending pre-roll began after content readiness was not reported within the wait timeout. |
41
42
  | `DA-PREROLL-CANCELLED-CONTENT-ERROR` | break | warn | A pending pre-roll was cancelled because the content failed to load before it could begin. |
@@ -47,14 +48,21 @@ of the public contract and are never renamed.
47
48
  | `DA-CONTENT-ELEMENT-SWAPPED` | break | info | The content player replaced its <video> element; the SDK re-bound its presentation listeners to the new one. |
48
49
  | `DA-PIP-FORMAT-OVERRIDE` | break | info | The content player is in picture-in-picture, so the break's declared format was overruled and it plays as a single fullscreen ad. |
49
50
  | `DA-PIP-ADOPTION-STATE` | break | info | Native PiP reconciliation deferred or reused a layout/handoff decision. Context carries reason, active, adPlaying, applied, and asset/break IDs when available; this is not evidence that a format override occurred. |
51
+ | `DA-PIP-HANDOFF` | break | info | The picture-in-picture handoff route chosen for the ad: 'layer-swap' (the presented AVPlayerLayer is re-pointed at the ad player) or 'borrow' (the ad plays through the content player). context: route, layers. iOS only. |
52
+ | `DA-PIP-LAYER-SWAP` | break | debug | Read-back check after a PiP layer-swap: whether the presented layer still points at the ad player after the re-point. context: held, layers. iOS only. |
53
+ | `DA-PIP-PRESENTED` | break | debug | Status trace of the player on the PiP-presented layer during a layer-swap: owner (ad/content/other) and time-control-status transitions, plus ad-item ends observed while presented. context: owner/status, or errored/reachedEnd/adStatus. iOS only. |
50
54
  | `DA-CHAIN-RESOLVER-ERROR` | chaining | warn | The chained-successor resolver threw; chaining was skipped for this break. |
51
55
  | `DA-GAM-NO-ASSET-KEY` | gam | warn | Retired: the GAM stream identity now comes from the manifest's vendorConfiguration. Kept declared so the code is never reused; see DA-GAM-CONFIG-MISSING. |
52
56
  | `DA-GAM-SESSION-FAILED` | gam | error | The GAM/IMA session failed to initialize; GAM breaks will not serve. |
57
+ | `DA-GAM-START-DEFERRED` | gam | info | The SGAI IMA stream request is deferred until the configured ad start delay has been played; context includes adStartDelaySec. |
53
58
  | `DA-GAM-CONFIG-RESOLVED` | gam | info | The GAM stream identity for this session was resolved from the manifest's vendorConfiguration. |
54
59
  | `DA-GAM-CONFIG-MISSING` | gam | error | The break manifest carries no usable "gam" vendorConfiguration entry; GAM assets are skipped. |
55
60
  | `DA-GAM-POD-IDENTITY-MISMATCH` | gam | error | A GAM pod asset's vendorParameters name a different network code or custom asset key than the stream session was created with; the asset is skipped because the pod request cannot serve. |
56
61
  | `DA-GAM-POD-MID-BREAK-END` | gam | warn | IMA reported the ad break ended before the pod's last ad while pod stream remains; per-ad reporting continues until the pod ends. |
62
+ | `DA-GAM-DUPLICATE-METADATA` | gam | info | The stream carries the same ad marker more than once at the same time (for example in both the audio and video renditions of an fMP4 stream); the duplicate was not passed to IMA, so each ad event fires once. Reported once per stream session. |
57
63
  | `DA-VENDOR-CONFIG-UNKNOWN-TYPE` | manifest | info | One or more vendorConfiguration entries declare a type this SDK version does not recognise and were ignored. |
64
+ | `DA-EXTERNAL-VENDOR-INVALID` | manifest | warn | External vendorConfiguration entries were ignored because provider was blank or assetParameters was not an object. context: count. |
65
+ | `DA-EXTERNAL-VENDOR-DUPLICATE` | manifest | warn | External vendorConfiguration entries repeated a provider; the first valid entry was used. context: providers. |
58
66
  | `DA-CONTENT-PLAYBACK-ERROR` | playback | error | The content player reported a playback error. |
59
67
  | `DA-CONTENT-RESUME-STALLED` | playback | warn | Content did not resume within the watchdog window after a break that paused it ended; the SDK re-issued play() once. iOS only for now. |
60
68
  | `DA-CONTENT-RECOVERY-MODE-RESOLVED` | playback | info | The resolved post-break content recovery mode for the session (recreate or none); context carries configured and resolved. |
@@ -68,7 +76,10 @@ of the public contract and are never renamed.
68
76
  | `DA-AD-START-TIMEOUT` | playback | error | The ad did not load, render a first frame or start within its start budget; reported as CMCD adec. |
69
77
  | `DA-AD-START-INTERRUPTED` | playback | warn | The ad element's play() was interrupted by a browser-initiated pause before the ad started (Chromium AbortError, seen on Samsung Tizen); the SDK re-issued play() once. context: breakId, error. |
70
78
  | `DA-AD-DURATION-PREPARED` | playback | info | The ad media for a break was prepared and its real playable duration is now known, BEFORE the first frame. context: breakId, assetId, index, total, preparedDurationSec (the loaded media's own duration — on a GAM pod, the stitched pod's length), declaredDurationSec (what the manifest said about this asset, when it said anything) and breakDurationSec (the slot the break declares). Emitted per asset, so a multi-asset break reports one per asset and the break total is their sum. The three together separate a short break caused by a short POD from one caused by a short request or a late join. |
71
- | `DA-DELIVERY-MODE-RESOLVED` | session | info | Delivery mode (sgai/ssai) resolved for the session at start and again on an ads-channel switch from the manifest's delivery rules (or the explicit client config). |
79
+ | `DA-DELIVERY-MODE-RESOLVED` | session | info | Delivery mode (sgai/ssai) resolved for the session at start and again on an ads-channel switch from the manifest's delivery rules (or the explicit client config), with the detected device profile. |
80
+ | `DA-TARGETING-VALUE-UNKNOWN` | manifest | warn | A targeting value is not recognized and the targeted entry does not match. |
81
+ | `DA-TARGETING-FIELD-UNKNOWN` | manifest | warn | A targeting field is not recognized and the targeted entry does not match. |
82
+ | `DA-TARGETING-INVALID` | manifest | warn | A targeting constraint is malformed or incomplete and the targeted entry does not match. |
72
83
  | `DA-DELIVERY-MODE-UNKNOWN` | session | warn | The matching delivery rule carried an unrecognized mode value; sgai is used (forward compatibility). |
73
84
  | `DA-DELIVERY-MODE-OVERRIDDEN` | session | info | The manifest's delivery rules resolved a different mode, but the explicit client config takes precedence. |
74
85
  | `DA-DELIVERY-MODE-CHANGE-IGNORED` | session | warn | An ordinary manifest poll resolves a different delivery mode; the mode pinned for the session stays in force. An ads-channel switch resolves the mode again. |
@@ -112,6 +123,9 @@ of the public contract and are never renamed.
112
123
  | `DA-RESUME-PTS-REMAP` | playback | warn | ptsSource: 'anvatoCue', iOS/tvOS and web — a stream beacon disagreed with the currentTime ↔ stream-clock mapping by more than 0.2s, so the player re-anchored currentTime (a variant switch or a buffer restart); the mapping starts over from that beacon and the resume point is mapped again. Reported during the resume run-up and after the hand-back. Context carries breakId, fromOffsetSec, toOffsetSec, deltaSec, currentTime and stage (run-up or after-hand-back). |
113
124
  | `DA-RESUME-PTS-CORRECTED` | playback | info | ptsSource: 'anvatoCue', iOS/tvOS and web — once per break at the hand-back, on a stream that carries Anvato beacons: whether the stream clock placed the live resume point, and by how much it moved it. applied=true: streamClockTarget is the resume point mapped through the beacons, correctionSec is streamClockTarget - computedTarget (the currentTime target, cue plus duration), and currentTimeShiftSec is how far the same stream instant moved in currentTime between the pause and the hand-back (negative: it now sits earlier), null when no beacon mapped the stream before the pause. Context also carries breakId, landingSource (cue_end or cue+duration), landingStreamSec, offsetSec, beacons, remaps (DA-RESUME-PTS-REMAP during the break) and cueEndTarget when a cue_end was matched. applied=false with a reason means no beacon arrived after the run-up's last seek, so the cue_end or currentTime target applied. |
114
125
  | `DA-RESUME-PTS-LANDED` | playback | info | ptsSource: 'anvatoCue', iOS/tvOS and web — where a stream-clock resume landed, measured on the stream's own clock from the beacons delivered after the hand-back: landedStreamSec is the position content resumed from (resumedAt, the seek landing or the playhead at a seek-free hand-back) converted with that mapping, and errorSec is landedStreamSec - landingStreamSec (negative: content resumed before the stream's resume point, so slate is shown). Context carries breakId, landingStreamSec, landingSource, resumedAt, sinceHandBackSec and, when measured, landedStreamSec, errorSec, offsetSec and beacons; reason when no beacon arrived within 15s. Report-only: the SDK does not correct the position from it. |
126
+ | `DA-RESUME-PDT-MAP` | playback | info | timebase: 'wallclock', all platforms — the live resume point (the manifest start plus duration, a wallclock instant) was mapped onto currentTime through the Program Date Time the content player reports now, so a currentTime re-anchored by a seek during the break cannot move it. Reported when the run-up first reads the target and whenever the mapped target moves by 0.1s or more (remapped=true: currentTime moved against the stream). Context carries breakId, target, landingPdt (the break end, ISO-8601), pdtOffsetSec (PDT minus currentTime, seconds), currentTime, remapped, and computedTarget with deltaSec (target - computedTarget) when an anchor-based target exists. |
127
+ | `DA-RESUME-PDT-CORRECTED` | playback | info | timebase: 'wallclock', all platforms — once per break at the hand-back of a break anchored on the Program Date Time: whether the stream clock placed the live resume point, and by how much it moved it. applied=true: pdtTarget is the break end mapped through the PDT the player reports at the hand-back, correctionSec is pdtTarget - computedTarget (the anchor plus the offset) and currentTimeShiftSec is how far the same stream instant moved in currentTime between the cut and the hand-back (negative: it now sits earlier). applied=false with a reason means no PDT sample was available at the hand-back, so the anchor-based target applied. Context also carries breakId and computedTarget. |
128
+ | `DA-RESUME-PDT-LANDED` | playback | info | timebase: 'wallclock', all platforms — where a Program-Date-Time resume landed, measured on the stream's own clock from the first position sample after the hand-back: errorSec is the PDT content resumed at minus the break end (negative: content resumed before the break end, so the stream's own break is shown; positive: post-break content was skipped). Context carries breakId, landingPdt (the break end), landedPdt, landedAt (currentTime) and sinceHandBackSec; reason when no sample carried a PDT within 2s. Report-only: the SDK does not correct the position from it. |
115
129
  | `DA-RESUME-CUE-END` | playback | info | ptsSource: 'anvatoCue', iOS/tvOS, web and Android — the stream's matched type=cue_end replaced the computed resume target: the slate under the ad ends there, not at cue plus the advertised duration (150.206s for a 150s break on NFL Channel), and the player can remap its timeline while content is held, so the cue_end is reported in the current mapping. Context carries breakId, computedTarget, cueEndTarget, deltaSec (cueEndTarget - computedTarget), stage (hold, playing or hand-back; Android: always hand-back) and corrected (whether an in-buffer correction seek ran). Only a policy that resumes at the break end is replaced; otherwise applied=false and only the delta is reported. |
116
130
  | `DA-RESUME-CUE-END-LATE` | playback | info | ptsSource: 'anvatoCue', iOS/tvOS and Android — the break's type=cue_end was matched only after the hand-back. When it is more than 1s ahead of the playhead and buffered, content is seeked forward to it once (corrected=true); content is never seeked backward. Context carries breakId, cueEndTarget, currentTime, deltaSec (cueEndTarget - currentTime) and corrected. |
117
131
  | `DA-RESUME-CATCHUP` | playback | info | Content began playing behind the ad to reach its resume point. Context carries breakId, startPos, target, remainingAdSec, publishedEnd and clampedStart — clampedStart true means the stream had not published the ideal start position, so playback began late and the alignment loop must make up the difference (the zero-live-headroom case). Its ABSENCE on a live break that resumed short means catch-up never ran at all, which is a different fault from it running and falling short. |
@@ -146,6 +146,15 @@ are preserved; the delivery mode pinned at session start is kept. The applicatio
146
146
  receives one `adchannelchange` event (`previousChannelId`, `channelId`, `reason`,
147
147
  `manifestUrl`) after the re-alignment. Web SDK only for now.
148
148
 
149
+ ## External provider parameters
150
+
151
+ Use `getExternalVendorConfiguration()` to read the current macro-resolved
152
+ parameters for every external provider, or pass an exact provider name such as
153
+ `mediakind` to read one. Read the values just before calling the external
154
+ system. `externalvendorconfigurationchange` fires when an adopted manifest
155
+ adds, removes, or changes a provider's parameter template, including the first
156
+ manifest. A macro-value change alone does not emit the event.
157
+
149
158
  ## Diagnostics
150
159
 
151
160
  The SDK emits structured `DiagnosticEvent`s (via `onDiagnostic`) and can export
@@ -72,6 +72,16 @@ also restart with the new manifest's ids once the switch is applied.
72
72
  **Fix:** Nothing when the backend re-pointed the stream on purpose. Repeated
73
73
  flips between channels indicate an unstable manifest source.
74
74
 
75
+ ## External provider parameters
76
+
77
+ Call `getExternalVendorConfiguration()` to retrieve all current provider
78
+ configurations, or pass a provider name such as `mediakind` for one
79
+ configuration. The returned `assetParameters` include current macro values.
80
+ Read them immediately before passing them to the external system.
81
+ `externalvendorconfigurationchange` is emitted when a newly adopted manifest
82
+ adds, removes, or changes a provider's template, including the first manifest;
83
+ macro-value changes alone do not emit it.
84
+
75
85
  ## DA-MANIFEST-SIGNATURE-INVALID
76
86
 
77
87
  **Cause:** The break-manifest response failed detached-JWS signature
@@ -625,6 +635,59 @@ when no beacon arrived within 15s. **Fix:** None for a single break. Unlike
625
635
  `DA-RESUME-LANDED` it is not measured in currentTime, so a timeline remap
626
636
  cannot hide in it.
627
637
 
638
+ ## DA-RESUME-PDT-MAP
639
+
640
+ **Cause:** Informational (all platforms, `timebase: 'wallclock'`). The live resume
641
+ point — the manifest `start + duration` — was placed through the stream's
642
+ Program Date Time as the content player reports it now, so a currentTime
643
+ re-anchored by a seek during the break cannot move it. Reported when the run-up
644
+ first reads it and whenever it moves by 0.1s or more (`remapped: true`).
645
+ `context` carries `breakId`, `target`, `landingPdt`, `pdtOffsetSec`,
646
+ `currentTime`, `remapped`, `computedTarget` and `deltaSec`. **Fix:** None
647
+ needed. A large `deltaSec` is the player's timeline having moved during the
648
+ break, which this mapping corrects. A stream without Program Date Time never
649
+ reports it and keeps the pause-position resume.
650
+
651
+ ## DA-RESUME-PDT-CORRECTED
652
+
653
+ **Cause:** Informational (all platforms, `timebase: 'wallclock'`). Once per break
654
+ at the hand-back of a break anchored on the Program Date Time: whether the
655
+ stream clock placed the resume (`applied`), `correctionSec` from the anchor
656
+ target (`computedTarget`) and `currentTimeShiftSec`, how far currentTime moved
657
+ against the stream during the break. `context` also carries `breakId`,
658
+ `pdtTarget` and, when not applied, `reason`. **Fix:** None needed. A large
659
+ `currentTimeShiftSec` is a player timeline re-anchor the stream clock corrected.
660
+ `applied: false` means no Program Date Time sample was available at the
661
+ hand-back; if frequent, check that the stream carries
662
+ `EXT-X-PROGRAM-DATE-TIME` and that the adapter exposes `programDateTime`.
663
+
664
+ ## DA-RESUME-PDT-LANDED
665
+
666
+ **Cause:** Informational (all platforms, `timebase: 'wallclock'`). Where a
667
+ Program-Date-Time resume landed on the stream clock, from the first position
668
+ sample after the hand-back. `errorSec` is the landed Program Date Time minus
669
+ the break end: negative means content resumed before the break end (that much
670
+ of the stream's own break shown), positive means post-break content was
671
+ skipped. `context` carries `breakId`, `landingPdt`, `landedPdt`, `landedAt`,
672
+ `errorSec` and `sinceHandBackSec`; `reason` when no sample carried a Program
673
+ Date Time within 2s. **Fix:** None within 0.5s. A larger value next to a
674
+ `DA-RESUME-TARGET-CLAMPED` means the live window could not reach the resume
675
+ point.
676
+
677
+ ## DA-BREAK-CUT-LATE
678
+
679
+ **Cause:** Warning (all platforms, `timebase: 'wallclock'`). Content was cut more
680
+ than 0.5s after the break's manifest start on the stream's Program Date Time
681
+ (`lateSec`), so the viewer saw the stream's own break instead of the ad until
682
+ then. The replaced window is not affected: the resume is anchored on the
683
+ manifest start whatever the cut landed on. `context` carries `breakId`,
684
+ `lateSec`, `start`, `cutPdt`, `cutAt`, `anchor` and, on iOS/tvOS and Android,
685
+ `waitedForAdMs` — how long the cut waited for the ad's first frame under the
686
+ cross-fade. **Fix:** Check that the break was prepared 8s ahead
687
+ (`DA-PRELOAD-PATH`; a shorter manifest publication lead leaves no time) and, on
688
+ iOS/tvOS, that the first-frame warm-up rendered a frame (`firstFrame: true`).
689
+ A value of several seconds points at the pod request or the creative.
690
+
628
691
  ## DA-PRELOAD-FAILED
629
692
 
630
693
  **Cause:** Preloading the next ad failed; the asset will load on demand at break
@@ -646,7 +709,9 @@ from timings.
646
709
 
647
710
  **Cause:** Informational, emitted per preloaded break. States the preload path
648
711
  actually taken for the break's ad in `context.path`: `parallel` (buffered into
649
- the attached ad player), `single-decoder` (cache warm + detached prefetch) or
712
+ the attached ad player), `single-decoder` (cache warm + detached prefetch),
713
+ `first-frame` (iOS/tvOS: warmed up on the ad player itself to its first frame,
714
+ then paused on it; `firstFrame` says whether the frame rendered) or
650
715
  `none` (no pre-break activity — cold-start baseline / opt-out).
651
716
  `context.creative` classifies the creative container: `stream` (HLS/DASH,
652
717
  MSE-eligible — real pre-buffering is possible) vs `progressive` (MP4/WebM,
@@ -1027,6 +1092,45 @@ scenario, capture the diagnostic stream too: the bounded export may no longer re
1027
1092
  earlier override. Repeated starts of the same completed break point to content restoration
1028
1093
  being mistaken for a viewer rewind, not necessarily to a missing PiP entry.
1029
1094
 
1095
+ ## DA-PIP-HANDOFF
1096
+
1097
+ **Cause:** iOS only. Records which route the ad takes onto the picture-in-picture window.
1098
+ `context.route` is `layer-swap` — the default: the renderer finds the `AVPlayerLayer` the
1099
+ window presents under the content view and re-points its `.player` at the SDK's ad player,
1100
+ so the ad reaches the window with no source reload and content keeps its item — or
1101
+ `borrow`, the fallback for when no presented layer can be identified (no content view
1102
+ handed to the renderer, or an ambiguous layer tree), which plays the ad through the
1103
+ content player itself and restores its source afterwards. `context.layers` inventories
1104
+ the `AVPlayerLayer`s found and the player each carries. **Fix:** Informational. If you
1105
+ expected `layer-swap` but see `borrow`, check that the host actually attached its player
1106
+ surface to the view handed to the renderer before the break starts; a `borrow` on a
1107
+ stream the adapter cannot restore would already have been refused as
1108
+ `DA-SHARED-ELEMENT-UNSUPPORTED`. Non-fatal.
1109
+
1110
+ ## DA-PIP-LAYER-SWAP
1111
+
1112
+ **Cause:** iOS only. Read-back logged a few hundred milliseconds after a PiP layer-swap:
1113
+ whether the presented layer still points at the ad player (`context.held`), plus a
1114
+ `layers` inventory. **Fix:** `held: false` means something reverted the re-point — the
1115
+ host player rebuilding its internal layer on a source change is the usual suspect, since
1116
+ the window was bound to the old layer object. The window then shows content while the ad
1117
+ plays inline; the `DA-PIP-PRESENTED` trace shows which player actually landed on the
1118
+ layer. Non-fatal, informational.
1119
+
1120
+ ## DA-PIP-PRESENTED
1121
+
1122
+ **Cause:** iOS only. Debug trace of the exact signal AVKit's PiP chrome reacts to during
1123
+ a layer-swap: which player the presented layer points at (`owner`: `ad`, `content` or
1124
+ `other`) and its `timeControlStatus` transitions, plus ad-item ends observed while the
1125
+ layer was presented (`errored`, `reachedEnd`, `adStatus`). **Fix:** None — it is the
1126
+ timeline to read when a controls flash or a stalled window is reported. A `paused` or
1127
+ `waiting` status landing on the presented player is what re-raises the window chrome,
1128
+ which is why the swap waits for `readyToPlay` + `playing`, pauses content only after the
1129
+ flip, and defers the exit hand-back past the close morph. `reachedEnd: true` followed by
1130
+ `presented layer → content player` is the healthy last-asset path; `reachedEnd: false`
1131
+ is a forced break cut and intentionally keeps the ad on the layer until break end.
1132
+ Non-fatal.
1133
+
1030
1134
  ## DA-IMAGE-LOAD-FAILED
1031
1135
 
1032
1136
  **Cause:** An image the renderer needed — a `double`/`lshape_ad` companion, an
@@ -1061,6 +1165,14 @@ Common causes: wrong `networkCode`/`customAssetKey`, IMA SDK not loaded, or no
1061
1165
  the IMA SDK is loaded, the `networkCode` and `customAssetKey` are correct, and your
1062
1166
  content adapter exposes `videoElement`. Inspect `context.message`.
1063
1167
 
1168
+ ## DA-GAM-START-DEFERRED
1169
+
1170
+ **Cause:** Informational. The SGAI IMA stream request was deferred because the
1171
+ manifest's positive `adStartDelay` has not yet been played. `context.adStartDelaySec`
1172
+ reports the configured delay. **Fix:** None needed. This confirms the ad-free start
1173
+ is active; content must advance for the delay to elapse. If IMA does not start after
1174
+ that, check `DA-GAM-SESSION-FAILED`.
1175
+
1064
1176
  ## DA-GAM-CONFIG-RESOLVED
1065
1177
 
1066
1178
  **Cause:** Informational. The GAM stream identity for this session was read from the
@@ -1107,6 +1219,15 @@ stream ends; `adbreakend` fires once, at the real end of the pod.
1107
1219
  before the early end, and `context.remainingSec` the pod left. A recurring hit on one asset
1108
1220
  points at the pod's ad decisioning or IMA rather than the integration.
1109
1221
 
1222
+ ## DA-GAM-DUPLICATE-METADATA
1223
+
1224
+ **Cause:** Informational. The stream carried the same ad marker more than once at the
1225
+ same playback time (for example in both audio and video renditions of an fMP4 stream).
1226
+ The duplicate was not forwarded to IMA, so each ad lifecycle event fires once. The
1227
+ diagnostic is reported once per stream session; `context.startTime` identifies the cue
1228
+ time. **Fix:** No action is needed when duplicate markers are expected. Otherwise,
1229
+ remove duplicate markers from stream packaging.
1230
+
1110
1231
  ## DA-VENDOR-CONFIG-UNKNOWN-TYPE
1111
1232
 
1112
1233
  **Cause:** Informational. The manifest carried `vendorConfiguration` entries whose
@@ -1115,6 +1236,20 @@ forward-compatibility rule. `context.types` names them. **Fix:** None needed —
1115
1236
  expected when a newer backend serves an older client. If the type is one you expect to
1116
1237
  be supported, check the SDK version.
1117
1238
 
1239
+ ## DA-EXTERNAL-VENDOR-INVALID
1240
+
1241
+ **Cause:** The manifest contained external `vendorConfiguration` entries with a
1242
+ blank provider or without an object-valued `assetParameters` map. Those entries were
1243
+ ignored; `context.count` gives the number rejected. **Fix:** Correct the provider and
1244
+ parameter map in the manifest. Non-string parameter values are discarded.
1245
+
1246
+ ## DA-EXTERNAL-VENDOR-DUPLICATE
1247
+
1248
+ **Cause:** The manifest contained multiple valid external `vendorConfiguration`
1249
+ entries for the same provider. The first entry was kept; `context.providers` names
1250
+ the duplicates. Provider matching is case-sensitive. **Fix:** Combine the
1251
+ parameters into one entry per provider.
1252
+
1118
1253
  ## DA-SSAI-SESSION-FAILED
1119
1254
 
1120
1255
  **Cause:** An SSAI (`mode: 'ssai'`) session failed to start. The SDK could not
@@ -1132,7 +1267,30 @@ on the first break-manifest fetch and is pinned for the rest of the session.
1132
1267
  `context.mode` is the resolved mode, `context.source` says whether it came from the
1133
1268
  manifest `delivery` rules (`manifest`) or an explicit constructor `mode` (`config`),
1134
1269
  and `context.ruleIndex` names the matching rule (`null` when no rule matched and the
1135
- sgai default applied). **Fix:** No action needed.
1270
+ sgai default applied). `context.deviceProfile` records the detected device type,
1271
+ platform, OS and OS version when available. **Fix:** No action needed.
1272
+
1273
+ ## DA-TARGETING-VALUE-UNKNOWN
1274
+
1275
+ **Cause:** A delivery rule, variant or asset URI targeting entry contains a
1276
+ `deviceType`, `platform` or `os` value this SDK does not recognize, so the entry
1277
+ does not match. `context.field` and `context.value` identify the value. **Fix:**
1278
+ Use a value from the manifest targeting schema, or update the SDK if the manifest
1279
+ intentionally uses a newer value.
1280
+
1281
+ ## DA-TARGETING-FIELD-UNKNOWN
1282
+
1283
+ **Cause:** A targeting entry contains an unknown field, so it does not match.
1284
+ `context.field` identifies the field path, including nested `osVersion` keys.
1285
+ **Fix:** Correct a field-name typo, or update the SDK if the manifest uses a
1286
+ newer targeting field.
1287
+
1288
+ ## DA-TARGETING-INVALID
1289
+
1290
+ **Cause:** An `osVersion` constraint is malformed or incomplete, such as missing
1291
+ `os`, having neither `min` nor `max`, or using a non-decimal bound. The targeted
1292
+ entry does not match. `context.field` and optional `context.value` identify the
1293
+ problem. **Fix:** Include `os` and at least one decimal `min` or `max` version.
1136
1294
 
1137
1295
  ## DA-DELIVERY-MODE-OVERRIDDEN
1138
1296
 
@@ -1326,8 +1484,8 @@ resolve — the name is not a built-in (`$OPTIVIEW_USER_AGENT$`,
1326
1484
  `$OPTIVIEW_PLAYER_WIDTH$`, `$OPTIVIEW_PLAYER_HEIGHT$`,
1327
1485
  `$OPTIVIEW_BREAK_DURATION_MS$`, `$OPTIVIEW_BREAK_DURATION_SECONDS$`; matching is
1328
1486
  exact and case-sensitive), or the value is unavailable on this platform (iOS has
1329
- no user agent; the break duration is unknown when neither the asset nor the
1330
- break declares one). The parameter is still sent with the unresolved token kept
1487
+ no user agent; the break duration is unknown on the GAM stream request, before
1488
+ any break, or when neither the asset nor the break declares one). The parameter is still sent with the unresolved token kept
1331
1489
  literally, so the token is visible in the ad request (`context.key`,
1332
1490
  `context.macro`). **Fix:** Correct the macro name in the manifest, or register the name in
1333
1491
  `SessionConfig.assetParameterMacros` so your fixed value or callback supplies
@@ -21,6 +21,8 @@ export declare class NativeVideoAdapter implements PlayerAdapter {
21
21
  private emittedCues;
22
22
  /** Target duration supplied by the SDK for the live startup distance; null when unknown. */
23
23
  private liveStartTargetDuration;
24
+ /** The `load()` / `recreateMediaPipeline()` in flight, which owns element errors until it settles. */
25
+ private activeOperation;
24
26
  constructor(videoElement: HTMLVideoElement);
25
27
  get currentTime(): number;
26
28
  get duration(): number;
@@ -128,6 +130,8 @@ export declare class NativeVideoAdapter implements PlayerAdapter {
128
130
  private teardownMetadataListener;
129
131
  /** Map a native metadata cue (Safari ID3 `DataCue`) onto a {@link TimedMetadataCue}. */
130
132
  private toCue;
133
+ private beginOperation;
134
+ private endOperation;
131
135
  private setupVideoListeners;
132
136
  private emit;
133
137
  }
@@ -1 +1 @@
1
- export class NativeVideoAdapter{constructor(e){this.boundHandlers=new Map,this.eventListeners=new Map,this.cueTracks=[],this.emittedCues=new WeakSet,this.liveStartTargetDuration=null,this.video=e,this.setupVideoListeners(),this.setupMetadataListener()}get currentTime(){return this.video.currentTime}get duration(){return this.video.duration}get paused(){return this.video.paused}get muted(){return this.video.muted}set muted(e){this.video.muted=e}get volume(){return this.video.volume}set volume(e){this.video.volume=e}get videoElement(){return this.video}get playbackReady(){return this.video.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&!this.video.seeking}get programDateTime(){const e=this.webKitStartDate();if(!e)return null;if(this.video.readyState<HTMLMediaElement.HAVE_METADATA)return null;const t=e.call(this.video);return t instanceof Date&&t.getTime()>0?new Date(t.getTime()+1e3*this.video.currentTime):null}get liveEdge(){const e=this.liveStartTargetDuration,t=this.video.seekable;if(null===e||!this.webKitStartDate()||this.video.duration!==1/0||!t?.length)return null;const i=t.end(t.length-1);return Number.isFinite(i)?i+3*e:null}requestLiveStartOffset(e,t){const i=t;return this.liveStartTargetDuration=null!==e&&null!==i&&Number.isFinite(i)&&i>0?i:null,!1}webKitStartDate(){const e=this.video.getStartDate;return"function"==typeof e?e:void 0}get supportsParallelBuffering(){return!0}pause(){this.video.pause()}async play(){await this.video.play()}seek(e){this.video.currentTime=e}get sourceUrl(){return this.video.currentSrc||this.video.src||null}async load(e){return new Promise((t,i)=>{const r=()=>{n(),t()},s=()=>{n(),i(new Error("Native video load error"))},n=()=>{this.video.removeEventListener("loadedmetadata",r),this.video.removeEventListener("error",s)};this.video.addEventListener("loadedmetadata",r),this.video.addEventListener("error",s),this.video.preload="auto",this.video.src=e,this.video.load()})}unload(){this.video.removeAttribute("src"),this.video.load()}recreateMediaPipeline(e){const t=this.sourceUrl;return t?new Promise((i,r)=>{const s=()=>{a(),this.video.currentTime=e.startTime,i()},n=()=>{a(),r(new Error("Native pipeline recreate error"))},a=()=>{this.video.removeEventListener("loadedmetadata",s),this.video.removeEventListener("error",n)};this.video.addEventListener("loadedmetadata",s),this.video.addEventListener("error",n),this.video.removeAttribute("src"),this.video.load(),this.video.src=t,this.video.load()}):Promise.reject(new Error("Native pipeline recreate: no source URL"))}async preload(e){if("undefined"!=typeof document)return new Promise(t=>{const i=document.createElement("video");i.preload="metadata",i.muted=!0;let r=!1;const s=()=>{r||(r=!0,clearTimeout(n),i.removeAttribute("src"),i.load(),t())},n=setTimeout(s,8e3);i.addEventListener("loadedmetadata",s,{once:!0}),i.addEventListener("error",s,{once:!0}),i.src=e})}on(e,t){this.eventListeners.has(e)||this.eventListeners.set(e,new Set),this.eventListeners.get(e).add(t)}off(e,t){this.eventListeners.get(e)?.delete(t)}destroy(){for(const[e,t]of this.boundHandlers)this.video.removeEventListener(e,t);this.boundHandlers.clear(),this.teardownMetadataListener(),this.eventListeners.clear()}setupMetadataListener(){const e=this.video.textTracks;if(!e||"function"!=typeof e.addEventListener)return;const t=e=>{this.emittedCues.has(e)||(this.emittedCues.add(e),this.emit("timedmetadata",this.toCue(e)))},i=e=>{const i=e.cues;if(i)for(let e=0;e<i.length;e++)t(i[e])},r=e=>{if("metadata"!==e.kind)return;e.mode="hidden";const r=()=>{const i=e.activeCues;if(i)for(let e=0;e<i.length;e++)t(i[e])};e.addEventListener("cuechange",r),this.cueTracks.push({track:e,handler:r}),i(e)},s=e=>{const t=e.track;t&&r(t)};this.addTrackHandler=s,e.addEventListener("addtrack",s);const n=()=>{for(const{track:e}of this.cueTracks)i(e)};this.cueScanHandler=n,this.video.addEventListener("timeupdate",n);for(let t=0;t<e.length;t++)r(e[t])}teardownMetadataListener(){const e=this.video.textTracks;this.addTrackHandler&&e?.removeEventListener&&(e.removeEventListener("addtrack",this.addTrackHandler),this.addTrackHandler=void 0),this.cueScanHandler&&(this.video.removeEventListener("timeupdate",this.cueScanHandler),this.cueScanHandler=void 0);for(const{track:e,handler:t}of this.cueTracks)e.removeEventListener("cuechange",t);this.cueTracks=[],this.emittedCues=new WeakSet}toCue(e){const t={type:"id3",startTime:e.startTime,endTime:e.endTime},i=e.value;if(i?.key){const e="string"==typeof(r=i.data)?r:null==r?"":"[object ArrayBuffer]"===Object.prototype.toString.call(r)?(new TextDecoder).decode(new Uint8Array(r)):ArrayBuffer.isView(r)?(new TextDecoder).decode(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)):String(r);t.frames={[i.key]:e},"string"==typeof i.info&&i.info&&(t.description=i.info),e&&(t.messageData=e)}var r;return t}setupVideoListeners(){const e=["timeupdate","ended","error","seeked","volumechange","waiting","playing","pause"];for(const t of e){const e=()=>{this.emit(t,"error"===t?this.video.error:void 0)};this.video.addEventListener(t,e),this.boundHandlers.set(t,e)}}emit(e,t){const i=this.eventListeners.get(e);if(i)for(const e of i)try{e(t)}catch(e){console.error("[NativeVideoAdapter] Event handler error:",e)}}}
1
+ import{nativeMediaLoadError as e}from"./nativeMediaLoadError";export class NativeVideoAdapter{constructor(e){this.boundHandlers=new Map,this.eventListeners=new Map,this.cueTracks=[],this.emittedCues=new WeakSet,this.liveStartTargetDuration=null,this.activeOperation=null,this.video=e,this.setupVideoListeners(),this.setupMetadataListener()}get currentTime(){return this.video.currentTime}get duration(){return this.video.duration}get paused(){return this.video.paused}get muted(){return this.video.muted}set muted(e){this.video.muted=e}get volume(){return this.video.volume}set volume(e){this.video.volume=e}get videoElement(){return this.video}get playbackReady(){return this.video.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&!this.video.seeking}get programDateTime(){const e=this.webKitStartDate();if(!e)return null;if(this.video.readyState<HTMLMediaElement.HAVE_METADATA)return null;const t=e.call(this.video);return t instanceof Date&&t.getTime()>0?new Date(t.getTime()+1e3*this.video.currentTime):null}get liveEdge(){const e=this.liveStartTargetDuration,t=this.video.seekable;if(null===e||!this.webKitStartDate()||this.video.duration!==1/0||!t?.length)return null;const i=t.end(t.length-1);return Number.isFinite(i)?i+3*e:null}requestLiveStartOffset(e,t){const i=t;return this.liveStartTargetDuration=null!==e&&null!==i&&Number.isFinite(i)&&i>0?i:null,!1}webKitStartDate(){const e=this.video.getStartDate;return"function"==typeof e?e:void 0}get supportsParallelBuffering(){return!0}pause(){this.video.pause()}async play(){await this.video.play()}seek(e){this.video.currentTime=e}get sourceUrl(){return this.video.currentSrc||this.video.src||null}async load(t){const i=this.beginOperation();return new Promise((r,n)=>{const s=()=>{o(),this.endOperation(i),r()},a=()=>{o(),e("Native video load error",t,this.video.error).then(e=>{this.endOperation(i),n(e)})},o=()=>{this.video.removeEventListener("loadedmetadata",s),this.video.removeEventListener("error",a)};this.video.addEventListener("loadedmetadata",s),this.video.addEventListener("error",a),this.video.preload="auto",this.video.src=t,this.video.load()})}unload(){this.activeOperation=null,this.video.removeAttribute("src"),this.video.load()}recreateMediaPipeline(t){const i=this.sourceUrl;if(!i)return Promise.reject(new Error("Native pipeline recreate: no source URL"));const r=this.beginOperation();return new Promise((n,s)=>{const a=()=>{d(),this.endOperation(r),this.video.currentTime=t.startTime,n()},o=()=>{d(),e("Native pipeline recreate error",i,this.video.error).then(e=>{this.endOperation(r),s(e)})},d=()=>{this.video.removeEventListener("loadedmetadata",a),this.video.removeEventListener("error",o)};this.video.addEventListener("loadedmetadata",a),this.video.addEventListener("error",o),this.video.removeAttribute("src"),this.video.load(),this.video.src=i,this.video.load()})}async preload(e){if("undefined"!=typeof document)return new Promise(t=>{const i=document.createElement("video");i.preload="metadata",i.muted=!0;let r=!1;const n=()=>{r||(r=!0,clearTimeout(s),i.removeAttribute("src"),i.load(),t())},s=setTimeout(n,8e3);i.addEventListener("loadedmetadata",n,{once:!0}),i.addEventListener("error",n,{once:!0}),i.src=e})}on(e,t){this.eventListeners.has(e)||this.eventListeners.set(e,new Set),this.eventListeners.get(e).add(t)}off(e,t){this.eventListeners.get(e)?.delete(t)}destroy(){for(const[e,t]of this.boundHandlers)this.video.removeEventListener(e,t);this.boundHandlers.clear(),this.teardownMetadataListener(),this.eventListeners.clear()}setupMetadataListener(){const e=this.video.textTracks;if(!e||"function"!=typeof e.addEventListener)return;const t=e=>{this.emittedCues.has(e)||(this.emittedCues.add(e),this.emit("timedmetadata",this.toCue(e)))},i=e=>{const i=e.cues;if(i)for(let e=0;e<i.length;e++)t(i[e])},r=e=>{if("metadata"!==e.kind)return;e.mode="hidden";const r=()=>{const i=e.activeCues;if(i)for(let e=0;e<i.length;e++)t(i[e])};e.addEventListener("cuechange",r),this.cueTracks.push({track:e,handler:r}),i(e)},n=e=>{const t=e.track;t&&r(t)};this.addTrackHandler=n,e.addEventListener("addtrack",n);const s=()=>{for(const{track:e}of this.cueTracks)i(e)};this.cueScanHandler=s,this.video.addEventListener("timeupdate",s);for(let t=0;t<e.length;t++)r(e[t])}teardownMetadataListener(){const e=this.video.textTracks;this.addTrackHandler&&e?.removeEventListener&&(e.removeEventListener("addtrack",this.addTrackHandler),this.addTrackHandler=void 0),this.cueScanHandler&&(this.video.removeEventListener("timeupdate",this.cueScanHandler),this.cueScanHandler=void 0);for(const{track:e,handler:t}of this.cueTracks)e.removeEventListener("cuechange",t);this.cueTracks=[],this.emittedCues=new WeakSet}toCue(e){const t={type:"id3",startTime:e.startTime,endTime:e.endTime},i=e.value;if(i?.key){const e="string"==typeof(r=i.data)?r:null==r?"":"[object ArrayBuffer]"===Object.prototype.toString.call(r)?(new TextDecoder).decode(new Uint8Array(r)):ArrayBuffer.isView(r)?(new TextDecoder).decode(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)):String(r);t.frames={[i.key]:e},"string"==typeof i.info&&i.info&&(t.description=i.info),e&&(t.messageData=e)}var r;return t}beginOperation(){const e=Symbol("native-operation");return this.activeOperation=e,e}endOperation(e){this.activeOperation===e&&(this.activeOperation=null)}setupVideoListeners(){const e=["timeupdate","ended","error","seeked","volumechange","waiting","playing","pause"];for(const t of e){const e=()=>{"error"!==t?this.emit(t,void 0):null===this.activeOperation&&this.emit(t,this.video.error)};this.video.addEventListener(t,e),this.boundHandlers.set(t,e)}}emit(e,t){const i=this.eventListeners.get(e);if(i)for(const e of i)try{e(t)}catch(e){console.error("[NativeVideoAdapter] Event handler error:",e)}}}
@@ -0,0 +1,14 @@
1
+ /** A native element load failure with its `MediaError` `code`, which core classifies. */
2
+ export declare class NativeMediaLoadError extends Error {
3
+ readonly code: number | undefined;
4
+ constructor(prefix: string, code: number | undefined, detail?: string);
5
+ }
6
+ type ProbeResult = 'unreachable' | 'reachable' | 'unknown';
7
+ /**
8
+ * One bounded request to tell a missing or unreachable resource from unplayable media. The
9
+ * element reports both as `MEDIA_ERR_SRC_NOT_SUPPORTED` before it has any data.
10
+ */
11
+ export declare function probeMediaUrl(url: string, timeoutMs?: number): Promise<ProbeResult>;
12
+ /** The load error for a failed element, refining an unsupported-source code with {@link probeMediaUrl}. */
13
+ export declare function nativeMediaLoadError(prefix: string, url: string, mediaError: MediaError | null): Promise<NativeMediaLoadError>;
14
+ export {};
@@ -0,0 +1 @@
1
+ export class NativeMediaLoadError extends Error{constructor(e,r,o){super(`${e}${void 0!==r?` (code ${r})`:""}${o?`: ${o}`:""}`),this.code=r,this.name="NativeMediaLoadError"}}export async function probeMediaUrl(e,r=2e3){if("function"!=typeof fetch||!/^https?:/i.test(e))return"unknown";const o="function"==typeof AbortController?new AbortController:null;let t=null;const a=new Promise(e=>{t=setTimeout(()=>{o?.abort(),e("unknown")},r)}),n=fetch(e,{credentials:"omit",cache:"no-store",...o?{signal:o.signal}:{}}).then(e=>(e.body?.cancel().catch(()=>{}),e.status>=400?"unreachable":"reachable"),()=>o?.signal.aborted?"unknown":"unreachable");try{return await Promise.race([n,a])}finally{t&&clearTimeout(t)}}export async function nativeMediaLoadError(e,r,o){const t="number"==typeof o?.code?o.code:void 0,a=o?.message||void 0;if(4!==t)return new NativeMediaLoadError(e,t,a);return"unreachable"===await probeMediaUrl(r)?new NativeMediaLoadError(e,2,a??"resource not reachable"):new NativeMediaLoadError(e,t,a)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dolby-optiview/ads-sdk",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "OptiView Ads SDK entry package - OptiViewAds with a default HLS.js ad player (native fallback)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -44,8 +44,8 @@
44
44
  },
45
45
  "sideEffects": false,
46
46
  "dependencies": {
47
- "@dolby-optiview/ads-sdk-adapter-hlsjs": "^1.1.1",
48
- "@dolby-optiview/ads-sdk-core": "^1.1.1"
47
+ "@dolby-optiview/ads-sdk-adapter-hlsjs": "^1.2.0",
48
+ "@dolby-optiview/ads-sdk-core": "^1.2.0"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "hls.js": "^1.0.0"