@dolby-optiview/ads-sdk-core 1.4.0 → 1.6.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/dist/OptiViewAds.d.ts +5 -0
- package/dist/OptiViewAds.js +1 -1
- package/dist/diagnostics/dispatchDiagnostic.d.ts +4 -0
- package/dist/diagnostics/dispatchDiagnostic.js +1 -0
- package/dist/generated/diagnosticCodes.d.ts +118 -3
- package/dist/generated/diagnosticCodes.js +1 -1
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/index.d.ts +11 -4
- package/dist/index.js +1 -1
- package/dist/interfaces/PlayerAdapter.d.ts +27 -0
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +1 -1
- package/dist/services/AdBreakSequencer.d.ts +67 -3
- package/dist/services/AdBreakSequencer.js +1 -1
- package/dist/services/AdPlayerController.d.ts +9 -4
- package/dist/services/AdPlayerController.js +1 -1
- package/dist/services/BookmarkStart.d.ts +12 -0
- package/dist/services/BookmarkStart.js +1 -0
- package/dist/services/BreakScheduler.d.ts +15 -50
- package/dist/services/BreakScheduler.js +1 -1
- package/dist/services/BreakSchedulerTypes.d.ts +11 -1
- package/dist/services/BreakWarningTracker.d.ts +6 -0
- package/dist/services/BreakWarningTracker.js +1 -0
- package/dist/services/ContentEndTracker.d.ts +17 -0
- package/dist/services/ContentEndTracker.js +1 -0
- package/dist/services/ExternalPlaybackGate.d.ts +2 -2
- package/dist/services/ManifestService.d.ts +1 -1
- package/dist/services/ManifestService.js +1 -1
- package/dist/services/PauseAdController.d.ts +9 -5
- package/dist/services/PauseAdController.js +1 -1
- package/dist/services/PlaybackCrossing.d.ts +4 -0
- package/dist/services/PlaybackCrossing.js +1 -0
- package/dist/services/RewindRearm.js +1 -1
- package/dist/services/SchedulerSnapback.d.ts +33 -0
- package/dist/services/SchedulerSnapback.js +1 -0
- package/dist/services/SlateClock.d.ts +22 -0
- package/dist/services/SlateClock.js +1 -0
- package/dist/services/SnapbackGuard.d.ts +70 -0
- package/dist/services/SnapbackGuard.js +1 -0
- package/dist/services/VastAdManager.d.ts +2 -0
- package/dist/services/VastAdManager.js +1 -1
- package/dist/services/adPlayer/AdPlayerCallbacks.d.ts +11 -1
- package/dist/services/adPlayer/AdPlayerEvents.d.ts +21 -1
- package/dist/services/adPlayer/AdPlayerEvents.js +1 -1
- package/dist/services/adPlayer/AdPlayerState.d.ts +14 -0
- package/dist/services/adPlayer/AdPlayerState.js +1 -1
- package/dist/services/adPlayer/AdPreloader.d.ts +8 -1
- package/dist/services/adPlayer/AdPreloader.js +1 -1
- package/dist/services/adPlayer/AdStage.js +1 -1
- package/dist/services/adPlayer/AssetPlayback.d.ts +1 -0
- package/dist/services/adPlayer/AssetPlayback.js +1 -1
- package/dist/services/adPlayer/BreakSequenceDriver.d.ts +7 -1
- package/dist/services/adPlayer/BreakSequenceDriver.js +1 -1
- package/dist/services/adPlayer/ContentResumeCoordinator.d.ts +6 -0
- package/dist/services/adPlayer/ContentResumeCoordinator.js +1 -1
- package/dist/services/adPlayer/PauseAdPresenter.d.ts +10 -9
- package/dist/services/adPlayer/PauseAdPresenter.js +1 -1
- package/dist/services/adPlayer/PauseAdTracking.d.ts +13 -0
- package/dist/services/adPlayer/PauseAdTracking.js +1 -0
- package/dist/services/adPlayer/SharedElementBreakPlayer.d.ts +31 -2
- package/dist/services/adPlayer/SharedElementBreakPlayer.js +1 -1
- package/dist/services/adPlayer/SlateCoordinator.d.ts +58 -0
- package/dist/services/adPlayer/SlateCoordinator.js +1 -0
- package/dist/services/adPlayer/SlatePlayback.d.ts +89 -0
- package/dist/services/adPlayer/SlatePlayback.js +1 -0
- package/dist/services/adPlayer/VariantSelector.d.ts +10 -1
- package/dist/services/adPlayer/VariantSelector.js +1 -1
- package/dist/services/adPlayer/connectPauseAd.js +1 -1
- package/dist/services/adPlayer/presentation/PresentationLayout.d.ts +5 -2
- package/dist/services/adPlayer/presentation/PresentationLayout.js +1 -1
- package/dist/services/breakTiming.d.ts +1 -0
- package/dist/services/breakTiming.js +1 -1
- package/dist/services/checkEventBreak.d.ts +5 -0
- package/dist/services/checkEventBreak.js +1 -0
- package/dist/services/parseBreakManifest.d.ts +2 -1
- package/dist/services/parseBreakManifest.js +1 -1
- package/dist/services/parseVastPause.d.ts +18 -0
- package/dist/services/parseVastPause.js +1 -0
- package/dist/services/resolveLshapeAnchor.d.ts +25 -0
- package/dist/services/resolveLshapeAnchor.js +1 -0
- package/dist/services/resolveResumePoint.d.ts +3 -1
- package/dist/services/resolveResumePoint.js +1 -1
- package/dist/services/resolveSlate.d.ts +25 -0
- package/dist/services/resolveSlate.js +1 -0
- package/dist/services/resolveSlateFill.d.ts +39 -0
- package/dist/services/resolveSlateFill.js +1 -0
- package/dist/services/ssbSwitchSignals.d.ts +3 -0
- package/dist/services/ssbSwitchSignals.js +1 -1
- package/dist/session/AdBreakStatusTracker.d.ts +22 -2
- package/dist/session/AdBreakStatusTracker.js +1 -1
- package/dist/session/BreakLifecycle.js +1 -1
- package/dist/session/ContentPlaybackStart.d.ts +23 -0
- package/dist/session/ContentPlaybackStart.js +1 -0
- package/dist/session/DiscoveredManifestUrl.d.ts +44 -0
- package/dist/session/DiscoveredManifestUrl.js +1 -0
- package/dist/session/ScheduledBreaksTracker.d.ts +22 -0
- package/dist/session/ScheduledBreaksTracker.js +1 -0
- package/dist/session/SessionStarter.d.ts +3 -9
- package/dist/session/SessionStarter.js +1 -1
- package/dist/session/SessionStarterDeps.d.ts +3 -0
- package/dist/session/SessionStarterHelpers.d.ts +22 -1
- package/dist/session/SessionStarterHelpers.js +1 -1
- package/dist/session/SessionState.d.ts +16 -0
- package/dist/session/SessionState.js +1 -1
- package/dist/session/SsbSwitch.js +1 -1
- package/dist/session/buildScheduledBreaks.d.ts +9 -0
- package/dist/session/buildScheduledBreaks.js +1 -0
- package/dist/session/contentSnapback.d.ts +5 -1
- package/dist/session/contentSnapback.js +1 -1
- package/dist/session/scheduledBreaksSession.d.ts +6 -0
- package/dist/session/scheduledBreaksSession.js +1 -0
- package/dist/types/BreakManifest.d.ts +40 -2
- package/dist/types/BreakManifest.js +1 -1
- package/dist/types/Events.d.ts +13 -4
- package/dist/types/OptiViewAdsConfig.d.ts +15 -2
- package/dist/types/ScheduledBreak.d.ts +17 -0
- package/dist/types/ScheduledBreak.js +1 -0
- package/package.json +1 -1
package/dist/OptiViewAds.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ScheduledBreak } from './types/ScheduledBreak';
|
|
1
2
|
import { OptiViewAdsConfig, StartSessionConfig, AssetParameterMacroUpdates } from './types/OptiViewAdsConfig';
|
|
2
3
|
import { AdBreakStatus, OptiViewAdsEventType, OptiViewAdsEventHandler } from './types/Events';
|
|
3
4
|
import { DiagnosticHandler, DiagnosticReport } from './diagnostics/DiagnosticEvent';
|
|
@@ -63,6 +64,7 @@ export declare class OptiViewAds {
|
|
|
63
64
|
private breakLifecycle?;
|
|
64
65
|
private sessionStarter;
|
|
65
66
|
private readonly adBreakStatusTracker;
|
|
67
|
+
private readonly scheduledBreaks;
|
|
66
68
|
private breakTransitionTimer?;
|
|
67
69
|
private breakChainRecorder?;
|
|
68
70
|
private readonly onContentSeeked;
|
|
@@ -79,6 +81,7 @@ export declare class OptiViewAds {
|
|
|
79
81
|
private readonly onTimedMetadata;
|
|
80
82
|
private readonly externalPlayback;
|
|
81
83
|
private ssbSwitch;
|
|
84
|
+
private unsubscribeManifestUrlDiscovery;
|
|
82
85
|
constructor(config: OptiViewAdsConfig);
|
|
83
86
|
/** SSAI-mode construction: no manifest service, break scheduler, or ad-player overlay. */
|
|
84
87
|
private initSsai;
|
|
@@ -187,6 +190,8 @@ export declare class OptiViewAds {
|
|
|
187
190
|
isSessionActive(): boolean;
|
|
188
191
|
/** Current playback-gated ad break status; for polling when an `adbreakstatus` event was missed. @category Playback & UI */
|
|
189
192
|
getAdBreakStatus(): AdBreakStatus;
|
|
193
|
+
/** Viewer-specific scrubber opportunities. Returns independent objects; empty without a session. @category Playback & UI */
|
|
194
|
+
getScheduledBreaks(): ScheduledBreak[];
|
|
190
195
|
/** Clean up all resources. Call when the SDK is no longer needed. @category Lifecycle */
|
|
191
196
|
destroy(): void;
|
|
192
197
|
private log;
|
package/dist/OptiViewAds.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DEFAULT_MODE as e,DEFAULT_AD_PRELOAD_MODE as t,DEFAULT_AD_BREAK_CONTENT_RECOVERY as s,DEFAULT_AD_INSERTION_MODE as r,DEFAULT_AD_BREAK_CUT_SAFETY_MARGIN_SEC as i,DEFAULT_DOUBLE_BOX_AUDIO as a,resolveChaining as o,resolveTuneIn as n,resolveBreakWarnings as d,resolvePdtGraceSeconds as l}from"./types/OptiViewAdsConfig";import{SsaiController as h}from"./services/SsaiController";import{resolvePreloadMode as c}from"./services/detectPreloadMode";import{resolveContentRecovery as u}from"./services/detectContentRecovery";import{emitResolvedModeDiagnostics as m}from"./services/resolvedModeDiagnostics";import{isSingleSurfaceWebDevice as p,resolveInsertionMode as k}from"./services/detectInsertionMode";import{ManifestService as g}from"./services/ManifestService";import{BreakScheduler as y,systemClock as f}from"./services/BreakScheduler";import{MetadataCueTracker as S}from"./services/MetadataCueTracker";import{armBreakFromPresentedCue as v,diagnoseAnvatoCueObserved as C,notedManifestBreakIds as b,wireCueResume as A}from"./services/anvatoCueRuntime";import{AdPlayerController as P}from"./services/AdPlayerController";import{effectiveFormat as w}from"./services/pictureInPicture";import{ReloadGuard as B}from"./services/ReloadGuard";import{createExternalPlaybackGate as T}from"./session/createExternalPlaybackGate";import{SsbSwitchController as I}from"./session/SsbSwitch";import{createSnapbackHandler as D}from"./session/contentSnapback";import{resolveBreakFormat as R}from"./services/AdBreakSequencer";import{connectPauseAd as x}from"./services/adPlayer/connectPauseAd";import{createBreakMeasurement as E}from"./session/breakMeasurement";import{LensReporter as M}from"./services/LensReporter";import{CmcdAdReporter as O}from"./services/CmcdAdReporter";import{DiagnosticBuffer as L}from"./diagnostics/DiagnosticBuffer";import{recordEventTimeline as V}from"./diagnostics/recordEventTimeline";import{DIAGNOSTIC_CODES as H}from"./diagnostics/errorCodes";import{SDK_VERSION as G}from"./generated/version";import{playbackErrorContext as q}from"./diagnostics/playbackErrorContext";import{debugLog as F}from"./diagnostics/debugLog";import{AdBreakStatusTracker as K}from"./session/AdBreakStatusTracker";import{BreakLifecycle as $}from"./session/BreakLifecycle";import{SessionStarter as z}from"./session/SessionStarter";import{SessionState as N}from"./session/SessionState";import{LiveStartPushbackController as U}from"./services/LiveStartPushbackController";import{buildDiagnosticReport as W}from"./services/diagnosticReport";import{toPlaybackError as Q}from"./services/toPlaybackError";import{readExternalVendorConfiguration as j}from"./services/externalVendorConfigurationGetter";import{createExternalVendorConfigurationTracker as Y}from"./services/ExternalVendorConfigurationTracker";export class OptiViewAds{static get version(){return G}constructor(h){if(this.contentErrorReloadGuard=new B(e=>this.breakScheduler?.setContentReloading(e),5e3),this.eventHandlers=new Map,this.diagnosticHandlers=new Set,this.destroyed=!1,this.externalVendorConfigurationTracker=Y(e=>this.emit("externalvendorconfigurationchange",e)),this.continueContentDuringBreak=!1,this.state=new N,this.metadataCueTracker=null,this.anvatoObservedLogged=new Set,this.seenManifestBreakIds=new Set,this.player=h.player,this.liveStartPushback=new U(this.player,h.liveStartPushback,{blocked:()=>!this.state.sessionActive||this.state.channelSwitchInFlight||!!this.adPlayerController?.isAdPlaying()||!!this.state.heldImmediatePreRollId,setSeeking:e=>this.breakScheduler?.setStartupSeeking(e),diagnose:(e,t,s)=>this.diagnose(e,t,s)}),this.debug=h.debug??!1,this.mode=h.mode??e,this.hasExplicitMode=void 0!==h.mode,this.lensReporter=new M((...e)=>this.log(...e)),this.cmcdAdReporter=new O(()=>this.lensReporter.handle,(...e)=>this.log(...e)),this.externalPlayback=T(h.player,h.externalPlayback,{scheduler:()=>this.breakScheduler,diagnose:(e,t,s)=>this.diagnose(e,t,s),onAllowed:e=>this.ssbSwitch?.onAllowed(e),ssbSwitchPhase:()=>this.state.ssb?.phase??null}),this.adBreakStatusTracker=new K({externalPlaybackAllowed:()=>this.externalPlayback.managed?this.externalPlayback.isAllowedNow():void 0,deliveryMode:()=>this.state.sessionDeliveryMode??void 0,emit:(e,t)=>this.emit(e,t),effectiveFormatOf:e=>this.effectiveFormatOf(e),secondsUntilBreak:e=>this.breakScheduler?.getSecondsUntilBreak(e)??void 0,breakTransitionTimer:()=>this.breakTransitionTimer}),this.onContentSeeked=D({player:this.player,state:this.state,activeBreak:()=>this.breakScheduler?.getActiveBreak(),onViewerSeek:()=>this.sessionStarter?.discardPreparedGamSessionAfterSeek(),log:(...e)=>this.log(...e)}),this.onContentWaiting=()=>{this.adPlayerController?.isAdPlaying()||this.emit("waiting",{type:"waiting",timestamp:Date.now(),source:"content"})},this.onContentPlaying=()=>{this.adPlayerController?.isAdPlaying()||this.ssbSwitch?.isActive||(this.breakScheduler?.markPlaybackStart(),this.breakTransitionTimer?.settle("out-of-break"),!1!==this.pauseAdController?.onResume()?this.emit("playing",{type:"playing",timestamp:Date.now(),source:"content"}):this.player.pause())},this.onContentPause=()=>{this.adPlayerController?.isAdPlaying()||this.ssbSwitch?.isActive||this.breakScheduler?.isAdStartDelayActive()||this.pauseAdController?.onPause()},this.onContentEnded=()=>{this.adPlayerController?.isAdPlaying()||this.breakScheduler?.markPlaybackEnd()},this.onContentError=e=>{this.sessionStarter?.cancelHeldImmediatePreRollOnContentError();const t=Q(e,"Content playback error");this.diagnose("DA-CONTENT-PLAYBACK-ERROR",t.message,q(e)),this.contentErrorReloadGuard.arm(),this.emit("aderror",{type:"aderror",timestamp:Date.now(),source:"content",error:t})},this.onTimedMetadata=e=>{if(!e)return;const t=e,s=this.metadataCueTracker?.handleCue(t)??!1;this.metadataCueTracker&&this.adPlayerController?.ingestStreamClockCue(t),C(t,s,this.metadataCueTracker,this.anvatoObservedLogged,this.player.currentTime,(e,t,s)=>this.diagnose(e,t,s)),"presented"===t.phase&&v(t,this.metadataCueTracker,this.breakScheduler)},this.continueContentDuringBreak=h.continueContentDuringBreak??!1,"ssai"===this.mode)return void this.initSsai(h);if(!h.createAdAdapter)throw new Error("[OptiViewAds] createAdAdapter is required. Use the @dolby-optiview/ads-sdk package for a default HLS.js ad player, or supply your own createAdAdapter factory.");this.state.steeredSsaiOptions={maxBitrate:h.maxBitrate,autoplay:h.autoplay??!1,streamActivityMonitorId:h.gam?.streamActivityMonitorId};const w=c(h.adPreload??t),R=h.adBreakContentRecovery??s,V=u(R),H=k(h.adInsertion??r),G=o(h.chaining),F=n(h.tuneIn),W=d(h.breakWarnings),j=l(h.pdtGraceSeconds);"anvatoCue"===h.ptsSource&&(this.metadataCueTracker=new S(this.diagnose.bind(this))),this.diagnosticBuffer=new L(h.diagnostics?.bufferSize),({timer:this.breakTransitionTimer,recorder:this.breakChainRecorder}=E((e,t,s)=>this.diagnose(e,t,s),{adPreload:w,adInsertion:H})),this.state.configSummary={mode:this.mode,adPreload:w,adBreakContentRecovery:V,adInsertion:H,chaining:{enabled:G.enabled,maxGapSeconds:G.maxGapSeconds},tuneIn:{enabled:F.enabled,minBreakDurationSeconds:F.minBreakDurationSeconds},breakWarnings:{seconds:W.seconds},ptsSource:h.ptsSource??"mediaTime",continueContentDuringBreak:this.continueContentDuringBreak,gam:h.gam?{hasAssetParameters:!1,streamActivityMonitorId:h.gam.streamActivityMonitorId}:void 0},m({adPreload:h.adPreload??t,adInsertion:h.adInsertion??r,adBreakContentRecovery:R},{preloadMode:w,insertionMode:H,contentRecovery:V},(e,t,s)=>this.diagnose(e,t,s)),this.manifestService=new g(this.debug,h.interceptManifestResponse,(e,t,s)=>this.diagnose(e,t,s),h.interceptManifestRequest),this.breakScheduler=new y(this.player,this.debug,G,void 0,F,(e,t,s)=>this.diagnose(e,t,s),W,this.metadataCueTracker,j),this.adPlayerController=new P(h.player,h.container,h.playerContainer,h.createAdAdapter,this.debug,h.gam,w,H,h.adBreakCutSafetyMarginSec??i,h.doubleBoxAudio??a,p("undefined"!=typeof navigator?navigator.userAgent:"","undefined"!=typeof navigator?navigator.maxTouchPoints??0:0),f,V),this.adPlayerController.setTransitionPhaseReporter(this.debug?e=>this.breakTransitionTimer?.phase(e):null),A(this.adPlayerController,()=>this.metadataCueTracker),this.adPlayerController.setChainResolver(G.enabled?e=>this.breakScheduler.getChainedSuccessor(e):null),this.adPlayerController.initialize();const J=(e,t)=>void 0===e||void 0===t?{}:{adIndex:e,totalAds:t};this.adPlayerController.setGamEventCallbacks({onAdFirstQuartile:(e,t,s,r)=>{this.emit("adfirstquartile",{type:"adfirstquartile",timestamp:Date.now(),break:e,format:this.effectiveFormatOf(e),asset:t,...J(s,r)})},onAdMidpoint:(e,t,s,r)=>{this.emit("admidpoint",{type:"admidpoint",timestamp:Date.now(),break:e,format:this.effectiveFormatOf(e),asset:t,...J(s,r)})},onAdThirdQuartile:(e,t,s,r)=>{this.emit("adthirdquartile",{type:"adthirdquartile",timestamp:Date.now(),break:e,format:this.effectiveFormatOf(e),asset:t,...J(s,r)})}}),this.adPlayerController.setDiagnoseHandler((e,t,s)=>{this.diagnose(e,t,s)}),this.pauseAdController=x(this.adPlayerController,{debug:this.debug,diagnose:(e,t,s)=>this.diagnose(e,t,s)}),this.adPlayerController.setVolumeChangeCallback((e,t)=>{this.emit("volumechange",{type:"volumechange",timestamp:Date.now(),muted:e,volume:t})}),this.breakLifecycle=new $(this.state,{adPlayerController:this.adPlayerController,breakScheduler:this.breakScheduler,manifestService:this.manifestService,breakTransitionTimer:this.breakTransitionTimer,breakChainRecorder:this.breakChainRecorder,cmcdAdReporter:this.cmcdAdReporter,adBreakStatusTracker:this.adBreakStatusTracker,emit:(e,t)=>this.emit(e,t),diagnose:(e,t,s)=>this.diagnose(e,t,s),log:(...e)=>this.log(...e),effectiveFormatOf:e=>this.effectiveFormatOf(e),onBreakSettled:()=>this.sessionStarter?.applyPendingChannelSwitch(),onBreakEnded:()=>this.externalPlayback.handleBreakEnded()});const X={player:this.player,debug:this.debug,mode:this.mode,hasExplicitMode:this.hasExplicitMode,continueContentDuringBreak:this.continueContentDuringBreak,startLivePushback:()=>this.liveStartPushback.start(),manifestService:this.manifestService,breakScheduler:this.breakScheduler,adPlayerController:this.adPlayerController,pauseAdController:this.pauseAdController,breakLifecycle:this.breakLifecycle,cmcdAdReporter:this.cmcdAdReporter,lensReporter:this.lensReporter,adBreakStatusTracker:this.adBreakStatusTracker,externalPlayback:this.externalPlayback,externalVendorConfigurationTracker:this.externalVendorConfigurationTracker,emit:(e,t)=>this.emit(e,t),diagnose:(e,t,s)=>this.diagnose(e,t,s),log:(...e)=>this.log(...e),endSessionInternal:e=>this.endSessionInternal(e),notedManifestBreakIds:e=>b(e,this.seenManifestBreakIds)};this.sessionStarter=new z(this.state,X),this.ssbSwitch=new I(this.state,this.sessionStarter,X);for(const[e,t]of this.contentListeners())this.player.on(e,t);this.log("OptiViewAds SDK initialized")}initSsai(e){if(!e.gam)throw new Error('[OptiViewAds] mode "ssai" requires a gam config.');if(!e.ssai?.networkCode)throw new Error('[OptiViewAds] mode "ssai" requires an ssai config (networkCode).');const t=e.ssai;this.diagnosticBuffer=new L(e.diagnostics?.bufferSize);const s=e.autoplay??!1;this.state.configSummary={mode:this.mode,adPreload:"n/a",adInsertion:"ssai",chaining:{enabled:!1,maxGapSeconds:0},tuneIn:{enabled:!1,minBreakDurationSeconds:0},gam:{networkCode:t.networkCode,hasAssetParameters:!1,streamActivityMonitorId:e.gam.streamActivityMonitorId},ssai:{maxBitrate:e.maxBitrate,autoplay:s},continueContentDuringBreak:this.continueContentDuringBreak},this.state.ssaiController=new h(this.player,{gam:e.gam,ssai:t,maxBitrate:e.maxBitrate,autoplay:s,debug:this.debug},{emit:(e,t)=>this.emit(e,t),diagnose:(e,t,s)=>this.diagnose(e,t,s),log:(...e)=>this.log(...e)}),this.player.on("volumechange",()=>{this.emit("volumechange",{type:"volumechange",timestamp:Date.now(),muted:this.player.muted,volume:this.player.volume})}),this.sessionStarter=new z(this.state,{player:this.player,debug:this.debug,mode:this.mode,hasExplicitMode:this.hasExplicitMode,continueContentDuringBreak:this.continueContentDuringBreak,startLivePushback:()=>this.liveStartPushback.start(),manifestService:this.manifestService,breakScheduler:this.breakScheduler,adPlayerController:this.adPlayerController,pauseAdController:this.pauseAdController,breakLifecycle:this.breakLifecycle,cmcdAdReporter:this.cmcdAdReporter,lensReporter:this.lensReporter,externalPlayback:this.externalPlayback,adBreakStatusTracker:this.adBreakStatusTracker,externalVendorConfigurationTracker:this.externalVendorConfigurationTracker,emit:(e,t)=>this.emit(e,t),diagnose:(e,t,s)=>this.diagnose(e,t,s),log:(...e)=>this.log(...e),endSessionInternal:e=>this.endSessionInternal(e),notedManifestBreakIds:e=>b(e,this.seenManifestBreakIds)});for(const[e,t]of this.contentListeners())this.player.on(e,t);this.log("OptiViewAds SDK initialized (SSAI mode)")}contentListeners(){const e=[["seeked",this.onContentSeeked],["waiting",this.onContentWaiting],["playing",this.onContentPlaying],["pause",this.onContentPause],["ended",this.onContentEnded],["error",this.onContentError],["externalplaybackchange",this.externalPlayback.onPlayerChange]];return this.metadataCueTracker&&e.push(["timedmetadata",this.onTimedMetadata]),e}async startSession(e){return this.sessionStarter.startSession(e)}play(){return this.adPlayerController?.isAdPlaying()?(this.log("play() suppressed — ad break is active"),Promise.resolve()):this.player.play()}pause(){this.adPlayerController?.isAdPlaying()?this.log("pause() suppressed — ad break is active"):this.player.pause()}seek(e){if(!this.state.sessionActive)return;const t=this.breakScheduler?.getActiveBreak();t?.controls?.snapback?this.log("seek() suppressed — break has snapback enabled"):(this.breakScheduler?.notifyViewerSeek(),this.player.seek(e))}get muted(){return this.adPlayerController?this.adPlayerController.muted:this.player.muted}set muted(e){this.adPlayerController?this.adPlayerController.muted=e:this.player.muted=e}get volume(){return this.adPlayerController?this.adPlayerController.volume:this.player.volume}set volume(e){this.adPlayerController?this.adPlayerController.volume=e:this.player.volume=e}skipAd(){const e=this.adBreakStatusTracker.activeBreak;if(!this.state.sessionActive||!this.adPlayerController?.isAdPlaying()||!e)return this.log("skipAd() suppressed — no active ad break"),!1;const t=e.controls?.skipOffset;if(null==t)return this.log(`skipAd() suppressed — break '${e.id}' declares no controls.skipOffset`),this.diagnose("DA-AD-SKIP-SUPPRESSED","Skip requested but break declares no skipOffset",{breakId:e.id}),!1;const s=this.adBreakStatusTracker.activeBreakElapsedSec;return s<t?(this.log(`skipAd() suppressed — skipOffset ${t}s not reached (${s}s)`),this.diagnose("DA-AD-SKIP-SUPPRESSED","Skip requested before skipOffset",{breakId:e.id,skipOffset:t,elapsedSec:s}),!1):(this.log(`skipAd() — skipping break '${e.id}' at ${s}s (skipOffset ${t}s)`),this.diagnose("DA-AD-SKIPPED","Break skipped by viewer",{breakId:e.id,skipOffset:t,elapsedSec:s}),this.cmcdAdReporter.onSkipRequested(e.id),this.adPlayerController.skipBreak(),!0)}clickAd(){const e=this.adBreakStatusTracker.activeBreak,t=this.adPlayerController?.currentAdAsset()??null;if(!(this.state.sessionActive&&this.adPlayerController?.isAdPlaying()&&e&&t))return this.log("clickAd() suppressed — no ad on screen"),null;const s=t.interaction?.clickThrough;return this.diagnose("DA-AD-CLICKED","Ad clicked",{breakId:e.id,assetId:t.id,clickThrough:s??""}),this.emit("adclick",{type:"adclick",timestamp:Date.now(),break:e,format:this.effectiveFormatOf(e),asset:t,...s?{clickThrough:s}:{}}),s??null}endSession(){this.state.sessionActive&&this.endSessionInternal()}updateAssetParameters(e){if(!this.state.sessionActive)return void console.warn("[OptiViewAds] updateAssetParameters called but no active session.");const t="ssai"===this.mode||this.state.steeredSsaiActive;(t?this.state.ssaiController:this.adPlayerController).updateAssetParameters(e),this.log("Asset parameters updated"+(t?" (SSAI)":""))}updateAssetParameterMacros(e){if(!this.state.sessionActive)return void console.warn("[OptiViewAds] updateAssetParameterMacros called but no active session.");const t="ssai"===this.mode||this.state.steeredSsaiActive;(t?this.state.ssaiController:this.adPlayerController).updateAssetParameterMacros(e),this.log("Asset parameter macros updated"+(t?" (SSAI)":""))}getExternalVendorConfiguration(e){return j(this.state,this.externalVendorConfigurationTracker.entries,this.mode,this.adPlayerController,e)}endSessionInternal(e="end-session"){this.liveStartPushback.stop(),this.externalPlayback.setManaged(!1),this.ssbSwitch?.reset(),this.state.sessionActive=!1,this.state.sessionGeneration++,this.breakLifecycle?.reportAbandonedBreak(e),"ssai"===this.mode?this.state.ssaiController?.stop():(this.state.steeredSsaiActive&&(this.state.ssaiController?.stop(),delete this.state.ssaiController,this.state.steeredSsaiActive=!1),this.manifestService?.reset(),this.breakScheduler?.stop(),this.breakScheduler?.destroy(),this.adBreakStatusTracker.resetAdBreakStatus(),this.state.pauseAdTickInterval&&(clearInterval(this.state.pauseAdTickInterval),this.state.pauseAdTickInterval=null),this.sessionStarter?.clearHeldImmediatePreRollArm(),this.pauseAdController?.reset(),this.breakChainRecorder?.flush(),this.breakTransitionTimer?.reset(),this.adPlayerController?.stopActiveBreak(),this.adPlayerController?.releaseContentHold(),this.adPlayerController?.endGamSession()),this.state.clearSessionIdentity(),this.externalVendorConfigurationTracker.reset(),this.anvatoObservedLogged.clear(),this.seenManifestBreakIds.clear(),this.cmcdAdReporter.onSessionEnd(),this.lensReporter.endSession(),this.diagnose("DA-SESSION-ENDED","Session ended"),this.log("Session ended")}addEventListener(e,t){this.eventHandlers.has(e)||this.eventHandlers.set(e,new Set),this.eventHandlers.get(e).add(t)}removeEventListener(e,t){const s=this.eventHandlers.get(e);s&&s.delete(t)}emit(e,t){V(this.diagnosticBuffer,t),this.cmcdAdReporter.onEvent(t);const s=this.eventHandlers.get(e);if(s)for(const e of s)try{e(t)}catch(e){this.log("Event handler error:",e)}}onDiagnostic(e){this.diagnosticHandlers.add(e)}offDiagnostic(e){this.diagnosticHandlers.delete(e)}exportDiagnostics(){return W(this.state,this.diagnosticBuffer.getAll())}diagnose(e,t,s){if(this.destroyed)return;const r=H[e],i={ts:Date.now(),level:r?.level??"info",code:e,category:r?.category??"unknown",message:t,...s?{context:s}:{}};this.diagnosticBuffer.record(i);for(const e of this.diagnosticHandlers)try{e(i)}catch(e){this.log("Diagnostic handler error:",e)}this.debug&&F("[OptiViewAds]",e,t,s??"")}isAdPlaying(){return this.adPlayerController?.isAdPlaying()??!1}isPictureInPicture(){return this.adPlayerController?.isPictureInPicture()??!1}getPresentationState(){return{pictureInPicture:this.isPictureInPicture(),showing:this.adPlayerController?.isShowingAd()?"ad":"content",insertion:this.adPlayerController?.currentInsertionMode()??"overlay",windowOwner:this.adPlayerController?.pictureInPictureOwner()??null}}effectiveFormatOf(e){const t=this.adPlayerController?.declaredFormatOf(e)??R(e);return w(t,this.isPictureInPicture())}isSessionActive(){return this.state.sessionActive}getAdBreakStatus(){return this.adBreakStatusTracker.getAdBreakStatus()}destroy(){this.contentErrorReloadGuard.dispose(),this.externalPlayback.dispose(),this.ssbSwitch?.dispose();for(const[e,t]of this.contentListeners())this.player.off(e,t);this.state.sessionActive&&this.endSessionInternal("destroy"),this.manifestService?.destroy(),this.pauseAdController?.destroy(),this.adPlayerController?.destroy(),this.state.ssaiController?.stop(),this.lensReporter.destroy(),this.eventHandlers.clear(),this.diagnosticHandlers.clear(),this.destroyed=!0,this.log("Destroyed")}log(...e){this.debug&&F("[OptiViewAds]",...e)}}
|
|
1
|
+
import{createScheduledBreaksTracker as e,noteScheduledBreakEvent as t}from"./session/scheduledBreaksSession";import{DEFAULT_MODE as s,DEFAULT_AD_PRELOAD_MODE as i,DEFAULT_AD_BREAK_CONTENT_RECOVERY as r,DEFAULT_AD_INSERTION_MODE as a,DEFAULT_AD_BREAK_CUT_SAFETY_MARGIN_SEC as n,DEFAULT_DOUBLE_BOX_AUDIO as o,resolveChaining as d,resolveTuneIn as l,resolveBreakWarnings as h,resolvePdtGraceSeconds as c}from"./types/OptiViewAdsConfig";import{SsaiController as u}from"./services/SsaiController";import{resolvePreloadMode as m}from"./services/detectPreloadMode";import{resolveContentRecovery as p}from"./services/detectContentRecovery";import{emitResolvedModeDiagnostics as k}from"./services/resolvedModeDiagnostics";import{isSingleSurfaceWebDevice as g,resolveInsertionMode as y}from"./services/detectInsertionMode";import{ManifestService as f}from"./services/ManifestService";import{BreakScheduler as S,systemClock as v}from"./services/BreakScheduler";import{MetadataCueTracker as b}from"./services/MetadataCueTracker";import{armBreakFromPresentedCue as C,diagnoseAnvatoCueObserved as P,notedManifestBreakIds as A,wireCueResume as B}from"./services/anvatoCueRuntime";import{AdPlayerController as w}from"./services/AdPlayerController";import{effectiveFormat as T}from"./services/pictureInPicture";import{ReloadGuard as D}from"./services/ReloadGuard";import{createExternalPlaybackGate as I}from"./session/createExternalPlaybackGate";import{SsbSwitchController as R}from"./session/SsbSwitch";import{configureVodSnapback as x,createSnapbackHandler as E}from"./session/contentSnapback";import{resolveBreakFormat as M}from"./services/AdBreakSequencer";import{connectPauseAd as O}from"./services/adPlayer/connectPauseAd";import{createBreakMeasurement as L}from"./session/breakMeasurement";import{LensReporter as V}from"./services/LensReporter";import{CmcdAdReporter as G}from"./services/CmcdAdReporter";import{DiagnosticBuffer as H}from"./diagnostics/DiagnosticBuffer";import{recordEventTimeline as F}from"./diagnostics/recordEventTimeline";import{dispatchDiagnostic as U}from"./diagnostics/dispatchDiagnostic";import{SDK_VERSION as q}from"./generated/version";import{playbackErrorContext as K}from"./diagnostics/playbackErrorContext";import{debugLog as N}from"./diagnostics/debugLog";import{AdBreakStatusTracker as W}from"./session/AdBreakStatusTracker";import{BreakLifecycle as $}from"./session/BreakLifecycle";import{SessionStarter as z}from"./session/SessionStarter";import{updateSessionAssetParameterMacros as Q,updateSessionAssetParameters as j}from"./session/SessionStarterHelpers";import{subscribeManifestUrlDiscovery as Y}from"./session/DiscoveredManifestUrl";import{SessionState as J}from"./session/SessionState";import{LiveStartPushbackController as X}from"./services/LiveStartPushbackController";import{buildDiagnosticReport as Z}from"./services/diagnosticReport";import{toPlaybackError as _}from"./services/toPlaybackError";import{readExternalVendorConfiguration as ee}from"./services/externalVendorConfigurationGetter";import{createExternalVendorConfigurationTracker as te}from"./services/ExternalVendorConfigurationTracker";export class OptiViewAds{static get version(){return q}constructor(t){if(this.contentErrorReloadGuard=new D(e=>this.breakScheduler?.setContentReloading(e),5e3),this.eventHandlers=new Map,this.diagnosticHandlers=new Set,this.destroyed=!1,this.externalVendorConfigurationTracker=te(e=>this.emit("externalvendorconfigurationchange",e)),this.continueContentDuringBreak=!1,this.state=new J,this.scheduledBreaks=e(()=>this.adPlayerController,()=>this.metadataCueTracker,(e,t)=>this.emit(e,t)),this.metadataCueTracker=null,this.anvatoObservedLogged=new Set,this.seenManifestBreakIds=new Set,this.unsubscribeManifestUrlDiscovery=()=>{},this.player=t.player,this.liveStartPushback=new X(this.player,t.liveStartPushback,{blocked:()=>!this.state.sessionActive||this.state.channelSwitchInFlight||!!this.adPlayerController?.isAdPlaying()||!!this.state.heldImmediatePreRollId,setSeeking:e=>this.breakScheduler?.setStartupSeeking(e),diagnose:(e,t,s)=>this.diagnose(e,t,s)}),this.debug=t.debug??!1,this.mode=t.mode??s,this.hasExplicitMode=void 0!==t.mode,this.lensReporter=new V((...e)=>this.log(...e)),this.cmcdAdReporter=new G(()=>this.lensReporter.handle,(...e)=>this.log(...e)),this.externalPlayback=I(t.player,t.externalPlayback,{scheduler:()=>this.breakScheduler,diagnose:(e,t,s)=>this.diagnose(e,t,s),onAllowed:e=>this.ssbSwitch?.onAllowed(e),ssbSwitchPhase:()=>this.state.ssb?.phase??null}),this.adBreakStatusTracker=new W({externalPlaybackAllowed:()=>this.externalPlayback.managed?this.externalPlayback.isAllowedNow():void 0,deliveryMode:()=>this.state.sessionDeliveryMode??void 0,emit:(e,t)=>this.emit(e,t),effectiveFormatOf:e=>this.effectiveFormatOf(e),secondsUntilBreak:e=>this.breakScheduler?.getSecondsUntilBreak(e)??void 0,breakTransitionTimer:()=>this.breakTransitionTimer}),this.onContentSeeked=E({player:this.player,state:this.state,activeBreak:()=>this.breakScheduler?.getActiveBreak(),onViewerSeek:()=>this.sessionStarter?.discardPreparedGamSessionAfterSeek(),onSeeked:()=>this.breakScheduler?.notifySeeked(),log:(...e)=>this.log(...e)}),this.onContentWaiting=()=>{this.adPlayerController?.isAdPlaying()||this.emit("waiting",{type:"waiting",timestamp:Date.now(),source:"content"})},this.onContentPlaying=()=>{this.adPlayerController?.isAdPlaying()||this.ssbSwitch?.isActive||(this.sessionStarter?.playbackStart.onPlaying(),this.breakTransitionTimer?.settle("out-of-break"),!1!==this.pauseAdController?.onResume()?this.emit("playing",{type:"playing",timestamp:Date.now(),source:"content"}):this.player.pause())},this.onContentPause=()=>{this.adPlayerController?.isAdPlaying()||this.ssbSwitch?.isActive||this.breakScheduler?.isAdStartDelayActive()||this.pauseAdController?.onPause()},this.onContentEnded=()=>{this.adPlayerController?.isAdPlaying()||this.breakScheduler?.markPlaybackEnd()},this.onContentError=e=>{this.sessionStarter?.cancelHeldImmediatePreRollOnContentError();const t=_(e,"Content playback error");this.diagnose("DA-CONTENT-PLAYBACK-ERROR",t.message,K(e)),this.contentErrorReloadGuard.arm(),this.emit("aderror",{type:"aderror",timestamp:Date.now(),source:"content",error:t})},this.onTimedMetadata=e=>{if(!e)return;const t=e,s=this.metadataCueTracker?.handleCue(t)??!1;this.metadataCueTracker&&this.adPlayerController?.ingestStreamClockCue(t),P(t,s,this.metadataCueTracker,this.anvatoObservedLogged,this.player.currentTime,(e,t,s)=>this.diagnose(e,t,s)),"presented"===t.phase&&C(t,this.metadataCueTracker,this.breakScheduler)},this.continueContentDuringBreak=t.continueContentDuringBreak??!1,"ssai"===this.mode)return void this.initSsai(t);if(!t.createAdAdapter)throw new Error("[OptiViewAds] createAdAdapter is required. Use the @dolby-optiview/ads-sdk package for a default HLS.js ad player, or supply your own createAdAdapter factory.");this.state.steeredSsaiOptions={maxBitrate:t.maxBitrate,autoplay:t.autoplay??!1,streamActivityMonitorId:t.gam?.streamActivityMonitorId};const u=m(t.adPreload??i),T=t.adBreakContentRecovery??r,M=p(T),F=y(t.adInsertion??a),U=d(t.chaining),q=l(t.tuneIn),N=h(t.breakWarnings),Q=c(t.pdtGraceSeconds);"anvatoCue"===t.ptsSource&&(this.metadataCueTracker=new b(this.diagnose.bind(this))),this.diagnosticBuffer=new H(t.diagnostics?.bufferSize),({timer:this.breakTransitionTimer,recorder:this.breakChainRecorder}=L((e,t,s)=>this.diagnose(e,t,s),{adPreload:u,adInsertion:F})),this.state.configSummary={mode:this.mode,adPreload:u,adBreakContentRecovery:M,adInsertion:F,chaining:{enabled:U.enabled,maxGapSeconds:U.maxGapSeconds},tuneIn:{enabled:q.enabled,minBreakDurationSeconds:q.minBreakDurationSeconds},breakWarnings:{seconds:N.seconds},ptsSource:t.ptsSource??"mediaTime",continueContentDuringBreak:this.continueContentDuringBreak,gam:t.gam?{hasAssetParameters:!1,streamActivityMonitorId:t.gam.streamActivityMonitorId}:void 0},k({adPreload:t.adPreload??i,adInsertion:t.adInsertion??a,adBreakContentRecovery:T},{preloadMode:u,insertionMode:F,contentRecovery:M},(e,t,s)=>this.diagnose(e,t,s)),this.manifestService=new f(this.debug,t.interceptManifestResponse,(e,t,s)=>this.diagnose(e,t,s),t.interceptManifestRequest),this.breakScheduler=new S(this.player,this.debug,U,void 0,q,(e,t,s)=>this.diagnose(e,t,s),N,this.metadataCueTracker,Q),this.adPlayerController=new w(t.player,t.container,t.playerContainer,t.createAdAdapter,this.debug,t.gam,u,F,t.adBreakCutSafetyMarginSec??n,t.doubleBoxAudio??o,g("undefined"!=typeof navigator?navigator.userAgent:"","undefined"!=typeof navigator?navigator.maxTouchPoints??0:0),v,M),x(this.breakScheduler,this.player,e=>"ssai"!==this.state.sessionDeliveryMode&&!this.state.ssb&&null===this.adPlayerController.breakNothingToPlayReason(e),e=>this.adPlayerController.snapbackFormatOf(e)),this.adPlayerController.setTransitionPhaseReporter(this.debug?e=>this.breakTransitionTimer?.phase(e):null),B(this.adPlayerController,()=>this.metadataCueTracker),this.adPlayerController.setChainResolver(U.enabled?e=>this.breakScheduler.getChainedSuccessor(e):null),this.adPlayerController.initialize();const j=(e,t)=>void 0===e||void 0===t?{}:{adIndex:e,totalAds:t};this.adPlayerController.setGamEventCallbacks({onAdFirstQuartile:(e,t,s,i)=>{this.emit("adfirstquartile",{type:"adfirstquartile",timestamp:Date.now(),break:e,format:this.effectiveFormatOf(e),asset:t,...j(s,i)})},onAdMidpoint:(e,t,s,i)=>{this.emit("admidpoint",{type:"admidpoint",timestamp:Date.now(),break:e,format:this.effectiveFormatOf(e),asset:t,...j(s,i)})},onAdThirdQuartile:(e,t,s,i)=>{this.emit("adthirdquartile",{type:"adthirdquartile",timestamp:Date.now(),break:e,format:this.effectiveFormatOf(e),asset:t,...j(s,i)})}}),this.adPlayerController.setDiagnoseHandler((e,t,s)=>{this.diagnose(e,t,s)}),this.pauseAdController=O(this.adPlayerController,{debug:this.debug,diagnose:(e,t,s)=>this.diagnose(e,t,s)}),this.adPlayerController.setVolumeChangeCallback((e,t)=>{this.emit("volumechange",{type:"volumechange",timestamp:Date.now(),muted:e,volume:t})}),this.breakLifecycle=new $(this.state,{adPlayerController:this.adPlayerController,breakScheduler:this.breakScheduler,manifestService:this.manifestService,breakTransitionTimer:this.breakTransitionTimer,breakChainRecorder:this.breakChainRecorder,cmcdAdReporter:this.cmcdAdReporter,adBreakStatusTracker:this.adBreakStatusTracker,emit:(e,t)=>this.emit(e,t),diagnose:(e,t,s)=>this.diagnose(e,t,s),log:(...e)=>this.log(...e),effectiveFormatOf:e=>this.effectiveFormatOf(e),onBreakSettled:()=>this.sessionStarter?.applyPendingChannelSwitch(),onBreakEnded:()=>this.externalPlayback.handleBreakEnded()}),this.breakScheduler.scheduleObserver=this.scheduledBreaks;const Z={player:this.player,debug:this.debug,mode:this.mode,hasExplicitMode:this.hasExplicitMode,continueContentDuringBreak:this.continueContentDuringBreak,manifestUrlDiscovery:t.manifestUrlDiscovery??!1,startLivePushback:()=>this.liveStartPushback.start(),manifestService:this.manifestService,breakScheduler:this.breakScheduler,adPlayerController:this.adPlayerController,pauseAdController:this.pauseAdController,breakLifecycle:this.breakLifecycle,cmcdAdReporter:this.cmcdAdReporter,lensReporter:this.lensReporter,adBreakStatusTracker:this.adBreakStatusTracker,externalPlayback:this.externalPlayback,externalVendorConfigurationTracker:this.externalVendorConfigurationTracker,emit:(e,t)=>this.emit(e,t),diagnose:(e,t,s)=>this.diagnose(e,t,s),log:(...e)=>this.log(...e),endSessionInternal:e=>this.endSessionInternal(e),notedManifestBreakIds:e=>A(e,this.seenManifestBreakIds)};this.sessionStarter=new z(this.state,Z),this.ssbSwitch=new R(this.state,this.sessionStarter,Z),this.unsubscribeManifestUrlDiscovery=Y(this.state,{...Z,startSession:e=>this.startSession(e),endSession:e=>this.endSessionInternal(e)});for(const[e,t]of this.contentListeners())this.player.on(e,t);this.log("OptiViewAds SDK initialized")}initSsai(e){if(!e.gam)throw new Error('[OptiViewAds] mode "ssai" requires a gam config.');if(!e.ssai?.networkCode)throw new Error('[OptiViewAds] mode "ssai" requires an ssai config (networkCode).');const t=e.ssai;this.diagnosticBuffer=new H(e.diagnostics?.bufferSize);const s=e.autoplay??!1;this.state.configSummary={mode:this.mode,adPreload:"n/a",adInsertion:"ssai",chaining:{enabled:!1,maxGapSeconds:0},tuneIn:{enabled:!1,minBreakDurationSeconds:0},gam:{networkCode:t.networkCode,hasAssetParameters:!1,streamActivityMonitorId:e.gam.streamActivityMonitorId},ssai:{maxBitrate:e.maxBitrate,autoplay:s},continueContentDuringBreak:this.continueContentDuringBreak},this.state.ssaiController=new u(this.player,{gam:e.gam,ssai:t,maxBitrate:e.maxBitrate,autoplay:s,debug:this.debug},{emit:(e,t)=>this.emit(e,t),diagnose:(e,t,s)=>this.diagnose(e,t,s),log:(...e)=>this.log(...e)}),this.player.on("volumechange",()=>{this.emit("volumechange",{type:"volumechange",timestamp:Date.now(),muted:this.player.muted,volume:this.player.volume})}),this.sessionStarter=new z(this.state,{player:this.player,debug:this.debug,mode:this.mode,hasExplicitMode:this.hasExplicitMode,continueContentDuringBreak:this.continueContentDuringBreak,manifestUrlDiscovery:e.manifestUrlDiscovery??!1,startLivePushback:()=>this.liveStartPushback.start(),manifestService:this.manifestService,breakScheduler:this.breakScheduler,adPlayerController:this.adPlayerController,pauseAdController:this.pauseAdController,breakLifecycle:this.breakLifecycle,cmcdAdReporter:this.cmcdAdReporter,lensReporter:this.lensReporter,externalPlayback:this.externalPlayback,adBreakStatusTracker:this.adBreakStatusTracker,externalVendorConfigurationTracker:this.externalVendorConfigurationTracker,emit:(e,t)=>this.emit(e,t),diagnose:(e,t,s)=>this.diagnose(e,t,s),log:(...e)=>this.log(...e),endSessionInternal:e=>this.endSessionInternal(e),notedManifestBreakIds:e=>A(e,this.seenManifestBreakIds)});for(const[e,t]of this.contentListeners())this.player.on(e,t);this.log("OptiViewAds SDK initialized (SSAI mode)")}contentListeners(){const e=[["seeked",this.onContentSeeked],["waiting",this.onContentWaiting],["playing",this.onContentPlaying],["pause",this.onContentPause],["ended",this.onContentEnded],["error",this.onContentError],["externalplaybackchange",this.externalPlayback.onPlayerChange]];return this.metadataCueTracker&&e.push(["timedmetadata",this.onTimedMetadata]),e}async startSession(e){return this.sessionStarter.startSession(e)}play(){return this.adPlayerController?.isAdPlaying()?(this.log("play() suppressed — ad break is active"),Promise.resolve()):this.player.play()}pause(){this.adPlayerController?.isAdPlaying()?this.log("pause() suppressed — ad break is active"):this.player.pause()}seek(e){if(!this.state.sessionActive)return;const t=this.breakScheduler?.getActiveBreak();if(t?.controls?.snapback)return void this.log("seek() suppressed — break has snapback enabled");this.breakScheduler?.notifyViewerSeek();const s=this.breakScheduler?.planSeek(e);this.player.seek(s?.target??e)}get muted(){return this.adPlayerController?this.adPlayerController.muted:this.player.muted}set muted(e){this.adPlayerController?this.adPlayerController.muted=e:this.player.muted=e}get volume(){return this.adPlayerController?this.adPlayerController.volume:this.player.volume}set volume(e){this.adPlayerController?this.adPlayerController.volume=e:this.player.volume=e}skipAd(){const e=this.adBreakStatusTracker.activeBreak;if(!this.state.sessionActive||!this.adPlayerController?.isAdPlaying()||!e)return this.log("skipAd() suppressed — no active ad break"),!1;const t=e.controls?.skipOffset;if(null==t)return this.log(`skipAd() suppressed — break '${e.id}' declares no controls.skipOffset`),this.diagnose("DA-AD-SKIP-SUPPRESSED","Skip requested but break declares no skipOffset",{breakId:e.id}),!1;const s=this.adBreakStatusTracker.activeBreakElapsedSec;return s<t?(this.log(`skipAd() suppressed — skipOffset ${t}s not reached (${s}s)`),this.diagnose("DA-AD-SKIP-SUPPRESSED","Skip requested before skipOffset",{breakId:e.id,skipOffset:t,elapsedSec:s}),!1):(this.log(`skipAd() — skipping break '${e.id}' at ${s}s (skipOffset ${t}s)`),this.diagnose("DA-AD-SKIPPED","Break skipped by viewer",{breakId:e.id,skipOffset:t,elapsedSec:s}),this.cmcdAdReporter.onSkipRequested(e.id),this.adPlayerController.skipBreak(),!0)}clickAd(){const e=this.adBreakStatusTracker.activeBreak,t=this.adPlayerController?.currentAdAsset()??null;if(!(this.state.sessionActive&&this.adPlayerController?.isAdPlaying()&&e&&t))return this.log("clickAd() suppressed — no ad on screen"),null;const s=t.interaction?.clickThrough;return this.diagnose("DA-AD-CLICKED","Ad clicked",{breakId:e.id,assetId:t.id,clickThrough:s??""}),this.emit("adclick",{type:"adclick",timestamp:Date.now(),break:e,format:this.effectiveFormatOf(e),asset:t,...s?{clickThrough:s}:{}}),s??null}endSession(){this.state.bumpDiscoveryWaitGeneration(),this.state.sessionActive&&this.endSessionInternal()}updateAssetParameters(e){j(this.state,this.mode,this.adPlayerController,e,e=>this.log(e))}updateAssetParameterMacros(e){Q(this.state,this.mode,this.adPlayerController,e,e=>this.log(e))}getExternalVendorConfiguration(e){return ee(this.state,this.externalVendorConfigurationTracker.entries,this.mode,this.adPlayerController,e)}endSessionInternal(e="end-session"){this.liveStartPushback.stop(),this.externalPlayback.setManaged(!1),this.ssbSwitch?.reset(),this.state.sessionActive=!1,this.state.sessionGeneration++,this.breakLifecycle?.reportAbandonedBreak(e),"ssai"===this.mode?this.state.ssaiController?.stop():(this.state.steeredSsaiActive&&(this.state.ssaiController?.stop(),delete this.state.ssaiController,this.state.steeredSsaiActive=!1),this.manifestService?.reset(),this.breakScheduler?.stop(),this.breakScheduler?.destroy(),this.adBreakStatusTracker.resetAdBreakStatus(),this.state.pauseAdTickInterval&&(clearInterval(this.state.pauseAdTickInterval),this.state.pauseAdTickInterval=null),this.sessionStarter?.clearHeldImmediatePreRollArm(),this.pauseAdController?.reset(),this.breakChainRecorder?.flush(),this.breakTransitionTimer?.reset(),this.adPlayerController?.stopActiveBreak(),this.adPlayerController?.releaseContentHold(),this.adPlayerController?.endGamSession()),this.state.clearSessionIdentity(),this.scheduledBreaks.reset(),this.externalVendorConfigurationTracker.reset(),this.anvatoObservedLogged.clear(),this.seenManifestBreakIds.clear(),this.cmcdAdReporter.onSessionEnd(),this.lensReporter.endSession(),this.diagnose("DA-SESSION-ENDED","Session ended"),this.log("Session ended")}addEventListener(e,t){this.eventHandlers.has(e)||this.eventHandlers.set(e,new Set),this.eventHandlers.get(e).add(t)}removeEventListener(e,t){const s=this.eventHandlers.get(e);s&&s.delete(t)}emit(e,s){const i=this.state.sessionGeneration,r=this.scheduledBreaks.generation;F(this.diagnosticBuffer,s),this.cmcdAdReporter.onEvent(s);const a=this.eventHandlers.get(e);if(a)for(const e of a)try{e(s)}catch(e){this.log("Event handler error:",e)}this.state.sessionActive&&i===this.state.sessionGeneration&&r===this.scheduledBreaks.generation&&t(this.scheduledBreaks,s)}onDiagnostic(e){this.diagnosticHandlers.add(e)}offDiagnostic(e){this.diagnosticHandlers.delete(e)}exportDiagnostics(){return Z(this.state,this.diagnosticBuffer.getAll())}diagnose(e,t,s){this.destroyed||U(this.diagnosticBuffer,this.diagnosticHandlers,this.debug,(...e)=>this.log(...e),e,t,s)}isAdPlaying(){return this.adPlayerController?.isAdPlaying()??!1}isPictureInPicture(){return this.adPlayerController?.isPictureInPicture()??!1}getPresentationState(){return{pictureInPicture:this.isPictureInPicture(),showing:this.adPlayerController?.isShowingAd()?"ad":"content",insertion:this.adPlayerController?.currentInsertionMode()??"overlay",windowOwner:this.adPlayerController?.pictureInPictureOwner()??null}}effectiveFormatOf(e){const t=this.adPlayerController?.declaredFormatOf(e)??M(e);return T(t,this.isPictureInPicture())}isSessionActive(){return this.state.sessionActive}getAdBreakStatus(){return this.adBreakStatusTracker.getAdBreakStatus()}getScheduledBreaks(){return this.state.sessionActive?this.scheduledBreaks.get():[]}destroy(){this.state.bumpDiscoveryWaitGeneration(),this.unsubscribeManifestUrlDiscovery(),this.contentErrorReloadGuard.dispose(),this.externalPlayback.dispose(),this.ssbSwitch?.dispose();for(const[e,t]of this.contentListeners())this.player.off(e,t);this.state.sessionActive&&this.endSessionInternal("destroy"),this.manifestService?.destroy(),this.pauseAdController?.destroy(),this.adPlayerController?.destroy(),this.state.ssaiController?.stop(),this.lensReporter.destroy(),this.eventHandlers.clear(),this.diagnosticHandlers.clear(),this.destroyed=!0,this.log("Destroyed")}log(...e){this.debug&&N("[OptiViewAds]",...e)}}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DiagnosticBuffer } from './DiagnosticBuffer';
|
|
2
|
+
import type { DiagnosticHandler } from './DiagnosticEvent';
|
|
3
|
+
import { type KnownDiagnosticCode } from './errorCodes';
|
|
4
|
+
export declare function dispatchDiagnostic(buffer: DiagnosticBuffer, handlers: ReadonlySet<DiagnosticHandler>, debug: boolean, log: (...args: unknown[]) => void, code: KnownDiagnosticCode, message: string, context?: Record<string, unknown>): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DIAGNOSTIC_CODES as o}from"./errorCodes";import{debugLog as e}from"./debugLog";export function dispatchDiagnostic(r,t,c,n,i,s,a){const d=o[i],g={ts:Date.now(),level:d?.level??"info",code:i,category:d?.category??"unknown",message:s,...a?{context:a}:{}};r.record(g);for(const o of t)try{o(g)}catch(o){n("Diagnostic handler error:",o)}c&&e("[OptiViewAds]",i,s,a??"")}
|
|
@@ -4,6 +4,31 @@
|
|
|
4
4
|
* {@link KnownDiagnosticCode}.
|
|
5
5
|
*/
|
|
6
6
|
export declare const DIAGNOSTIC_CODES: {
|
|
7
|
+
readonly "DA-BOOKMARK-START": {
|
|
8
|
+
readonly category: "break";
|
|
9
|
+
readonly level: "info";
|
|
10
|
+
readonly summary: "VOD bookmark start skipped earlier breaks. context: position, skippedBreakIds.";
|
|
11
|
+
};
|
|
12
|
+
readonly "DA-CONTENT-END-INFERRED": {
|
|
13
|
+
readonly category: "playback";
|
|
14
|
+
readonly level: "info";
|
|
15
|
+
readonly summary: "Content end inferred from the VOD playhead. context: currentTime, duration, trigger (past-end or stalled-at-end).";
|
|
16
|
+
};
|
|
17
|
+
readonly "DA-SNAPBACK-APPLIED": {
|
|
18
|
+
readonly category: "break";
|
|
19
|
+
readonly level: "info";
|
|
20
|
+
readonly summary: "Viewer seek corrected to an unplayed VOD snapback break. context: breakId, target, resumePosition (seek-over of a content-pausing format only).";
|
|
21
|
+
};
|
|
22
|
+
readonly "DA-SNAPBACK-ABANDONED": {
|
|
23
|
+
readonly category: "break";
|
|
24
|
+
readonly level: "warn";
|
|
25
|
+
readonly summary: "VOD snapback correction abandoned after one retry or because the break became ineligible. context: breakId, reason.";
|
|
26
|
+
};
|
|
27
|
+
readonly "DA-SNAPBACK-NOT-APPLIED": {
|
|
28
|
+
readonly category: "break";
|
|
29
|
+
readonly level: "debug";
|
|
30
|
+
readonly summary: "Viewer seek was not eligible for VOD snapback. context: reason, breakId (when known).";
|
|
31
|
+
};
|
|
7
32
|
readonly "DA-SESSION-STARTED": {
|
|
8
33
|
readonly category: "session";
|
|
9
34
|
readonly level: "info";
|
|
@@ -54,6 +79,11 @@ export declare const DIAGNOSTIC_CODES: {
|
|
|
54
79
|
readonly level: "warn";
|
|
55
80
|
readonly summary: "A channel event was ignored because its time window or configuration is invalid, or because events are unsupported for the manifest timebase. context: eventId and index when available.";
|
|
56
81
|
};
|
|
82
|
+
readonly "DA-SLATE-INVALID": {
|
|
83
|
+
readonly category: "manifest";
|
|
84
|
+
readonly level: "warn";
|
|
85
|
+
readonly summary: "The manifest's slate was ignored because it is unusable: not an object, an invalid minDuration, no assets, or an invalid first asset (the only one the player plays). The breaks of that manifest are unaffected and play without a slate. Reported once per distinct fault. context: reason (not-object, invalid-min-duration, no-assets, invalid-asset), assetId when the first asset has one.";
|
|
86
|
+
};
|
|
57
87
|
readonly "DA-PDT-MISSING": {
|
|
58
88
|
readonly category: "playback";
|
|
59
89
|
readonly level: "warn";
|
|
@@ -104,6 +134,11 @@ export declare const DIAGNOSTIC_CODES: {
|
|
|
104
134
|
readonly level: "warn";
|
|
105
135
|
readonly summary: "Ad preload failed; the asset will be loaded on demand at break start.";
|
|
106
136
|
};
|
|
137
|
+
readonly "DA-SLATE-PRELOADED": {
|
|
138
|
+
readonly category: "preload";
|
|
139
|
+
readonly level: "info";
|
|
140
|
+
readonly summary: "The manifest's slate asset was fetched ahead of its first use, on its first appearance in the manifest or when its URL changed, so a break that needs it starts it warm. Best-effort: a failed warm-up never fails a break. context: slateAssetId, mediaType, path (the preload path taken).";
|
|
141
|
+
};
|
|
107
142
|
readonly "DA-PRELOAD-MODE-RESOLVED": {
|
|
108
143
|
readonly category: "preload";
|
|
109
144
|
readonly level: "info";
|
|
@@ -182,7 +217,17 @@ export declare const DIAGNOSTIC_CODES: {
|
|
|
182
217
|
readonly "DA-IMAGE-LOAD-FAILED": {
|
|
183
218
|
readonly category: "break";
|
|
184
219
|
readonly level: "warn";
|
|
185
|
-
readonly summary: "An image (companion, backdrop or image ad) could not be fetched or decoded within the timeout; the break continues without it.";
|
|
220
|
+
readonly summary: "An image (companion, backdrop or image ad) could not be fetched or decoded within the timeout, or exceeded the size limit; the break continues without it.";
|
|
221
|
+
};
|
|
222
|
+
readonly "DA-IMAGE-ANIMATED": {
|
|
223
|
+
readonly category: "break";
|
|
224
|
+
readonly level: "debug";
|
|
225
|
+
readonly summary: "An animated image (GIF or animated WebP) started animating on a companion, backdrop, image ad or pause image. Native renderers only: browsers animate the image element themselves. context: surface ('companion', 'backdrop', 'image-ad' or 'pause'), uri, frameCount (iOS/tvOS; null on Android).";
|
|
226
|
+
};
|
|
227
|
+
readonly "DA-IMAGE-ANIMATION-UNSUPPORTED": {
|
|
228
|
+
readonly category: "break";
|
|
229
|
+
readonly level: "warn";
|
|
230
|
+
readonly summary: "An image is animated but this device cannot animate it, so its first frame is shown. context: surface, uri, reason ('api-below-28' on Android below API 28; 'canvas-too-large' on iOS/tvOS when the animation exceeds the decode budget).";
|
|
186
231
|
};
|
|
187
232
|
readonly "DA-PIP-TRANSFER-FAILED": {
|
|
188
233
|
readonly category: "break";
|
|
@@ -302,7 +347,37 @@ export declare const DIAGNOSTIC_CODES: {
|
|
|
302
347
|
readonly "DA-EXTERNAL-PLAYBACK-BLOCKED": {
|
|
303
348
|
readonly category: "playback";
|
|
304
349
|
readonly level: "warn";
|
|
305
|
-
readonly summary: "AirPlay was requested while an ad break is active or about to start; the content player stays on the device and the request is retried when the break ends.";
|
|
350
|
+
readonly summary: "AirPlay was requested while an ad break is active or about to start; the content player stays on the device and the request is retried when the break ends. On iOS the running ad plays on the receiver meanwhile.";
|
|
351
|
+
};
|
|
352
|
+
readonly "DA-AD-ROUTE-CHANGED": {
|
|
353
|
+
readonly category: "playback";
|
|
354
|
+
readonly level: "info";
|
|
355
|
+
readonly summary: "iOS: the audio route changed while an ad break played; context carries the route change reason, the current and previous outputs and a snapshot of the ad player (time control status, waiting reason, rate, buffer flags, external playback, ad and content state).";
|
|
356
|
+
};
|
|
357
|
+
readonly "DA-AD-TIMECONTROL": {
|
|
358
|
+
readonly category: "playback";
|
|
359
|
+
readonly level: "info";
|
|
360
|
+
readonly summary: "iOS: the ad player's timeControlStatus or reasonForWaitingToPlay changed during an ad break; context.field names which, with the ad player snapshot.";
|
|
361
|
+
};
|
|
362
|
+
readonly "DA-AD-ITEM-STALLED": {
|
|
363
|
+
readonly category: "playback";
|
|
364
|
+
readonly level: "warn";
|
|
365
|
+
readonly summary: "iOS: the ad player's current item reported a playback stall during an ad break; context carries the ad player snapshot.";
|
|
366
|
+
};
|
|
367
|
+
readonly "DA-AD-AUDIO-INTERRUPTION": {
|
|
368
|
+
readonly category: "playback";
|
|
369
|
+
readonly level: "warn";
|
|
370
|
+
readonly summary: "iOS: an audio-session interruption began or ended during an ad break (context.type, options, wasSuspended) with the ad player snapshot.";
|
|
371
|
+
};
|
|
372
|
+
readonly "DA-AD-INTERRUPTION-RESUMED": {
|
|
373
|
+
readonly category: "playback";
|
|
374
|
+
readonly level: "warn";
|
|
375
|
+
readonly summary: "iOS: an ad paused by an audio-session interruption was restarted after the audio session was reactivated; context.trigger is interruption-ended, route-changed, player-paused or retry, stalledSec how long the ad was stopped.";
|
|
376
|
+
};
|
|
377
|
+
readonly "DA-AD-AUDIO-SESSION-REACTIVATE-FAILED": {
|
|
378
|
+
readonly category: "playback";
|
|
379
|
+
readonly level: "warn";
|
|
380
|
+
readonly summary: "iOS: reactivating the audio session before restarting an interrupted ad failed (context.errorCode, errorDomain, trigger); the SDK retries once a second, up to five times.";
|
|
306
381
|
};
|
|
307
382
|
readonly "DA-SSB-SWITCH-FAILED": {
|
|
308
383
|
readonly category: "playback";
|
|
@@ -499,6 +574,11 @@ export declare const DIAGNOSTIC_CODES: {
|
|
|
499
574
|
readonly level: "error";
|
|
500
575
|
readonly summary: "The Google IMA client-side SDK (ima3.js) is unavailable; VAST (CSAI) ads cannot be played.";
|
|
501
576
|
};
|
|
577
|
+
readonly "DA-PAUSE-AD-ROTATION-EXHAUSTED": {
|
|
578
|
+
readonly category: "break";
|
|
579
|
+
readonly level: "info";
|
|
580
|
+
readonly summary: "No unused pause breaks remain in the rotation; nothing was shown.";
|
|
581
|
+
};
|
|
502
582
|
readonly "DA-PAUSE-AD-SHOWN": {
|
|
503
583
|
readonly category: "break";
|
|
504
584
|
readonly level: "info";
|
|
@@ -714,16 +794,41 @@ export declare const DIAGNOSTIC_CODES: {
|
|
|
714
794
|
readonly level: "warn";
|
|
715
795
|
readonly summary: "Split break reframing degraded: the host supplied no content view or sibling container for the ad.";
|
|
716
796
|
};
|
|
797
|
+
readonly "DA-SLATE-STARTED": {
|
|
798
|
+
readonly category: "break";
|
|
799
|
+
readonly level: "info";
|
|
800
|
+
readonly summary: "The slate began playing in a break because no ad covered the rest of it; it plays until the break's scheduled end (adbreakbegin plus the effective duration) and then the break ends as any other. No adbegin/adend is emitted for it. context: breakId, slateAssetId, reason (ads-ended: the last ad ended before the break end; no-ad: no ad could play), durationSec (the real time left to the scheduled end, so time lost to failed ad attempts and start-up shortens it), adsPlayedSec, effectiveDurationSec, minDurationSec.";
|
|
801
|
+
};
|
|
802
|
+
readonly "DA-SLATE-NOT-STARTED": {
|
|
803
|
+
readonly category: "break";
|
|
804
|
+
readonly level: "info";
|
|
805
|
+
readonly summary: "A break with a slate left part of its time uncovered but the slate did not start: less than the slate's minDuration remained (below-min-duration), or the stitched stream fills the break (not-rendered: a time-based break under ssai delivery, or while an SSB stream plays). The break ends as without a slate. context: breakId, reason, remainingSec, minDurationSec.";
|
|
806
|
+
};
|
|
807
|
+
readonly "DA-SLATE-ENDED": {
|
|
808
|
+
readonly category: "break";
|
|
809
|
+
readonly level: "info";
|
|
810
|
+
readonly summary: "The slate stopped playing. context: breakId, slateAssetId, plannedSec (the real time left to the break's scheduled end when the slate started), filledSec (seconds the slate was on screen: start-up, stalls and loop restarts shorten it, never the break), loops (completed plays of a video slate), interruptedSec (time it was not presenting), breakOverrunSec (the slate's end minus the scheduled end, signed: about 0 at break-end, negative when ended early), reason (break-end: the scheduled end was reached; skipped, removed, resumed: ended early).";
|
|
811
|
+
};
|
|
812
|
+
readonly "DA-SLATE-FAILED": {
|
|
813
|
+
readonly category: "playback";
|
|
814
|
+
readonly level: "error";
|
|
815
|
+
readonly summary: "The slate could not load or play (load error, or it did not present within the ad-start budget); the break ends as without a slate and a public aderror carries the slate asset. context: breakId, slateAssetId, reason (load, stalled), error.";
|
|
816
|
+
};
|
|
717
817
|
readonly "DA-BREAK-NO-PLAYABLE-ASSET": {
|
|
718
818
|
readonly category: "break";
|
|
719
819
|
readonly level: "warn";
|
|
720
|
-
readonly summary: "A break had nothing to play, so it never began: no adbreakbegin/adbreakend was emitted, content kept playing, and a public aderror (source ad, carrying the break) reports it. context.reason says why: no-variant (none declared), no-qualifying-variant (variant selection - device targeting + format playability - matched nothing and no downgrade applied), no-assets (the selected variant was empty), or lshape-content-skipped (shared-element insertion cannot render a backdrop). This is the BREAK-level outcome; when a particular variant was passed over for an unrecognised format, DA-BREAK-VARIANT-FORMAT-UNKNOWN names that format alongside it. context: breakId, reason, declaredAssetCount, format.";
|
|
820
|
+
readonly summary: "A break had nothing to play, so it never began: no adbreakbegin/adbreakend was emitted, content kept playing, and a public aderror (source ad, carrying the break) reports it. When the manifest carries a slate that fills the break (reason no-assets only), the break does begin and the slate covers it: the aderror and this diagnostic are still reported, then DA-SLATE-STARTED follows. context.reason says why: no-variant (none declared), no-qualifying-variant (variant selection - device targeting + format playability - matched nothing and no downgrade applied), no-assets (the selected variant was empty), or lshape-content-skipped (shared-element insertion cannot render a backdrop). This is the BREAK-level outcome; when a particular variant was passed over for an unrecognised format, DA-BREAK-VARIANT-FORMAT-UNKNOWN names that format alongside it. context: breakId, reason, declaredAssetCount, format.";
|
|
721
821
|
};
|
|
722
822
|
readonly "DA-BREAK-VARIANT-FORMAT-UNKNOWN": {
|
|
723
823
|
readonly category: "break";
|
|
724
824
|
readonly level: "warn";
|
|
725
825
|
readonly summary: "A break variant declares a format this SDK version does not recognise, so it was passed over during variant selection rather than guessed at - an unknown format is never playable, because rendering it as a fullscreen single would be the most invasive possible misreading. Raised once per skipped variant: a break that still has a playable variant plays it and reports this too, so the skip is never silent, and a break left with nothing also reports DA-BREAK-NO-PLAYABLE-ASSET with reason no-qualifying-variant. An ABSENT format is treated identically to an unrecognised one. context: breakId, format (the raw manifest string; empty when the field was absent).";
|
|
726
826
|
};
|
|
827
|
+
readonly "DA-BREAK-LSHAPE-ANCHOR-UNKNOWN": {
|
|
828
|
+
readonly category: "break";
|
|
829
|
+
readonly level: "warn";
|
|
830
|
+
readonly summary: "An lshape_ad or lshape_content variant declares an anchor this SDK version does not recognise (manifest spec 1.11.0 knows top_left, top_right, bottom_left and bottom_right), so the break still plays with the video box in the default top_left corner. Raised once per break begin on the selected variant. context: breakId, format, anchor (the raw manifest string).";
|
|
831
|
+
};
|
|
727
832
|
readonly "DA-AD-STALLED": {
|
|
728
833
|
readonly category: "playback";
|
|
729
834
|
readonly level: "warn";
|
|
@@ -769,4 +874,14 @@ export declare const DIAGNOSTIC_CODES: {
|
|
|
769
874
|
readonly level: "info";
|
|
770
875
|
readonly summary: "A step of startSession() was entered: begin, manifest-fetch, gam-init or scheduling. Emitted on entry, so the last one recorded names the step a hung startSession never finished. context: step, manifestUrl, elapsedMs. The URL is reported verbatim; the redacted config summary carries only its origin (config.manifestOrigin).";
|
|
771
876
|
};
|
|
877
|
+
readonly "DA-MANIFEST-URL-DISCOVERED": {
|
|
878
|
+
readonly category: "session";
|
|
879
|
+
readonly level: "info";
|
|
880
|
+
readonly summary: "startSession() was called without a manifestUrl and the SDK started the session with the ads manifest URL the content player discovered (e.g. THEOlive discovery). context: manifestUrl (reported verbatim), source ('player-discovery').";
|
|
881
|
+
};
|
|
882
|
+
readonly "DA-MANIFEST-URL-UNAVAILABLE": {
|
|
883
|
+
readonly category: "session";
|
|
884
|
+
readonly level: "error";
|
|
885
|
+
readonly summary: "startSession() was called without a manifestUrl and no ads manifest URL could be resolved from the player. context: reason ('disabled': the manifestUrlDiscovery config flag is off, 'unsupported-adapter': the adapter cannot discover one, 'no-ads': the player reported none, 'timeout': still pending after the discovery wait).";
|
|
886
|
+
};
|
|
772
887
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const DIAGNOSTIC_CODES={"DA-SESSION-STARTED":{category:"session",level:"info",summary:"Monetization session started; manifest polling began. context: manifestUrl (stitcherUrl in SSAI mode), reported verbatim."},"DA-SESSION-ENDED":{category:"session",level:"info",summary:"Monetization session ended; polling and scheduling stopped."},"DA-ASSET-PARAMETERS-UPDATED":{category:"session",level:"info",summary:"The break manifest's session-level asset parameters changed; the merged parameters were pushed to the active GAM stream. context: source ('manifest'), keys (parameter names only, never values)."},"DA-MANIFEST-FETCH-FAILED":{category:"manifest",level:"error",summary:"Initial break-manifest fetch failed; the session could not start."},"DA-MANIFEST-POLL-FAILED":{category:"manifest",level:"warn",summary:"A manifest poll failed; the SDK keeps the last good manifest and retries."},"DA-MANIFEST-CHANNEL-CHANGED":{category:"manifest",level:"info",summary:"A polled manifest describes a different ads channel (channelId, GAM identity or timebase changed); the SDK re-aligned its ad setup and resolved delivery mode again while the session and content playback continued. context: previousChannelId, channelId, reason, manifestUrl."},"DA-MANIFEST-INTERCEPT-FAILED":{category:"manifest",level:"warn",summary:"The customer manifest-response interceptor threw; the un-modified parsed manifest was used instead."},"DA-MANIFEST-REQUEST-INTERCEPT-FAILED":{category:"manifest",level:"warn",summary:"The customer manifest-request interceptor threw; the normal network fetch of the original URL was used instead."},"DA-MANIFEST-SIGNATURE-INVALID":{category:"manifest",level:"error",summary:"The break-manifest response failed detached-JWS signature verification (missing/malformed X-Manifest-Signature, unsupported alg, unknown kid, unknown critical param, or signature mismatch); the manifest was rejected and no breaks were scheduled. context: url, reason."},"DA-MANIFEST-EVENT-INVALID":{category:"manifest",level:"warn",summary:"A channel event was ignored because its time window or configuration is invalid, or because events are unsupported for the manifest timebase. context: eventId and index when available."},"DA-PDT-MISSING":{category:"playback",level:"warn",summary:"No EXT-X-PROGRAM-DATE-TIME once content is playing (or after the startup backstop window); wallclock-timebase breaks fall back to the system clock."},"DA-ANVATO-CUE-PENDING":{category:"break",level:"info",summary:"ptsSource: 'anvatoCue' — no Anvato in-stream cue observed yet for a PTS break; the break stays pending until its cue arrives."},"DA-ANVATO-CUE-MATCHED":{category:"break",level:"info",summary:"ptsSource: 'anvatoCue' — a PTS break's start was matched to an observed Anvato cue and scheduled at the cue's media time."},"DA-ANVATO-CUE-ENTERED":{category:"break",level:"info",summary:"ptsSource: 'anvatoCue' — a break was started by the cue reaching the playhead rather than by the scheduler's 250ms tick; context carries the breakId, the cue pts and the media time it fired at, so the two start paths are distinguishable in the field."},"DA-ANVATO-CUE-OBSERVED":{category:"break",level:"info",summary:"ptsSource: 'anvatoCue' — an Anvato break-signaling (type=cue) frame was observed in the stream; context carries the cue's pts, the media time it landed at, whether the tracker recorded it, and the raw payload — so a manifest-PTS vs in-stream-PTS misalignment is observable in the field."},"DA-ANVATO-CUE-SEGMENT-ANCHORED":{category:"break",level:"warn",summary:"ptsSource: 'anvatoCue' — an Anvato emsg cue arrived without a ptsOffset from the adapter, so its break is scheduled at the cue's carrying segment start, which can be up to one segment early. Emitted once per session; context: pts, mediaTime."},"DA-ANVATO-CUE-OFFSET-REJECTED":{category:"break",level:"warn",summary:"ptsSource: 'anvatoCue' — the adapter's ptsOffset placed an Anvato cue outside its carrying segment's window (more than 0.1s before or 15s after the cue startTime), so the cue's startTime is used instead. Emitted once per cue pts; context: pts, startTime, ptsOffset, mappedTime."},"DA-ANVATO-CUE-END-MATCHED":{category:"break",level:"info",summary:"ptsSource: 'anvatoCue' — the active break's Anvato type=cue_end was observed and its length on the stream clock (cue_end pts minus the break start pts) is within 2s of the break duration. Emitted once per break; context: breakId, mediaTime (where the player reported the cue_end), lengthSec, durationSec."},"DA-ANVATO-CUE-END-REJECTED":{category:"break",level:"warn",summary:"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."},"DA-PRELOAD-FAILED":{category:"preload",level:"warn",summary:"Ad preload failed; the asset will be loaded on demand at break start."},"DA-PRELOAD-MODE-RESOLVED":{category:"preload",level:"info",summary:"The configured ad preload mode was resolved for this session; context carries both the configured and the resolved mode."},"DA-PRELOAD-PATH":{category:"preload",level:"info",summary:"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)."},"DA-BREAK-EARLY-RETURN":{category:"break",level:"info",summary:"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."},"DA-BREAK-WINDOW-ESCAPED":{category:"break",level:"warn",summary:"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."},"DA-BREAK-EVENT-UNSUPPORTED":{category:"break",level:"warn",summary:"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."},"DA-BREAK-SUPPRESSED-OVERLAP":{category:"break",level:"warn",summary:"A break was suppressed because an ad was already playing."},"DA-BREAK-TRANSITION":{category:"break",level:"info",summary:"Measured duration of a playback transition into an ad break, between two ads, between chained breaks, or back to content. A break-to-break switch runs from the outgoing ad's end to the incoming ad's first frame and adds path (queued, late-queued or cold) and, when the incoming ad was buffered, leadMs. On web an ad-to-ad switch adds path (queued or cold) and leadMs too."},"DA-BREAK-CHAIN":{category:"chaining",level:"info",summary:"Summary of one chain of back-to-back breaks, emitted once when content plays again (or the chain is flushed): chainId, per break its id, scheduledStart, plannedDurationSec, beganAtMs, endedAtMs, playedSec, announcedDuringChain and path, per switch its gapMs and path, contentResumeMs and totalMs."},"DA-AD-SURFACE-REVEALED":{category:"break",level:"info",summary:"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. On web, an ad shown before its first frame reports reason shown-before-frame with visibleGapMs, the time on screen without a picture."},"DA-BREAK-CUT-LATE":{category:"break",level:"warn",summary:"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."},"DA-PREROLL-CONTENT-HELD":{category:"break",level:"info",summary:"Content playback was held at session start until a pending pre-roll began, so no content is shown before the ad."},"DA-PREROLL-CONTENT-WAIT-TIMEOUT":{category:"break",level:"info",summary:"A pending pre-roll began after content readiness was not reported within the wait timeout."},"DA-PREROLL-CANCELLED-CONTENT-ERROR":{category:"break",level:"warn",summary:"A pending pre-roll was cancelled because the content failed to load before it could begin."},"DA-SHARED-ELEMENT-UNSUPPORTED":{category:"break",level:"warn",summary:"Configured shared-element insertion is unsupported on this platform (non-iPhone/iPod); fell back to overlay insertion."},"DA-SHARED-ELEMENT-RESTORE-FAILED":{category:"playback",level:"error",summary:"Content did not resume after a shared-element break: the reload/seek/play restore failed twice; the viewer is left paused on the handed-back element."},"DA-IMAGE-LOAD-FAILED":{category:"break",level:"warn",summary:"An image (companion, backdrop or image ad) could not be fetched or decoded within the timeout; the break continues without it."},"DA-PIP-TRANSFER-FAILED":{category:"break",level:"warn",summary:"The picture-in-picture window could not be moved between the content and ad elements; the break continues but the viewer may not see the ad in the PiP window."},"DA-PIP-AUTODETECT-UNAVAILABLE":{category:"break",level:"warn",summary:"No Activity could be resolved from the renderer's Context or the overlay's view tree, so picture-in-picture cannot be detected automatically; the host must call OptiViewAds.setPictureInPicture() from Activity.onPictureInPictureModeChanged or breaks will be laid out for a fullscreen surface. Android only."},"DA-CONTENT-ELEMENT-SWAPPED":{category:"break",level:"info",summary:"The content player replaced its <video> element; the SDK re-bound its presentation listeners to the new one."},"DA-PIP-FORMAT-OVERRIDE":{category:"break",level:"info",summary:"The content player is in picture-in-picture, so the break's declared format was overruled and it plays as a single fullscreen ad."},"DA-PIP-ADOPTION-STATE":{category:"break",level:"info",summary:"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."},"DA-PIP-HANDOFF":{category:"break",level:"info",summary:"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."},"DA-PIP-LAYER-SWAP":{category:"break",level:"debug",summary:"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."},"DA-PIP-PRESENTED":{category:"break",level:"debug",summary:"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."},"DA-CHAIN-RESOLVER-ERROR":{category:"chaining",level:"warn",summary:"The chained-successor resolver threw; chaining was skipped for this break."},"DA-GAM-NO-ASSET-KEY":{category:"gam",level:"warn",summary:"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."},"DA-GAM-SESSION-FAILED":{category:"gam",level:"error",summary:"The GAM/IMA session failed to initialize; GAM breaks will not serve."},"DA-GAM-SESSION-PRELOADED":{category:"gam",level:"info",summary:"A GAM/IMA session was preloaded for the next event; context includes the event boundary and GAM pod identity."},"DA-GAM-START-DEFERRED":{category:"gam",level:"info",summary:"The SGAI IMA stream request is deferred until the configured ad start delay has been played; context includes adStartDelaySec."},"DA-GAM-CONFIG-RESOLVED":{category:"gam",level:"info",summary:"The GAM stream identity for this session was resolved from the manifest's vendorConfiguration."},"DA-GAM-CONFIG-MISSING":{category:"gam",level:"error",summary:'The break manifest carries no usable "gam" vendorConfiguration entry; GAM assets are skipped.'},"DA-GAM-POD-IDENTITY-MISMATCH":{category:"gam",level:"error",summary:"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."},"DA-GAM-POD-MID-BREAK-END":{category:"gam",level:"warn",summary:"IMA reported the ad break ended before the pod's last ad while pod stream remains; per-ad reporting continues until the pod ends."},"DA-GAM-DUPLICATE-METADATA":{category:"gam",level:"info",summary:"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."},"DA-VENDOR-CONFIG-UNKNOWN-TYPE":{category:"manifest",level:"info",summary:"One or more vendorConfiguration entries declare a type this SDK version does not recognise and were ignored."},"DA-EXTERNAL-VENDOR-INVALID":{category:"manifest",level:"warn",summary:"External vendorConfiguration entries were ignored because provider was blank or assetParameters was not an object. context: count."},"DA-EXTERNAL-VENDOR-DUPLICATE":{category:"manifest",level:"warn",summary:"External vendorConfiguration entries repeated a provider; the first valid entry was used. context: providers."},"DA-CONTENT-PLAYBACK-ERROR":{category:"playback",level:"error",summary:"The content player reported a playback error."},"DA-EXTERNAL-PLAYBACK-CHANGED":{category:"playback",level:"info",summary:"The content player's external (AirPlay) playback state changed; context carries the new state and the target."},"DA-EXTERNAL-PLAYBACK-BLOCKED":{category:"playback",level:"warn",summary:"AirPlay was requested while an ad break is active or about to start; the content player stays on the device and the request is retried when the break ends."},"DA-SSB-SWITCH-FAILED":{category:"playback",level:"warn",summary:"Switching the content player to the SSB stream for AirPlay failed (context.reason: no-restore-source, load-error, load-timeout, external-not-active or receiver-paused); the SDK restores the previous content."},"DA-SSB-RESTORE-FAILED":{category:"playback",level:"error",summary:"The previous content source could not be reloaded after the SSB stream (AirPlay ended or the switch failed); the session stays in ssb delivery until the app reloads its content."},"DA-EXTERNAL-PLAYBACK-ALLOWED":{category:"playback",level:"info",summary:"An AirPlay request passed the ad-break guard; context.trigger says whether it was the request itself or the retry after a break."},"DA-CONTENT-RESUME-STALLED":{category:"playback",level:"warn",summary:"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."},"DA-CONTENT-RECOVERY-MODE-RESOLVED":{category:"playback",level:"info",summary:"The resolved post-break content recovery mode for the session (recreate or none); context carries configured and resolved."},"DA-CONTENT-PIPELINE-RECREATED":{category:"playback",level:"info",summary:"The content player's media pipeline was rebuilt at break end before content resumed (recovery mode recreate); context carries breakId, startTime and durationMs."},"DA-CONTENT-PIPELINE-RECREATE-FAILED":{category:"playback",level:"warn",summary:"Rebuilding the content media pipeline at break end failed or timed out — or the adapter does not implement recreateMediaPipeline() (reason 'unsupported-adapter', e.g. a wrapper adapter that does not forward it); the SDK fell back to resuming in place with seek + play; context carries breakId, startTime, reason."},"DA-AD-PLAYBACK-ERROR":{category:"playback",level:"error",summary:"The ad player reported a playback error during a break."},"DA-AD-LOAD-RETRIED":{category:"playback",level:"warn",summary:'The ad player\'s load() had not settled within the retry window of the ad-start budget and the ad element showed no progress (readyState 0, nothing buffered), so a second load() was issued for the same URI; a slow-but-progressing load is not retried. Context carries breakId, assetId, uri, elapsedMs, remainingBudgetMs. A still-stalled retry ends as DA-AD-PLAYBACK-ERROR "Ad load timeout".'},"DA-AD-URI-MISSING":{category:"playback",level:"error",summary:"The ad asset had no usable media URI, VAST tag URL or render surface; reported as CMCD adec."},"DA-AD-MEDIA-LOAD-FAILED":{category:"playback",level:"error",summary:"The ad player could not fetch the ad media (network or HTTP failure); reported as CMCD adec."},"DA-AD-MEDIA-UNSUPPORTED":{category:"playback",level:"error",summary:"The ad player could not decode the ad media or does not support its format; reported as CMCD adec."},"DA-AD-START-TIMEOUT":{category:"playback",level:"error",summary:"The ad did not load, render a first frame or start within its start budget; reported as CMCD adec."},"DA-AD-START-INTERRUPTED":{category:"playback",level:"warn",summary:"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."},"DA-AD-DURATION-PREPARED":{category:"playback",level:"info",summary:"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."},"DA-DELIVERY-MODE-RESOLVED":{category:"session",level:"info",summary:"Delivery mode (sgai/ssai/ssb) 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; context.source is external-playback or external-playback-ended when AirPlay switched the session to the SSB stream and back."},"DA-TARGETING-VALUE-UNKNOWN":{category:"manifest",level:"warn",summary:"A targeting value is not recognized and the targeted entry does not match."},"DA-TARGETING-FIELD-UNKNOWN":{category:"manifest",level:"warn",summary:"A targeting field is not recognized and the targeted entry does not match."},"DA-TARGETING-INVALID":{category:"manifest",level:"warn",summary:"A targeting constraint is malformed or incomplete and the targeted entry does not match."},"DA-DELIVERY-MODE-UNKNOWN":{category:"session",level:"warn",summary:"The matching delivery rule carried an unrecognized mode value; sgai is used (forward compatibility)."},"DA-DELIVERY-MODE-OVERRIDDEN":{category:"session",level:"info",summary:"The manifest's delivery rules resolved a different mode, but the explicit client config takes precedence."},"DA-DELIVERY-MODE-CHANGE-IGNORED":{category:"session",level:"warn",summary:"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."},"DA-SSAI-UNAVAILABLE":{category:"session",level:"error",summary:"The manifest selected ssai delivery but no vendor configuration can provide a stitched stream (no gam entry with an assetKey); at start the session fails, while on a channel switch the session stays in sgai."},"DA-SSAI-SESSION-FAILED":{category:"session",level:"error",summary:"The SSAI session failed to start (IMA stream init, stream id, or stitched-stream load)."},"DA-SSAI-IMA-ERROR":{category:"gam",level:"error",summary:"IMA reported an error during the SSAI stream session."},"DA-INSERTION-TYPE-RESOLVED":{category:"session",level:"info",summary:"Per-session ad insertion type resolved, and whether the integrator set it or left it unset (unset lets the manifest's resumeOffset drive the resume point)."},"DA-RESUME-OFFSET-CLAMPED":{category:"break",level:"info",summary:"The resume offset was shortened to the ad duration actually played, so the break could not skip further than the ads it delivered."},"DA-INSERTION-TYPE-IGNORED-SSAI":{category:"session",level:"warn",summary:"adInsertionType is ignored in SSAI mode; the stitcher controls ad insertion server-side."},"DA-VAST-UNSUPPORTED-FORMAT":{category:"break",level:"warn",summary:"A VAST asset appeared in an unsupported break format; VAST is only supported in single, double, and lshape_ad. The break was skipped."},"DA-ASSET-MACRO-UNKNOWN":{category:"break",level:"warn",summary:"An asset parameter value contained a macro the SDK has no value for (an unknown or unavailable OptiView macro, or a registered customer macro that returned no value); the parameter was still sent, with the macro kept as its literal token. Raised once per parameter key and macro. context: key, macro, breakId, assetId."},"DA-ASSET-PARAMETER-OMITTED":{category:"break",level:"info",summary:"An asset parameter value contained a customer macro that is empty (value `null`), so the parameter was not sent; for GAM `cust_params`, and for a static-asset value with a literal `&`, only the `&`-separated pair containing the macro was dropped. Raised once per parameter key and macro (per dropped pair when the value is split into pairs). context: key, macro, pair (split values only), breakId, assetId."},"DA-VAST-SSAI-UNSUPPORTED":{category:"session",level:"warn",summary:"VAST assets are not supported in SSAI mode (VAST is SGAI-only); the asset was skipped."},"DA-VAST-IMA-ERROR":{category:"gam",level:"error",summary:"Google IMA reported an error while loading or playing a VAST (client-side / CSAI) ad."},"DA-VAST-NO-FILL":{category:"gam",level:"error",summary:"The VAST ad server returned no ad (empty response, no ads after wrappers or no assets); reported as CMCD adec."},"DA-VAST-TIMEOUT":{category:"gam",level:"error",summary:"The VAST response or its media file did not load in time; reported as CMCD adec."},"DA-VAST-MALFORMED":{category:"gam",level:"error",summary:"The VAST response could not be parsed or uses an unsupported VAST version; reported as CMCD adec."},"DA-VAST-REQUEST-FAILED":{category:"gam",level:"error",summary:"The VAST ad request failed (network error, invalid tag URL, wrapper error or too many redirects); reported as CMCD adec."},"DA-VAST-CREATIVE-FAILED":{category:"gam",level:"error",summary:"The VAST creative could not be played (no compatible media file, playback error or trafficking error); reported as CMCD adec."},"DA-VAST-IMA-SDK-MISSING":{category:"gam",level:"error",summary:"The Google IMA client-side SDK (ima3.js) is unavailable; VAST (CSAI) ads cannot be played."},"DA-PAUSE-AD-SHOWN":{category:"break",level:"info",summary:"A pause ad (full-screen image or video) was shown while content is paused."},"DA-PAUSE-AD-DISMISSED":{category:"break",level:"info",summary:"A pause ad was dismissed (content resumed, or the duration cap elapsed)."},"DA-PAUSE-AD-RESUME-ALLOWED":{category:"break",level:"info",summary:"The viewer may now resume content over the shown pause ad: the break's controls.skipOffset elapsed, or (no skipOffset) the ad was watched fully: a video creative ended, an image reached its duration cap or has none. context: breakId."},"DA-PAUSE-AD-RESUME-BLOCKED":{category:"break",level:"info",summary:"Content tried to resume while a pause ad must still be watched (controls.skipOffset not reached, or no skipOffset and the video creative has not ended / the image duration cap has not elapsed); the SDK keeps content paused. context: breakId, elapsedSec, skipOffset."},"DA-PAUSE-AD-DVR-EXPIRED":{category:"break",level:"info",summary:"The viewer paused for longer than the DVR window is deep, so the position they paused at aged out and playback resumed at the live edge instead. context: pinnedPosition, liveEdge."},"DA-PAUSE-AD-NO-ASSET":{category:"break",level:"warn",summary:"A pause break had no usable image or video asset (no first asset, unsupported media type, or no resolvable VAST creative); the pause ad was skipped."},"DA-PAUSE-AD-SSAI-UNSUPPORTED":{category:"session",level:"warn",summary:"Pause ads are SGAI-only and not supported in SSAI mode; the pause break was skipped."},"DA-MANIFEST-POLLED":{category:"manifest",level:"info",summary:"A manifest poll refresh succeeded (cadence follows the manifest polling config)."},"DA-AD-SKIPPED":{category:"playback",level:"info",summary:"The viewer skipped the active ad break (controls.skipOffset honored)."},"DA-AD-SKIP-SUPPRESSED":{category:"playback",level:"info",summary:"A skip request was suppressed (no skipOffset declared, or requested before the offset)."},"DA-AD-CLICKED":{category:"playback",level:"info",summary:"The viewer clicked the ad on screen (adclick emitted)."},"DA-LIVE-START-PUSHBACK":{category:"playback",level:"info",summary:"Initial live playback requested a backward seek to the configured target-duration distance. Context includes enabledBy (always config), targetDurationSec, targetDurationSource, initialOffsetSec, initialOffsetTargetDurations, requestedOffsetSec, requestedOffsetTargetDurations, targetOffsetSec, targetOffsetTargetDurations, rewindSec, rewindTargetDurations, target and windowClamped. This is a request, not proof of the landing."},"DA-LIVE-START-PUSHBACK-SKIPPED":{category:"playback",level:"info",summary:"Initial live playback was left unchanged. The reason identifies a disabled adjustment (liveStartPushback.enabled is not true; enabledBy is always config), an already sufficient offset, missing target duration or seekable range, invalid configuration, or no safe backward target. Available target-duration and offset measurements are included."},"DA-LIVE-START-PUSHBACK-LANDED":{category:"playback",level:"info",summary:"Measured initial-live seek landing. Context includes the requested target and targetDurationSec, landed, errorSec, liveEdgeAtLanding, landedOffsetSec and landedOffsetTargetDurations. A timeout or failed seek reports landed=null, never an inferred success."},"DA-RESUME-SEEK":{category:"playback",level:"info",summary:"Content was resume-seeked to the resolved post-break position (insertion type policy)."},"DA-RESUME-UNADDRESSABLE":{category:"playback",level:"warn",summary:"A break played through the content player (picture-in-picture), so content came back on a reloaded source whose timeline has its own origin, and that source published neither a program-date-time nor a seekable range to re-address the resume point against. Content stays where the reload left it — near the live edge — rather than being seeked to a position that does not exist on the new timeline. Context carries breakId, target (the position on the pre-borrow timeline) and offset."},"DA-RESUME-LANDED":{category:"playback",level:"info",summary:"Where the post-break resume-seek actually landed, measured on the seeked event rather than inferred: context carries breakId, target (the position requested), landed and errorSec (landed - target; negative means the player settled EARLIER than asked). errorSec only says whether the SEEK did what it was asked: when the live-window clamp moved the seek, policyTarget is the resume point before the clamp and policyErrorSec (landed - policyTarget) is how far the viewer really is from it. landed is null with a reason when no seeked event arrived, which is normal for a seek to the position the playhead already holds. Report-only: the SDK does not correct the position."},"DA-RESUME-PREPARED":{category:"playback",level:"info",summary:"Android, live break that resumes at its end — the paused content was parked exactly on the resume point before the hand-back, so the hand-back only plays (DA-RESUME-SEEK then reports prepared=true and issues no seek). Context carries breakId, target, source (cue_end when the stream's matched type=cue_end was known, else cue+duration) leadMs (how long before the expected hand-back it was parked) and refresh (true when content parked long before the hand-back was seeked onto the same point again, 4.5s before it). A later cue_end parks content again."},"DA-RESUME-PREPOSITIONED":{category:"playback",level:"info",summary:"The break resumed without a seek: content was moved onto its resume position DURING the break, so the transition needed no jump. Context carries breakId, target, prepositionedTo, landed, shortfallSec and exact. exact=true means it reached the policy target. exact=false means the live window never published those frames, so content was moved as close as exists — the viewer lands short, but arrives already in place rather than via a visible seek at the cut."},"DA-RESUME-PTS-MAP":{category:"playback",level:"info",summary:"ptsSource: 'anvatoCue', iOS/tvOS and web — the live resume point was mapped onto currentTime through the stream's own clock: the Anvato type=beacon tags delivered since the run-up's last seek give the currentTime ↔ stream-clock offset, and the resume point (the matched cue_end, else the cue plus the break duration) is converted with it. Reported when a mapping is first available after a seek and whenever the mapped target moves by 0.1s or more. Context carries breakId, target, landingStreamSec, landingSource (cue_end or cue+duration), offsetSec, beacons (beacons averaged), generation (how often the mapping started over since the session began), currentTime, and computedTarget with deltaSec (target - computedTarget) when a currentTime-based target exists."},"DA-RESUME-PTS-REMAP":{category:"playback",level:"warn",summary:"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)."},"DA-RESUME-PTS-CORRECTED":{category:"playback",level:"info",summary:"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."},"DA-RESUME-PTS-LANDED":{category:"playback",level:"info",summary:"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."},"DA-RESUME-PDT-MAP":{category:"playback",level:"info",summary:"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."},"DA-RESUME-PDT-CORRECTED":{category:"playback",level:"info",summary:"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."},"DA-RESUME-PDT-LANDED":{category:"playback",level:"info",summary:"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."},"DA-RESUME-CUE-END":{category:"playback",level:"info",summary:"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."},"DA-RESUME-CUE-END-LATE":{category:"playback",level:"info",summary:"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."},"DA-RESUME-CATCHUP":{category:"playback",level:"info",summary:"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."},"DA-RESUME-TARGET-CLAMPED":{category:"playback",level:"warn",summary:"The computed resume position sat outside the held live window and was clamped to the nearest end of it; context carries breakId, requested, clamped, shortfallSec and bound — 'end' when the target is ahead of the published edge, 'start' when it is behind the live window start (already evicted) — applied only when the gap is at most half the held window, otherwise DA-RESUME-START-CLAMP-SKIPPED is emitted instead. Distinct from DA-RESUME-OFFSET-CLAMPED, which shortens the OFFSET to the ad seconds actually played."},"DA-RESUME-START-CLAMP-SKIPPED":{category:"playback",level:"info",summary:"The resume target sat behind the element's live seekable start by more than half the held window, which cannot be DVR eviction (the element's seekable range disagrees with the adapter timeline); the target was left unchanged and the engine resolved the seek itself. Context carries breakId, requested, seekableStart, behindSec, windowSec and maxBehindSec."},"DA-RESUME-ALIGN-BLOCKED":{category:"playback",level:"warn",summary:"Resume alignment wanted to move content past the live edge and stood down, because no seek can reach media the stream has not published yet; content is left riding the edge and the break-end clamp places it. Context carries target, requested, safeEnd, shortfallSec and remainingSec. Emitted once per break. A persistent shortfall here means the resume target is further ahead than the feed's published edge — typically the player's view of the edge is stale, not that the seek is wrong."},"DA-CONTINUE-PLAYOUT-BEGIN":{category:"playback",level:"info",summary:"continueContentDuringBreak engaged: content keeps PLAYING through the break, hidden and muted, so no resume seek is needed. Context carries breakId, anchor, breakDurationSec and edgeDistanceSec."},"DA-CONTINUE-PLAYOUT-END":{category:"playback",level:"info",summary:"continueContentDuringBreak reached the cut. Context carries driftSec (content position minus where the break says it should be), maxDriftSec, the corrections applied, rateHonoured (false if the engine drove playbackRate itself) and driftUnrecoverable."},"DA-CONTINUE-PLAYOUT-REFUSED":{category:"playback",level:"info",summary:"continueContentDuringBreak was not used this session, so breaks pause content and resume with a seek as before. Emitted once per session; context carries the reason (disabled, not-replacement, format, shared-element, picture-in-picture, single-decoder) and the break format. Its ABSENCE on an eligible session is the signal the mode engaged."},"DA-CONTINUE-PLAYOUT-QUALITY-UNAVAILABLE":{category:"playback",level:"warn",summary:"Content continues through the replacement break without a video-quality constraint, so the content stream may retain its normal bitrate alongside the ad. Context carries breakId and reason (unsupported when the optional Web adapter method is absent, not-applied when the adapter returned false or could not apply the request)."},"DA-CONTINUE-PLAYOUT-DRIFT":{category:"playback",level:"warn",summary:"Content drifted further from the break timeline than the remaining break can remove within the playback-rate bounds, so part of it is carried into the cut. Context carries driftSec, remainingSec, the rate applied and seekIssued (always false: a corrective seek would be clipped)."},"DA-CONTINUE-PLAYOUT-ABANDONED":{category:"playback",level:"warn",summary:"Content could not be kept playing through the break, so it reverted to the pause-and-resume path mid-break. Context carries breakId, the reason and the driftSec at the moment it converted."},"DA-AD-AV-DESYNC":{category:"playback",level:"warn",summary:"The ad player's audio sink was handed a buffer whose timestamp does not continue the audio it has already been fed, so the media clock had to be re-anchored mid-ad. Video is scheduled off that clock while the audio already queued in the output track keeps draining, so every re-anchor pushes the picture further from the sound actually being heard. Context carries breakId, assetId, expectedSec, actualSec, deltaSec (negative = audio running behind the picture) and positionSec. Seen on server-stitched pods whose per-ad audio and video durations do not match; a single event near the end of a pod is the accumulated total, not an isolated glitch."},"DA-AD-PLAYOUT-SYNC":{category:"playback",level:"info",summary:"Per-break summary of ad playout health, emitted once at break end. Context carries podUri (the resolved ad media, so a stitched pod can be fetched and inspected), desyncEvents, maxDesyncSec, droppedFrames, audioUnderruns, audioFormats and videoFormats (the distinct decoder input formats seen during the break — more than one means the stitched stream changed sample rate or codec mid-pod) and frameOffsetMeanMs (mean video frame processing offset; large negative values mean frames were released late against the audio clock)."},"DA-EVENT":{category:"event",level:"info",summary:"An SDK event, recorded into the diagnostic ring buffer so exportDiagnostics() carries one unified timeline of diagnostics and playback events. Raised to error for aderror. Buffer-only: not dispatched to onDiagnostic handlers, which would duplicate the event stream they already receive."},"DA-BREAK-CONTENT-MASK":{category:"break",level:"warn",summary:"The host's content surface cannot follow view transforms (punch-through SurfaceView, e.g. react-native-video's default), so the two-box format masks the backdrop with a transparent hole over the content box instead of reframing the content view. context: format."},"DA-BREAK-FORMAT-DEGRADED":{category:"break",level:"warn",summary:"Split break reframing degraded: the host supplied no content view or sibling container for the ad."},"DA-BREAK-NO-PLAYABLE-ASSET":{category:"break",level:"warn",summary:"A break had nothing to play, so it never began: no adbreakbegin/adbreakend was emitted, content kept playing, and a public aderror (source ad, carrying the break) reports it. context.reason says why: no-variant (none declared), no-qualifying-variant (variant selection - device targeting + format playability - matched nothing and no downgrade applied), no-assets (the selected variant was empty), or lshape-content-skipped (shared-element insertion cannot render a backdrop). This is the BREAK-level outcome; when a particular variant was passed over for an unrecognised format, DA-BREAK-VARIANT-FORMAT-UNKNOWN names that format alongside it. context: breakId, reason, declaredAssetCount, format."},"DA-BREAK-VARIANT-FORMAT-UNKNOWN":{category:"break",level:"warn",summary:"A break variant declares a format this SDK version does not recognise, so it was passed over during variant selection rather than guessed at - an unknown format is never playable, because rendering it as a fullscreen single would be the most invasive possible misreading. Raised once per skipped variant: a break that still has a playable variant plays it and reports this too, so the skip is never silent, and a break left with nothing also reports DA-BREAK-NO-PLAYABLE-ASSET with reason no-qualifying-variant. An ABSENT format is treated identically to an unrecognised one. context: breakId, format (the raw manifest string; empty when the field was absent)."},"DA-AD-STALLED":{category:"playback",level:"warn",summary:"An ad began playing and then stopped advancing: the playhead did not move for the stall threshold while the ad was meant to be playing. context: assetId, breakId, playbackState, stalledForMs, positionMs, bufferedAheadMs, reason."},"DA-AD-FOREGROUND-RESUMED":{category:"playback",level:"info",summary:"An in-flight ad resumed after the app returned to the foreground; context carries the suspended duration and ad position at resume."},"DA-AD-FOCUS-LOST":{category:"playback",level:"warn",summary:"The overlay ad lost permanent audio focus during an active break; the host player must not reclaim focus while the SDK ad is on screen. context: breakId, transient, reason."},"DA-AD-FOCUS-GRANTED":{category:"playback",level:"info",summary:"The overlay ad was granted media audio focus for the break, so system focus semantics (call, duck, permanent loss) apply to ad playback. context: breakId, cause, alreadyHeld."},"DA-AD-FOCUS-DENIED":{category:"playback",level:"warn",summary:"The platform refused the overlay ad's media audio-focus request, so the break plays with no focus of its own: another app's audio can mix over the ad, and a call can neither duck nor pause it. context: breakId, cause."},"DA-AD-FOCUS-ABANDONED":{category:"playback",level:"info",summary:"The overlay ad gave media audio focus back, so the content player's own focus request finds a clean stack. context: breakId, cause."},"DA-BREAK-ABANDONED":{category:"lifecycle",level:"warn",summary:"A break was still in flight when the session was torn down (endSession, destroy, or a startSession over an active session). context: breakId, cause, phase, unbalancedAdBegin, adIndex, totalAds, assetId."},"DA-RENDERER-UNAVAILABLE":{category:"lifecycle",level:"error",summary:"The renderer could not render a break because a required piece of it was not attached (e.g. no ad player), after the SDK had already emitted adbreakbegin — so the break began and will never end. context: breakId, missing."},"DA-SESSION-STARTING":{category:"session",level:"info",summary:"A step of startSession() was entered: begin, manifest-fetch, gam-init or scheduling. Emitted on entry, so the last one recorded names the step a hung startSession never finished. context: step, manifestUrl, elapsedMs. The URL is reported verbatim; the redacted config summary carries only its origin (config.manifestOrigin)."}};
|
|
1
|
+
export const DIAGNOSTIC_CODES={"DA-BOOKMARK-START":{category:"break",level:"info",summary:"VOD bookmark start skipped earlier breaks. context: position, skippedBreakIds."},"DA-CONTENT-END-INFERRED":{category:"playback",level:"info",summary:"Content end inferred from the VOD playhead. context: currentTime, duration, trigger (past-end or stalled-at-end)."},"DA-SNAPBACK-APPLIED":{category:"break",level:"info",summary:"Viewer seek corrected to an unplayed VOD snapback break. context: breakId, target, resumePosition (seek-over of a content-pausing format only)."},"DA-SNAPBACK-ABANDONED":{category:"break",level:"warn",summary:"VOD snapback correction abandoned after one retry or because the break became ineligible. context: breakId, reason."},"DA-SNAPBACK-NOT-APPLIED":{category:"break",level:"debug",summary:"Viewer seek was not eligible for VOD snapback. context: reason, breakId (when known)."},"DA-SESSION-STARTED":{category:"session",level:"info",summary:"Monetization session started; manifest polling began. context: manifestUrl (stitcherUrl in SSAI mode), reported verbatim."},"DA-SESSION-ENDED":{category:"session",level:"info",summary:"Monetization session ended; polling and scheduling stopped."},"DA-ASSET-PARAMETERS-UPDATED":{category:"session",level:"info",summary:"The break manifest's session-level asset parameters changed; the merged parameters were pushed to the active GAM stream. context: source ('manifest'), keys (parameter names only, never values)."},"DA-MANIFEST-FETCH-FAILED":{category:"manifest",level:"error",summary:"Initial break-manifest fetch failed; the session could not start."},"DA-MANIFEST-POLL-FAILED":{category:"manifest",level:"warn",summary:"A manifest poll failed; the SDK keeps the last good manifest and retries."},"DA-MANIFEST-CHANNEL-CHANGED":{category:"manifest",level:"info",summary:"A polled manifest describes a different ads channel (channelId, GAM identity or timebase changed); the SDK re-aligned its ad setup and resolved delivery mode again while the session and content playback continued. context: previousChannelId, channelId, reason, manifestUrl."},"DA-MANIFEST-INTERCEPT-FAILED":{category:"manifest",level:"warn",summary:"The customer manifest-response interceptor threw; the un-modified parsed manifest was used instead."},"DA-MANIFEST-REQUEST-INTERCEPT-FAILED":{category:"manifest",level:"warn",summary:"The customer manifest-request interceptor threw; the normal network fetch of the original URL was used instead."},"DA-MANIFEST-SIGNATURE-INVALID":{category:"manifest",level:"error",summary:"The break-manifest response failed detached-JWS signature verification (missing/malformed X-Manifest-Signature, unsupported alg, unknown kid, unknown critical param, or signature mismatch); the manifest was rejected and no breaks were scheduled. context: url, reason."},"DA-MANIFEST-EVENT-INVALID":{category:"manifest",level:"warn",summary:"A channel event was ignored because its time window or configuration is invalid, or because events are unsupported for the manifest timebase. context: eventId and index when available."},"DA-SLATE-INVALID":{category:"manifest",level:"warn",summary:"The manifest's slate was ignored because it is unusable: not an object, an invalid minDuration, no assets, or an invalid first asset (the only one the player plays). The breaks of that manifest are unaffected and play without a slate. Reported once per distinct fault. context: reason (not-object, invalid-min-duration, no-assets, invalid-asset), assetId when the first asset has one."},"DA-PDT-MISSING":{category:"playback",level:"warn",summary:"No EXT-X-PROGRAM-DATE-TIME once content is playing (or after the startup backstop window); wallclock-timebase breaks fall back to the system clock."},"DA-ANVATO-CUE-PENDING":{category:"break",level:"info",summary:"ptsSource: 'anvatoCue' — no Anvato in-stream cue observed yet for a PTS break; the break stays pending until its cue arrives."},"DA-ANVATO-CUE-MATCHED":{category:"break",level:"info",summary:"ptsSource: 'anvatoCue' — a PTS break's start was matched to an observed Anvato cue and scheduled at the cue's media time."},"DA-ANVATO-CUE-ENTERED":{category:"break",level:"info",summary:"ptsSource: 'anvatoCue' — a break was started by the cue reaching the playhead rather than by the scheduler's 250ms tick; context carries the breakId, the cue pts and the media time it fired at, so the two start paths are distinguishable in the field."},"DA-ANVATO-CUE-OBSERVED":{category:"break",level:"info",summary:"ptsSource: 'anvatoCue' — an Anvato break-signaling (type=cue) frame was observed in the stream; context carries the cue's pts, the media time it landed at, whether the tracker recorded it, and the raw payload — so a manifest-PTS vs in-stream-PTS misalignment is observable in the field."},"DA-ANVATO-CUE-SEGMENT-ANCHORED":{category:"break",level:"warn",summary:"ptsSource: 'anvatoCue' — an Anvato emsg cue arrived without a ptsOffset from the adapter, so its break is scheduled at the cue's carrying segment start, which can be up to one segment early. Emitted once per session; context: pts, mediaTime."},"DA-ANVATO-CUE-OFFSET-REJECTED":{category:"break",level:"warn",summary:"ptsSource: 'anvatoCue' — the adapter's ptsOffset placed an Anvato cue outside its carrying segment's window (more than 0.1s before or 15s after the cue startTime), so the cue's startTime is used instead. Emitted once per cue pts; context: pts, startTime, ptsOffset, mappedTime."},"DA-ANVATO-CUE-END-MATCHED":{category:"break",level:"info",summary:"ptsSource: 'anvatoCue' — the active break's Anvato type=cue_end was observed and its length on the stream clock (cue_end pts minus the break start pts) is within 2s of the break duration. Emitted once per break; context: breakId, mediaTime (where the player reported the cue_end), lengthSec, durationSec."},"DA-ANVATO-CUE-END-REJECTED":{category:"break",level:"warn",summary:"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."},"DA-PRELOAD-FAILED":{category:"preload",level:"warn",summary:"Ad preload failed; the asset will be loaded on demand at break start."},"DA-SLATE-PRELOADED":{category:"preload",level:"info",summary:"The manifest's slate asset was fetched ahead of its first use, on its first appearance in the manifest or when its URL changed, so a break that needs it starts it warm. Best-effort: a failed warm-up never fails a break. context: slateAssetId, mediaType, path (the preload path taken)."},"DA-PRELOAD-MODE-RESOLVED":{category:"preload",level:"info",summary:"The configured ad preload mode was resolved for this session; context carries both the configured and the resolved mode."},"DA-PRELOAD-PATH":{category:"preload",level:"info",summary:"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)."},"DA-BREAK-EARLY-RETURN":{category:"break",level:"info",summary:"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."},"DA-BREAK-WINDOW-ESCAPED":{category:"break",level:"warn",summary:"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."},"DA-BREAK-EVENT-UNSUPPORTED":{category:"break",level:"warn",summary:"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."},"DA-BREAK-SUPPRESSED-OVERLAP":{category:"break",level:"warn",summary:"A break was suppressed because an ad was already playing."},"DA-BREAK-TRANSITION":{category:"break",level:"info",summary:"Measured duration of a playback transition into an ad break, between two ads, between chained breaks, or back to content. A break-to-break switch runs from the outgoing ad's end to the incoming ad's first frame and adds path (queued, late-queued or cold) and, when the incoming ad was buffered, leadMs. On web an ad-to-ad switch adds path (queued or cold) and leadMs too."},"DA-BREAK-CHAIN":{category:"chaining",level:"info",summary:"Summary of one chain of back-to-back breaks, emitted once when content plays again (or the chain is flushed): chainId, per break its id, scheduledStart, plannedDurationSec, beganAtMs, endedAtMs, playedSec, announcedDuringChain and path, per switch its gapMs and path, contentResumeMs and totalMs."},"DA-AD-SURFACE-REVEALED":{category:"break",level:"info",summary:"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. On web, an ad shown before its first frame reports reason shown-before-frame with visibleGapMs, the time on screen without a picture."},"DA-BREAK-CUT-LATE":{category:"break",level:"warn",summary:"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."},"DA-PREROLL-CONTENT-HELD":{category:"break",level:"info",summary:"Content playback was held at session start until a pending pre-roll began, so no content is shown before the ad."},"DA-PREROLL-CONTENT-WAIT-TIMEOUT":{category:"break",level:"info",summary:"A pending pre-roll began after content readiness was not reported within the wait timeout."},"DA-PREROLL-CANCELLED-CONTENT-ERROR":{category:"break",level:"warn",summary:"A pending pre-roll was cancelled because the content failed to load before it could begin."},"DA-SHARED-ELEMENT-UNSUPPORTED":{category:"break",level:"warn",summary:"Configured shared-element insertion is unsupported on this platform (non-iPhone/iPod); fell back to overlay insertion."},"DA-SHARED-ELEMENT-RESTORE-FAILED":{category:"playback",level:"error",summary:"Content did not resume after a shared-element break: the reload/seek/play restore failed twice; the viewer is left paused on the handed-back element."},"DA-IMAGE-LOAD-FAILED":{category:"break",level:"warn",summary:"An image (companion, backdrop or image ad) could not be fetched or decoded within the timeout, or exceeded the size limit; the break continues without it."},"DA-IMAGE-ANIMATED":{category:"break",level:"debug",summary:"An animated image (GIF or animated WebP) started animating on a companion, backdrop, image ad or pause image. Native renderers only: browsers animate the image element themselves. context: surface ('companion', 'backdrop', 'image-ad' or 'pause'), uri, frameCount (iOS/tvOS; null on Android)."},"DA-IMAGE-ANIMATION-UNSUPPORTED":{category:"break",level:"warn",summary:"An image is animated but this device cannot animate it, so its first frame is shown. context: surface, uri, reason ('api-below-28' on Android below API 28; 'canvas-too-large' on iOS/tvOS when the animation exceeds the decode budget)."},"DA-PIP-TRANSFER-FAILED":{category:"break",level:"warn",summary:"The picture-in-picture window could not be moved between the content and ad elements; the break continues but the viewer may not see the ad in the PiP window."},"DA-PIP-AUTODETECT-UNAVAILABLE":{category:"break",level:"warn",summary:"No Activity could be resolved from the renderer's Context or the overlay's view tree, so picture-in-picture cannot be detected automatically; the host must call OptiViewAds.setPictureInPicture() from Activity.onPictureInPictureModeChanged or breaks will be laid out for a fullscreen surface. Android only."},"DA-CONTENT-ELEMENT-SWAPPED":{category:"break",level:"info",summary:"The content player replaced its <video> element; the SDK re-bound its presentation listeners to the new one."},"DA-PIP-FORMAT-OVERRIDE":{category:"break",level:"info",summary:"The content player is in picture-in-picture, so the break's declared format was overruled and it plays as a single fullscreen ad."},"DA-PIP-ADOPTION-STATE":{category:"break",level:"info",summary:"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."},"DA-PIP-HANDOFF":{category:"break",level:"info",summary:"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."},"DA-PIP-LAYER-SWAP":{category:"break",level:"debug",summary:"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."},"DA-PIP-PRESENTED":{category:"break",level:"debug",summary:"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."},"DA-CHAIN-RESOLVER-ERROR":{category:"chaining",level:"warn",summary:"The chained-successor resolver threw; chaining was skipped for this break."},"DA-GAM-NO-ASSET-KEY":{category:"gam",level:"warn",summary:"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."},"DA-GAM-SESSION-FAILED":{category:"gam",level:"error",summary:"The GAM/IMA session failed to initialize; GAM breaks will not serve."},"DA-GAM-SESSION-PRELOADED":{category:"gam",level:"info",summary:"A GAM/IMA session was preloaded for the next event; context includes the event boundary and GAM pod identity."},"DA-GAM-START-DEFERRED":{category:"gam",level:"info",summary:"The SGAI IMA stream request is deferred until the configured ad start delay has been played; context includes adStartDelaySec."},"DA-GAM-CONFIG-RESOLVED":{category:"gam",level:"info",summary:"The GAM stream identity for this session was resolved from the manifest's vendorConfiguration."},"DA-GAM-CONFIG-MISSING":{category:"gam",level:"error",summary:'The break manifest carries no usable "gam" vendorConfiguration entry; GAM assets are skipped.'},"DA-GAM-POD-IDENTITY-MISMATCH":{category:"gam",level:"error",summary:"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."},"DA-GAM-POD-MID-BREAK-END":{category:"gam",level:"warn",summary:"IMA reported the ad break ended before the pod's last ad while pod stream remains; per-ad reporting continues until the pod ends."},"DA-GAM-DUPLICATE-METADATA":{category:"gam",level:"info",summary:"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."},"DA-VENDOR-CONFIG-UNKNOWN-TYPE":{category:"manifest",level:"info",summary:"One or more vendorConfiguration entries declare a type this SDK version does not recognise and were ignored."},"DA-EXTERNAL-VENDOR-INVALID":{category:"manifest",level:"warn",summary:"External vendorConfiguration entries were ignored because provider was blank or assetParameters was not an object. context: count."},"DA-EXTERNAL-VENDOR-DUPLICATE":{category:"manifest",level:"warn",summary:"External vendorConfiguration entries repeated a provider; the first valid entry was used. context: providers."},"DA-CONTENT-PLAYBACK-ERROR":{category:"playback",level:"error",summary:"The content player reported a playback error."},"DA-EXTERNAL-PLAYBACK-CHANGED":{category:"playback",level:"info",summary:"The content player's external (AirPlay) playback state changed; context carries the new state and the target."},"DA-EXTERNAL-PLAYBACK-BLOCKED":{category:"playback",level:"warn",summary:"AirPlay was requested while an ad break is active or about to start; the content player stays on the device and the request is retried when the break ends. On iOS the running ad plays on the receiver meanwhile."},"DA-AD-ROUTE-CHANGED":{category:"playback",level:"info",summary:"iOS: the audio route changed while an ad break played; context carries the route change reason, the current and previous outputs and a snapshot of the ad player (time control status, waiting reason, rate, buffer flags, external playback, ad and content state)."},"DA-AD-TIMECONTROL":{category:"playback",level:"info",summary:"iOS: the ad player's timeControlStatus or reasonForWaitingToPlay changed during an ad break; context.field names which, with the ad player snapshot."},"DA-AD-ITEM-STALLED":{category:"playback",level:"warn",summary:"iOS: the ad player's current item reported a playback stall during an ad break; context carries the ad player snapshot."},"DA-AD-AUDIO-INTERRUPTION":{category:"playback",level:"warn",summary:"iOS: an audio-session interruption began or ended during an ad break (context.type, options, wasSuspended) with the ad player snapshot."},"DA-AD-INTERRUPTION-RESUMED":{category:"playback",level:"warn",summary:"iOS: an ad paused by an audio-session interruption was restarted after the audio session was reactivated; context.trigger is interruption-ended, route-changed, player-paused or retry, stalledSec how long the ad was stopped."},"DA-AD-AUDIO-SESSION-REACTIVATE-FAILED":{category:"playback",level:"warn",summary:"iOS: reactivating the audio session before restarting an interrupted ad failed (context.errorCode, errorDomain, trigger); the SDK retries once a second, up to five times."},"DA-SSB-SWITCH-FAILED":{category:"playback",level:"warn",summary:"Switching the content player to the SSB stream for AirPlay failed (context.reason: no-restore-source, load-error, load-timeout, external-not-active or receiver-paused); the SDK restores the previous content."},"DA-SSB-RESTORE-FAILED":{category:"playback",level:"error",summary:"The previous content source could not be reloaded after the SSB stream (AirPlay ended or the switch failed); the session stays in ssb delivery until the app reloads its content."},"DA-EXTERNAL-PLAYBACK-ALLOWED":{category:"playback",level:"info",summary:"An AirPlay request passed the ad-break guard; context.trigger says whether it was the request itself or the retry after a break."},"DA-CONTENT-RESUME-STALLED":{category:"playback",level:"warn",summary:"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."},"DA-CONTENT-RECOVERY-MODE-RESOLVED":{category:"playback",level:"info",summary:"The resolved post-break content recovery mode for the session (recreate or none); context carries configured and resolved."},"DA-CONTENT-PIPELINE-RECREATED":{category:"playback",level:"info",summary:"The content player's media pipeline was rebuilt at break end before content resumed (recovery mode recreate); context carries breakId, startTime and durationMs."},"DA-CONTENT-PIPELINE-RECREATE-FAILED":{category:"playback",level:"warn",summary:"Rebuilding the content media pipeline at break end failed or timed out — or the adapter does not implement recreateMediaPipeline() (reason 'unsupported-adapter', e.g. a wrapper adapter that does not forward it); the SDK fell back to resuming in place with seek + play; context carries breakId, startTime, reason."},"DA-AD-PLAYBACK-ERROR":{category:"playback",level:"error",summary:"The ad player reported a playback error during a break."},"DA-AD-LOAD-RETRIED":{category:"playback",level:"warn",summary:'The ad player\'s load() had not settled within the retry window of the ad-start budget and the ad element showed no progress (readyState 0, nothing buffered), so a second load() was issued for the same URI; a slow-but-progressing load is not retried. Context carries breakId, assetId, uri, elapsedMs, remainingBudgetMs. A still-stalled retry ends as DA-AD-PLAYBACK-ERROR "Ad load timeout".'},"DA-AD-URI-MISSING":{category:"playback",level:"error",summary:"The ad asset had no usable media URI, VAST tag URL or render surface; reported as CMCD adec."},"DA-AD-MEDIA-LOAD-FAILED":{category:"playback",level:"error",summary:"The ad player could not fetch the ad media (network or HTTP failure); reported as CMCD adec."},"DA-AD-MEDIA-UNSUPPORTED":{category:"playback",level:"error",summary:"The ad player could not decode the ad media or does not support its format; reported as CMCD adec."},"DA-AD-START-TIMEOUT":{category:"playback",level:"error",summary:"The ad did not load, render a first frame or start within its start budget; reported as CMCD adec."},"DA-AD-START-INTERRUPTED":{category:"playback",level:"warn",summary:"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."},"DA-AD-DURATION-PREPARED":{category:"playback",level:"info",summary:"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."},"DA-DELIVERY-MODE-RESOLVED":{category:"session",level:"info",summary:"Delivery mode (sgai/ssai/ssb) 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; context.source is external-playback or external-playback-ended when AirPlay switched the session to the SSB stream and back."},"DA-TARGETING-VALUE-UNKNOWN":{category:"manifest",level:"warn",summary:"A targeting value is not recognized and the targeted entry does not match."},"DA-TARGETING-FIELD-UNKNOWN":{category:"manifest",level:"warn",summary:"A targeting field is not recognized and the targeted entry does not match."},"DA-TARGETING-INVALID":{category:"manifest",level:"warn",summary:"A targeting constraint is malformed or incomplete and the targeted entry does not match."},"DA-DELIVERY-MODE-UNKNOWN":{category:"session",level:"warn",summary:"The matching delivery rule carried an unrecognized mode value; sgai is used (forward compatibility)."},"DA-DELIVERY-MODE-OVERRIDDEN":{category:"session",level:"info",summary:"The manifest's delivery rules resolved a different mode, but the explicit client config takes precedence."},"DA-DELIVERY-MODE-CHANGE-IGNORED":{category:"session",level:"warn",summary:"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."},"DA-SSAI-UNAVAILABLE":{category:"session",level:"error",summary:"The manifest selected ssai delivery but no vendor configuration can provide a stitched stream (no gam entry with an assetKey); at start the session fails, while on a channel switch the session stays in sgai."},"DA-SSAI-SESSION-FAILED":{category:"session",level:"error",summary:"The SSAI session failed to start (IMA stream init, stream id, or stitched-stream load)."},"DA-SSAI-IMA-ERROR":{category:"gam",level:"error",summary:"IMA reported an error during the SSAI stream session."},"DA-INSERTION-TYPE-RESOLVED":{category:"session",level:"info",summary:"Per-session ad insertion type resolved, and whether the integrator set it or left it unset (unset lets the manifest's resumeOffset drive the resume point)."},"DA-RESUME-OFFSET-CLAMPED":{category:"break",level:"info",summary:"The resume offset was shortened to the ad duration actually played, so the break could not skip further than the ads it delivered."},"DA-INSERTION-TYPE-IGNORED-SSAI":{category:"session",level:"warn",summary:"adInsertionType is ignored in SSAI mode; the stitcher controls ad insertion server-side."},"DA-VAST-UNSUPPORTED-FORMAT":{category:"break",level:"warn",summary:"A VAST asset appeared in an unsupported break format; VAST is only supported in single, double, and lshape_ad. The break was skipped."},"DA-ASSET-MACRO-UNKNOWN":{category:"break",level:"warn",summary:"An asset parameter value contained a macro the SDK has no value for (an unknown or unavailable OptiView macro, or a registered customer macro that returned no value); the parameter was still sent, with the macro kept as its literal token. Raised once per parameter key and macro. context: key, macro, breakId, assetId."},"DA-ASSET-PARAMETER-OMITTED":{category:"break",level:"info",summary:"An asset parameter value contained a customer macro that is empty (value `null`), so the parameter was not sent; for GAM `cust_params`, and for a static-asset value with a literal `&`, only the `&`-separated pair containing the macro was dropped. Raised once per parameter key and macro (per dropped pair when the value is split into pairs). context: key, macro, pair (split values only), breakId, assetId."},"DA-VAST-SSAI-UNSUPPORTED":{category:"session",level:"warn",summary:"VAST assets are not supported in SSAI mode (VAST is SGAI-only); the asset was skipped."},"DA-VAST-IMA-ERROR":{category:"gam",level:"error",summary:"Google IMA reported an error while loading or playing a VAST (client-side / CSAI) ad."},"DA-VAST-NO-FILL":{category:"gam",level:"error",summary:"The VAST ad server returned no ad (empty response, no ads after wrappers or no assets); reported as CMCD adec."},"DA-VAST-TIMEOUT":{category:"gam",level:"error",summary:"The VAST response or its media file did not load in time; reported as CMCD adec."},"DA-VAST-MALFORMED":{category:"gam",level:"error",summary:"The VAST response could not be parsed or uses an unsupported VAST version; reported as CMCD adec."},"DA-VAST-REQUEST-FAILED":{category:"gam",level:"error",summary:"The VAST ad request failed (network error, invalid tag URL, wrapper error or too many redirects); reported as CMCD adec."},"DA-VAST-CREATIVE-FAILED":{category:"gam",level:"error",summary:"The VAST creative could not be played (no compatible media file, playback error or trafficking error); reported as CMCD adec."},"DA-VAST-IMA-SDK-MISSING":{category:"gam",level:"error",summary:"The Google IMA client-side SDK (ima3.js) is unavailable; VAST (CSAI) ads cannot be played."},"DA-PAUSE-AD-ROTATION-EXHAUSTED":{category:"break",level:"info",summary:"No unused pause breaks remain in the rotation; nothing was shown."},"DA-PAUSE-AD-SHOWN":{category:"break",level:"info",summary:"A pause ad (full-screen image or video) was shown while content is paused."},"DA-PAUSE-AD-DISMISSED":{category:"break",level:"info",summary:"A pause ad was dismissed (content resumed, or the duration cap elapsed)."},"DA-PAUSE-AD-RESUME-ALLOWED":{category:"break",level:"info",summary:"The viewer may now resume content over the shown pause ad: the break's controls.skipOffset elapsed, or (no skipOffset) the ad was watched fully: a video creative ended, an image reached its duration cap or has none. context: breakId."},"DA-PAUSE-AD-RESUME-BLOCKED":{category:"break",level:"info",summary:"Content tried to resume while a pause ad must still be watched (controls.skipOffset not reached, or no skipOffset and the video creative has not ended / the image duration cap has not elapsed); the SDK keeps content paused. context: breakId, elapsedSec, skipOffset."},"DA-PAUSE-AD-DVR-EXPIRED":{category:"break",level:"info",summary:"The viewer paused for longer than the DVR window is deep, so the position they paused at aged out and playback resumed at the live edge instead. context: pinnedPosition, liveEdge."},"DA-PAUSE-AD-NO-ASSET":{category:"break",level:"warn",summary:"A pause break had no usable image or video asset (no first asset, unsupported media type, or no resolvable VAST creative); the pause ad was skipped."},"DA-PAUSE-AD-SSAI-UNSUPPORTED":{category:"session",level:"warn",summary:"Pause ads are SGAI-only and not supported in SSAI mode; the pause break was skipped."},"DA-MANIFEST-POLLED":{category:"manifest",level:"info",summary:"A manifest poll refresh succeeded (cadence follows the manifest polling config)."},"DA-AD-SKIPPED":{category:"playback",level:"info",summary:"The viewer skipped the active ad break (controls.skipOffset honored)."},"DA-AD-SKIP-SUPPRESSED":{category:"playback",level:"info",summary:"A skip request was suppressed (no skipOffset declared, or requested before the offset)."},"DA-AD-CLICKED":{category:"playback",level:"info",summary:"The viewer clicked the ad on screen (adclick emitted)."},"DA-LIVE-START-PUSHBACK":{category:"playback",level:"info",summary:"Initial live playback requested a backward seek to the configured target-duration distance. Context includes enabledBy (always config), targetDurationSec, targetDurationSource, initialOffsetSec, initialOffsetTargetDurations, requestedOffsetSec, requestedOffsetTargetDurations, targetOffsetSec, targetOffsetTargetDurations, rewindSec, rewindTargetDurations, target and windowClamped. This is a request, not proof of the landing."},"DA-LIVE-START-PUSHBACK-SKIPPED":{category:"playback",level:"info",summary:"Initial live playback was left unchanged. The reason identifies a disabled adjustment (liveStartPushback.enabled is not true; enabledBy is always config), an already sufficient offset, missing target duration or seekable range, invalid configuration, or no safe backward target. Available target-duration and offset measurements are included."},"DA-LIVE-START-PUSHBACK-LANDED":{category:"playback",level:"info",summary:"Measured initial-live seek landing. Context includes the requested target and targetDurationSec, landed, errorSec, liveEdgeAtLanding, landedOffsetSec and landedOffsetTargetDurations. A timeout or failed seek reports landed=null, never an inferred success."},"DA-RESUME-SEEK":{category:"playback",level:"info",summary:"Content was resume-seeked to the resolved post-break position (insertion type policy)."},"DA-RESUME-UNADDRESSABLE":{category:"playback",level:"warn",summary:"A break played through the content player (picture-in-picture), so content came back on a reloaded source whose timeline has its own origin, and that source published neither a program-date-time nor a seekable range to re-address the resume point against. Content stays where the reload left it — near the live edge — rather than being seeked to a position that does not exist on the new timeline. Context carries breakId, target (the position on the pre-borrow timeline) and offset."},"DA-RESUME-LANDED":{category:"playback",level:"info",summary:"Where the post-break resume-seek actually landed, measured on the seeked event rather than inferred: context carries breakId, target (the position requested), landed and errorSec (landed - target; negative means the player settled EARLIER than asked). errorSec only says whether the SEEK did what it was asked: when the live-window clamp moved the seek, policyTarget is the resume point before the clamp and policyErrorSec (landed - policyTarget) is how far the viewer really is from it. landed is null with a reason when no seeked event arrived, which is normal for a seek to the position the playhead already holds. Report-only: the SDK does not correct the position."},"DA-RESUME-PREPARED":{category:"playback",level:"info",summary:"Android, live break that resumes at its end — the paused content was parked exactly on the resume point before the hand-back, so the hand-back only plays (DA-RESUME-SEEK then reports prepared=true and issues no seek). Context carries breakId, target, source (cue_end when the stream's matched type=cue_end was known, else cue+duration) leadMs (how long before the expected hand-back it was parked) and refresh (true when content parked long before the hand-back was seeked onto the same point again, 4.5s before it). A later cue_end parks content again."},"DA-RESUME-PREPOSITIONED":{category:"playback",level:"info",summary:"The break resumed without a seek: content was moved onto its resume position DURING the break, so the transition needed no jump. Context carries breakId, target, prepositionedTo, landed, shortfallSec and exact. exact=true means it reached the policy target. exact=false means the live window never published those frames, so content was moved as close as exists — the viewer lands short, but arrives already in place rather than via a visible seek at the cut."},"DA-RESUME-PTS-MAP":{category:"playback",level:"info",summary:"ptsSource: 'anvatoCue', iOS/tvOS and web — the live resume point was mapped onto currentTime through the stream's own clock: the Anvato type=beacon tags delivered since the run-up's last seek give the currentTime ↔ stream-clock offset, and the resume point (the matched cue_end, else the cue plus the break duration) is converted with it. Reported when a mapping is first available after a seek and whenever the mapped target moves by 0.1s or more. Context carries breakId, target, landingStreamSec, landingSource (cue_end or cue+duration), offsetSec, beacons (beacons averaged), generation (how often the mapping started over since the session began), currentTime, and computedTarget with deltaSec (target - computedTarget) when a currentTime-based target exists."},"DA-RESUME-PTS-REMAP":{category:"playback",level:"warn",summary:"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)."},"DA-RESUME-PTS-CORRECTED":{category:"playback",level:"info",summary:"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."},"DA-RESUME-PTS-LANDED":{category:"playback",level:"info",summary:"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."},"DA-RESUME-PDT-MAP":{category:"playback",level:"info",summary:"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."},"DA-RESUME-PDT-CORRECTED":{category:"playback",level:"info",summary:"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."},"DA-RESUME-PDT-LANDED":{category:"playback",level:"info",summary:"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."},"DA-RESUME-CUE-END":{category:"playback",level:"info",summary:"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."},"DA-RESUME-CUE-END-LATE":{category:"playback",level:"info",summary:"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."},"DA-RESUME-CATCHUP":{category:"playback",level:"info",summary:"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."},"DA-RESUME-TARGET-CLAMPED":{category:"playback",level:"warn",summary:"The computed resume position sat outside the held live window and was clamped to the nearest end of it; context carries breakId, requested, clamped, shortfallSec and bound — 'end' when the target is ahead of the published edge, 'start' when it is behind the live window start (already evicted) — applied only when the gap is at most half the held window, otherwise DA-RESUME-START-CLAMP-SKIPPED is emitted instead. Distinct from DA-RESUME-OFFSET-CLAMPED, which shortens the OFFSET to the ad seconds actually played."},"DA-RESUME-START-CLAMP-SKIPPED":{category:"playback",level:"info",summary:"The resume target sat behind the element's live seekable start by more than half the held window, which cannot be DVR eviction (the element's seekable range disagrees with the adapter timeline); the target was left unchanged and the engine resolved the seek itself. Context carries breakId, requested, seekableStart, behindSec, windowSec and maxBehindSec."},"DA-RESUME-ALIGN-BLOCKED":{category:"playback",level:"warn",summary:"Resume alignment wanted to move content past the live edge and stood down, because no seek can reach media the stream has not published yet; content is left riding the edge and the break-end clamp places it. Context carries target, requested, safeEnd, shortfallSec and remainingSec. Emitted once per break. A persistent shortfall here means the resume target is further ahead than the feed's published edge — typically the player's view of the edge is stale, not that the seek is wrong."},"DA-CONTINUE-PLAYOUT-BEGIN":{category:"playback",level:"info",summary:"continueContentDuringBreak engaged: content keeps PLAYING through the break, hidden and muted, so no resume seek is needed. Context carries breakId, anchor, breakDurationSec and edgeDistanceSec."},"DA-CONTINUE-PLAYOUT-END":{category:"playback",level:"info",summary:"continueContentDuringBreak reached the cut. Context carries driftSec (content position minus where the break says it should be), maxDriftSec, the corrections applied, rateHonoured (false if the engine drove playbackRate itself) and driftUnrecoverable."},"DA-CONTINUE-PLAYOUT-REFUSED":{category:"playback",level:"info",summary:"continueContentDuringBreak was not used this session, so breaks pause content and resume with a seek as before. Emitted once per session; context carries the reason (disabled, not-replacement, format, shared-element, picture-in-picture, single-decoder) and the break format. Its ABSENCE on an eligible session is the signal the mode engaged."},"DA-CONTINUE-PLAYOUT-QUALITY-UNAVAILABLE":{category:"playback",level:"warn",summary:"Content continues through the replacement break without a video-quality constraint, so the content stream may retain its normal bitrate alongside the ad. Context carries breakId and reason (unsupported when the optional Web adapter method is absent, not-applied when the adapter returned false or could not apply the request)."},"DA-CONTINUE-PLAYOUT-DRIFT":{category:"playback",level:"warn",summary:"Content drifted further from the break timeline than the remaining break can remove within the playback-rate bounds, so part of it is carried into the cut. Context carries driftSec, remainingSec, the rate applied and seekIssued (always false: a corrective seek would be clipped)."},"DA-CONTINUE-PLAYOUT-ABANDONED":{category:"playback",level:"warn",summary:"Content could not be kept playing through the break, so it reverted to the pause-and-resume path mid-break. Context carries breakId, the reason and the driftSec at the moment it converted."},"DA-AD-AV-DESYNC":{category:"playback",level:"warn",summary:"The ad player's audio sink was handed a buffer whose timestamp does not continue the audio it has already been fed, so the media clock had to be re-anchored mid-ad. Video is scheduled off that clock while the audio already queued in the output track keeps draining, so every re-anchor pushes the picture further from the sound actually being heard. Context carries breakId, assetId, expectedSec, actualSec, deltaSec (negative = audio running behind the picture) and positionSec. Seen on server-stitched pods whose per-ad audio and video durations do not match; a single event near the end of a pod is the accumulated total, not an isolated glitch."},"DA-AD-PLAYOUT-SYNC":{category:"playback",level:"info",summary:"Per-break summary of ad playout health, emitted once at break end. Context carries podUri (the resolved ad media, so a stitched pod can be fetched and inspected), desyncEvents, maxDesyncSec, droppedFrames, audioUnderruns, audioFormats and videoFormats (the distinct decoder input formats seen during the break — more than one means the stitched stream changed sample rate or codec mid-pod) and frameOffsetMeanMs (mean video frame processing offset; large negative values mean frames were released late against the audio clock)."},"DA-EVENT":{category:"event",level:"info",summary:"An SDK event, recorded into the diagnostic ring buffer so exportDiagnostics() carries one unified timeline of diagnostics and playback events. Raised to error for aderror. Buffer-only: not dispatched to onDiagnostic handlers, which would duplicate the event stream they already receive."},"DA-BREAK-CONTENT-MASK":{category:"break",level:"warn",summary:"The host's content surface cannot follow view transforms (punch-through SurfaceView, e.g. react-native-video's default), so the two-box format masks the backdrop with a transparent hole over the content box instead of reframing the content view. context: format."},"DA-BREAK-FORMAT-DEGRADED":{category:"break",level:"warn",summary:"Split break reframing degraded: the host supplied no content view or sibling container for the ad."},"DA-SLATE-STARTED":{category:"break",level:"info",summary:"The slate began playing in a break because no ad covered the rest of it; it plays until the break's scheduled end (adbreakbegin plus the effective duration) and then the break ends as any other. No adbegin/adend is emitted for it. context: breakId, slateAssetId, reason (ads-ended: the last ad ended before the break end; no-ad: no ad could play), durationSec (the real time left to the scheduled end, so time lost to failed ad attempts and start-up shortens it), adsPlayedSec, effectiveDurationSec, minDurationSec."},"DA-SLATE-NOT-STARTED":{category:"break",level:"info",summary:"A break with a slate left part of its time uncovered but the slate did not start: less than the slate's minDuration remained (below-min-duration), or the stitched stream fills the break (not-rendered: a time-based break under ssai delivery, or while an SSB stream plays). The break ends as without a slate. context: breakId, reason, remainingSec, minDurationSec."},"DA-SLATE-ENDED":{category:"break",level:"info",summary:"The slate stopped playing. context: breakId, slateAssetId, plannedSec (the real time left to the break's scheduled end when the slate started), filledSec (seconds the slate was on screen: start-up, stalls and loop restarts shorten it, never the break), loops (completed plays of a video slate), interruptedSec (time it was not presenting), breakOverrunSec (the slate's end minus the scheduled end, signed: about 0 at break-end, negative when ended early), reason (break-end: the scheduled end was reached; skipped, removed, resumed: ended early)."},"DA-SLATE-FAILED":{category:"playback",level:"error",summary:"The slate could not load or play (load error, or it did not present within the ad-start budget); the break ends as without a slate and a public aderror carries the slate asset. context: breakId, slateAssetId, reason (load, stalled), error."},"DA-BREAK-NO-PLAYABLE-ASSET":{category:"break",level:"warn",summary:"A break had nothing to play, so it never began: no adbreakbegin/adbreakend was emitted, content kept playing, and a public aderror (source ad, carrying the break) reports it. When the manifest carries a slate that fills the break (reason no-assets only), the break does begin and the slate covers it: the aderror and this diagnostic are still reported, then DA-SLATE-STARTED follows. context.reason says why: no-variant (none declared), no-qualifying-variant (variant selection - device targeting + format playability - matched nothing and no downgrade applied), no-assets (the selected variant was empty), or lshape-content-skipped (shared-element insertion cannot render a backdrop). This is the BREAK-level outcome; when a particular variant was passed over for an unrecognised format, DA-BREAK-VARIANT-FORMAT-UNKNOWN names that format alongside it. context: breakId, reason, declaredAssetCount, format."},"DA-BREAK-VARIANT-FORMAT-UNKNOWN":{category:"break",level:"warn",summary:"A break variant declares a format this SDK version does not recognise, so it was passed over during variant selection rather than guessed at - an unknown format is never playable, because rendering it as a fullscreen single would be the most invasive possible misreading. Raised once per skipped variant: a break that still has a playable variant plays it and reports this too, so the skip is never silent, and a break left with nothing also reports DA-BREAK-NO-PLAYABLE-ASSET with reason no-qualifying-variant. An ABSENT format is treated identically to an unrecognised one. context: breakId, format (the raw manifest string; empty when the field was absent)."},"DA-BREAK-LSHAPE-ANCHOR-UNKNOWN":{category:"break",level:"warn",summary:"An lshape_ad or lshape_content variant declares an anchor this SDK version does not recognise (manifest spec 1.11.0 knows top_left, top_right, bottom_left and bottom_right), so the break still plays with the video box in the default top_left corner. Raised once per break begin on the selected variant. context: breakId, format, anchor (the raw manifest string)."},"DA-AD-STALLED":{category:"playback",level:"warn",summary:"An ad began playing and then stopped advancing: the playhead did not move for the stall threshold while the ad was meant to be playing. context: assetId, breakId, playbackState, stalledForMs, positionMs, bufferedAheadMs, reason."},"DA-AD-FOREGROUND-RESUMED":{category:"playback",level:"info",summary:"An in-flight ad resumed after the app returned to the foreground; context carries the suspended duration and ad position at resume."},"DA-AD-FOCUS-LOST":{category:"playback",level:"warn",summary:"The overlay ad lost permanent audio focus during an active break; the host player must not reclaim focus while the SDK ad is on screen. context: breakId, transient, reason."},"DA-AD-FOCUS-GRANTED":{category:"playback",level:"info",summary:"The overlay ad was granted media audio focus for the break, so system focus semantics (call, duck, permanent loss) apply to ad playback. context: breakId, cause, alreadyHeld."},"DA-AD-FOCUS-DENIED":{category:"playback",level:"warn",summary:"The platform refused the overlay ad's media audio-focus request, so the break plays with no focus of its own: another app's audio can mix over the ad, and a call can neither duck nor pause it. context: breakId, cause."},"DA-AD-FOCUS-ABANDONED":{category:"playback",level:"info",summary:"The overlay ad gave media audio focus back, so the content player's own focus request finds a clean stack. context: breakId, cause."},"DA-BREAK-ABANDONED":{category:"lifecycle",level:"warn",summary:"A break was still in flight when the session was torn down (endSession, destroy, or a startSession over an active session). context: breakId, cause, phase, unbalancedAdBegin, adIndex, totalAds, assetId."},"DA-RENDERER-UNAVAILABLE":{category:"lifecycle",level:"error",summary:"The renderer could not render a break because a required piece of it was not attached (e.g. no ad player), after the SDK had already emitted adbreakbegin — so the break began and will never end. context: breakId, missing."},"DA-SESSION-STARTING":{category:"session",level:"info",summary:"A step of startSession() was entered: begin, manifest-fetch, gam-init or scheduling. Emitted on entry, so the last one recorded names the step a hung startSession never finished. context: step, manifestUrl, elapsedMs. The URL is reported verbatim; the redacted config summary carries only its origin (config.manifestOrigin)."},"DA-MANIFEST-URL-DISCOVERED":{category:"session",level:"info",summary:"startSession() was called without a manifestUrl and the SDK started the session with the ads manifest URL the content player discovered (e.g. THEOlive discovery). context: manifestUrl (reported verbatim), source ('player-discovery')."},"DA-MANIFEST-URL-UNAVAILABLE":{category:"session",level:"error",summary:"startSession() was called without a manifestUrl and no ads manifest URL could be resolved from the player. context: reason ('disabled': the manifestUrlDiscovery config flag is off, 'unsupported-adapter': the adapter cannot discover one, 'no-ads': the player reported none, 'timeout': still pending after the discovery wait)."}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION="1.
|
|
1
|
+
export const SDK_VERSION="1.6.0";
|