@dolby-optiview/ads-sdk-core 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/OptiViewAds.d.ts +190 -0
- package/dist/OptiViewAds.js +1 -0
- package/dist/config/keys.d.ts +23 -0
- package/dist/config/keys.js +1 -0
- package/dist/diagnostics/DiagnosticBuffer.d.ts +33 -0
- package/dist/diagnostics/DiagnosticBuffer.js +1 -0
- package/dist/diagnostics/DiagnosticEvent.d.ts +71 -0
- package/dist/diagnostics/DiagnosticEvent.js +1 -0
- package/dist/diagnostics/debugLog.d.ts +8 -0
- package/dist/diagnostics/debugLog.js +1 -0
- package/dist/diagnostics/errorCodes.d.ts +45 -0
- package/dist/diagnostics/errorCodes.js +1 -0
- package/dist/diagnostics/index.d.ts +6 -0
- package/dist/diagnostics/index.js +1 -0
- package/dist/diagnostics/playbackErrorContext.d.ts +22 -0
- package/dist/diagnostics/playbackErrorContext.js +1 -0
- package/dist/generated/diagnosticCodes.d.ts +487 -0
- package/dist/generated/diagnosticCodes.js +1 -0
- package/dist/generated/version.d.ts +5 -0
- package/dist/generated/version.js +1 -0
- package/dist/id3/buildId3.d.ts +25 -0
- package/dist/id3/buildId3.js +1 -0
- package/dist/id3/index.d.ts +3 -0
- package/dist/id3/index.js +1 -0
- package/dist/id3/parseId3Geob.d.ts +28 -0
- package/dist/id3/parseId3Geob.js +1 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.js +1 -0
- package/dist/interfaces/PlayerAdapter.d.ts +163 -0
- package/dist/interfaces/PlayerAdapter.js +1 -0
- package/dist/internal/index.d.ts +1 -0
- package/dist/internal/index.js +1 -0
- package/dist/server/index.d.ts +20 -0
- package/dist/server/index.js +1 -0
- package/dist/services/AdBreakSequencer.d.ts +146 -0
- package/dist/services/AdBreakSequencer.js +1 -0
- package/dist/services/AdPlayerController.d.ts +495 -0
- package/dist/services/AdPlayerController.js +1 -0
- package/dist/services/BreakScheduler.d.ts +215 -0
- package/dist/services/BreakScheduler.js +1 -0
- package/dist/services/BreakTransitionTimer.d.ts +48 -0
- package/dist/services/BreakTransitionTimer.js +1 -0
- package/dist/services/CmcdAdReporter.d.ts +81 -0
- package/dist/services/CmcdAdReporter.js +1 -0
- package/dist/services/GamPodAdTracker.d.ts +65 -0
- package/dist/services/GamPodAdTracker.js +1 -0
- package/dist/services/GamPodUrlBuilder.d.ts +30 -0
- package/dist/services/GamPodUrlBuilder.js +1 -0
- package/dist/services/GamStreamManager.d.ts +67 -0
- package/dist/services/GamStreamManager.js +1 -0
- package/dist/services/LensReporter.d.ts +30 -0
- package/dist/services/LensReporter.js +1 -0
- package/dist/services/ManifestService.d.ts +91 -0
- package/dist/services/ManifestService.js +1 -0
- package/dist/services/MetadataCueTracker.d.ts +44 -0
- package/dist/services/MetadataCueTracker.js +1 -0
- package/dist/services/PauseAdController.d.ts +108 -0
- package/dist/services/PauseAdController.js +1 -0
- package/dist/services/RewindRearm.d.ts +109 -0
- package/dist/services/RewindRearm.js +1 -0
- package/dist/services/SsaiController.d.ts +59 -0
- package/dist/services/SsaiController.js +1 -0
- package/dist/services/StitcherUrlBuilder.d.ts +34 -0
- package/dist/services/StitcherUrlBuilder.js +1 -0
- package/dist/services/VastAdManager.d.ts +89 -0
- package/dist/services/VastAdManager.js +1 -0
- package/dist/services/adPlayer/AdPlayerEvents.d.ts +39 -0
- package/dist/services/adPlayer/AdPlayerEvents.js +1 -0
- package/dist/services/adPlayer/AdPlayerState.d.ts +98 -0
- package/dist/services/adPlayer/AdPlayerState.js +1 -0
- package/dist/services/adPlayer/AdPreloader.d.ts +54 -0
- package/dist/services/adPlayer/AdPreloader.js +1 -0
- package/dist/services/adPlayer/AdStage.d.ts +57 -0
- package/dist/services/adPlayer/AdStage.js +1 -0
- package/dist/services/adPlayer/AssetParameterResolver.d.ts +44 -0
- package/dist/services/adPlayer/AssetParameterResolver.js +1 -0
- package/dist/services/adPlayer/AssetPlayback.d.ts +71 -0
- package/dist/services/adPlayer/AssetPlayback.js +1 -0
- package/dist/services/adPlayer/BreakSequenceDriver.d.ts +46 -0
- package/dist/services/adPlayer/BreakSequenceDriver.js +1 -0
- package/dist/services/adPlayer/ContentResumeCoordinator.d.ts +44 -0
- package/dist/services/adPlayer/ContentResumeCoordinator.js +1 -0
- package/dist/services/adPlayer/ContinueContentPlayout.d.ts +26 -0
- package/dist/services/adPlayer/ContinueContentPlayout.js +1 -0
- package/dist/services/adPlayer/GamPodBridge.d.ts +66 -0
- package/dist/services/adPlayer/GamPodBridge.js +1 -0
- package/dist/services/adPlayer/PauseAdPresenter.d.ts +60 -0
- package/dist/services/adPlayer/PauseAdPresenter.js +1 -0
- package/dist/services/adPlayer/PresentationModeTracker.d.ts +66 -0
- package/dist/services/adPlayer/PresentationModeTracker.js +1 -0
- package/dist/services/adPlayer/SharedElementBreakPlayer.d.ts +54 -0
- package/dist/services/adPlayer/SharedElementBreakPlayer.js +1 -0
- package/dist/services/adPlayer/VariantSelector.d.ts +38 -0
- package/dist/services/adPlayer/VariantSelector.js +1 -0
- package/dist/services/adPlayer/connectPauseAd.d.ts +10 -0
- package/dist/services/adPlayer/connectPauseAd.js +1 -0
- package/dist/services/adPlayer/liveEdge.d.ts +6 -0
- package/dist/services/adPlayer/liveEdge.js +1 -0
- package/dist/services/assetParameterMacroTable.d.ts +9 -0
- package/dist/services/assetParameterMacroTable.js +1 -0
- package/dist/services/assetParameterMacros.d.ts +69 -0
- package/dist/services/assetParameterMacros.js +1 -0
- package/dist/services/breakTiming.d.ts +60 -0
- package/dist/services/breakTiming.js +1 -0
- package/dist/services/channelSwitch.d.ts +32 -0
- package/dist/services/channelSwitch.js +1 -0
- package/dist/services/detectDeviceType.d.ts +15 -0
- package/dist/services/detectDeviceType.js +1 -0
- package/dist/services/detectInsertionMode.d.ts +38 -0
- package/dist/services/detectInsertionMode.js +1 -0
- package/dist/services/detectPreloadMode.d.ts +13 -0
- package/dist/services/detectPreloadMode.js +1 -0
- package/dist/services/ed25519.d.ts +19 -0
- package/dist/services/ed25519.js +1 -0
- package/dist/services/fetchWithTimeout.d.ts +35 -0
- package/dist/services/fetchWithTimeout.js +1 -0
- package/dist/services/lensBackend.d.ts +16 -0
- package/dist/services/lensBackend.js +1 -0
- package/dist/services/lensBackendDevelopment.d.ts +1 -0
- package/dist/services/lensBackendDevelopment.js +1 -0
- package/dist/services/lensBackendProduction.d.ts +9 -0
- package/dist/services/lensBackendProduction.js +1 -0
- package/dist/services/manifestSignature.d.ts +43 -0
- package/dist/services/manifestSignature.js +1 -0
- package/dist/services/manifestTrustedKeys.d.ts +9 -0
- package/dist/services/manifestTrustedKeys.js +1 -0
- package/dist/services/parseBreakManifest.d.ts +15 -0
- package/dist/services/parseBreakManifest.js +1 -0
- package/dist/services/parseVastCompanion.d.ts +31 -0
- package/dist/services/parseVastCompanion.js +1 -0
- package/dist/services/parseVastLinear.d.ts +36 -0
- package/dist/services/parseVastLinear.js +1 -0
- package/dist/services/pictureInPicture.d.ts +28 -0
- package/dist/services/pictureInPicture.js +1 -0
- package/dist/services/resolveAssetParameters.d.ts +6 -0
- package/dist/services/resolveAssetParameters.js +1 -0
- package/dist/services/resolveDeliveryMode.d.ts +54 -0
- package/dist/services/resolveDeliveryMode.js +1 -0
- package/dist/services/resolveGamVendorConfiguration.d.ts +55 -0
- package/dist/services/resolveGamVendorConfiguration.js +1 -0
- package/dist/services/resolvePauseResumePoint.d.ts +32 -0
- package/dist/services/resolvePauseResumePoint.js +1 -0
- package/dist/services/resolvePollingDecision.d.ts +24 -0
- package/dist/services/resolvePollingDecision.js +1 -0
- package/dist/services/resolveResumePoint.d.ts +38 -0
- package/dist/services/resolveResumePoint.js +1 -0
- package/dist/services/resolveTargetedUri.d.ts +22 -0
- package/dist/services/resolveTargetedUri.js +1 -0
- package/dist/services/resolveVastAdmission.d.ts +34 -0
- package/dist/services/resolveVastAdmission.js +1 -0
- package/dist/services/selectVariant.d.ts +47 -0
- package/dist/services/selectVariant.js +1 -0
- package/dist/services/urlOrigin.d.ts +23 -0
- package/dist/services/urlOrigin.js +1 -0
- package/dist/session/AdBreakStatusTracker.d.ts +49 -0
- package/dist/session/AdBreakStatusTracker.js +1 -0
- package/dist/session/BreakLifecycle.d.ts +62 -0
- package/dist/session/BreakLifecycle.js +1 -0
- package/dist/session/SessionStarter.d.ts +98 -0
- package/dist/session/SessionStarter.js +1 -0
- package/dist/session/SessionState.d.ts +37 -0
- package/dist/session/SessionState.js +1 -0
- package/dist/types/BreakManifest.d.ts +335 -0
- package/dist/types/BreakManifest.js +1 -0
- package/dist/types/Events.d.ts +245 -0
- package/dist/types/Events.js +1 -0
- package/dist/types/OptiViewAdsConfig.d.ts +425 -0
- package/dist/types/OptiViewAdsConfig.js +1 -0
- package/dist/types/VendorAdError.d.ts +12 -0
- package/dist/types/VendorAdError.js +1 -0
- package/dist/vendor/lens-sdk/THIRD-PARTY-NOTICES.txt +266 -0
- package/dist/vendor/lens-sdk/compat.d.ts +9 -0
- package/dist/vendor/lens-sdk/encoding-cmcd.d.ts +9 -0
- package/dist/vendor/lens-sdk/encoding-json.d.ts +9 -0
- package/dist/vendor/lens-sdk/encoding.d.ts +42 -0
- package/dist/vendor/lens-sdk/environment.d.ts +35 -0
- package/dist/vendor/lens-sdk/index.d.ts +3 -0
- package/dist/vendor/lens-sdk/index.js +1 -0
- package/dist/vendor/lens-sdk/legacy.d.ts +12 -0
- package/dist/vendor/lens-sdk/lens-core-Q5lbQGMC.js +1 -0
- package/dist/vendor/lens-sdk/lens-global.d.ts +23 -0
- package/dist/vendor/lens-sdk/lens.d.ts +21 -0
- package/dist/vendor/lens-sdk/transport.d.ts +46 -0
- package/dist/vendor/lens-sdk/types.d.ts +218 -0
- package/dist/vendor/lens-sdk/user-id.d.ts +5 -0
- package/dist/vendor/lens-sdk/validation.d.ts +30 -0
- package/package.json +57 -0
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
/** Break Manifest types, per https://github.com/Dolby-OptiView/optiview-ads-manifest-spec/blob/v1.4.0/spec.md. */
|
|
2
|
+
/** Which 'time' reference break start times use. @category Break Manifests & Ad Formats */
|
|
3
|
+
export declare enum Timebase {
|
|
4
|
+
/** An absolute ISO-8601 timestamp */
|
|
5
|
+
WALLCLOCK = "wallclock",
|
|
6
|
+
/** A presentation timestamp in seconds (may be fractional); live streams */
|
|
7
|
+
PTS = "pts",
|
|
8
|
+
/** Seconds from the start of the asset, matched against the playback position; VOD only */
|
|
9
|
+
MEDIATIME = "mediatime"
|
|
10
|
+
}
|
|
11
|
+
/** Polling configuration for manifest refresh. @category Break Manifests & Ad Formats */
|
|
12
|
+
export interface Polling {
|
|
13
|
+
/** Interval (seconds >= 1) between manifest polls when no break is active. */
|
|
14
|
+
idle: number;
|
|
15
|
+
/** Interval (seconds >= 1) between manifest polls while a break is currently being rendered. */
|
|
16
|
+
active: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Session-level configuration for one vendor, discriminated by `type` (same identifiers as an
|
|
20
|
+
* asset's `vendor`). At most one entry per type; unknown types are logged and ignored.
|
|
21
|
+
* @category Break Manifests & Ad Formats */
|
|
22
|
+
export interface VendorConfigurationBase {
|
|
23
|
+
/** The vendor this configuration applies to. */
|
|
24
|
+
type: string;
|
|
25
|
+
}
|
|
26
|
+
/** Session-level GAM configuration for pod-serving SGAI. @category Break Manifests & Ad Formats */
|
|
27
|
+
export interface GamSgaiConfiguration {
|
|
28
|
+
customAssetKey: string;
|
|
29
|
+
assetParameters?: Record<string, string>;
|
|
30
|
+
}
|
|
31
|
+
/** Session-level GAM configuration for full-service DAI SSAI. @category Break Manifests & Ad Formats */
|
|
32
|
+
export interface GamSsaiConfiguration {
|
|
33
|
+
assetKey: string;
|
|
34
|
+
assetParameters?: Record<string, string>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The GAM identity needed to create the IMA/DAI stream session. Must agree with the per-asset
|
|
38
|
+
* `vendorParameters`: GAM answers a `stream_id` registered under another custom asset key with HTTP 410.
|
|
39
|
+
* @category Break Manifests & Ad Formats */
|
|
40
|
+
export interface GamVendorConfiguration extends VendorConfigurationBase {
|
|
41
|
+
type: 'gam';
|
|
42
|
+
/** The configured network code for this organization. */
|
|
43
|
+
networkCode: string;
|
|
44
|
+
/**
|
|
45
|
+
* The configured custom asset key for this channel — pod serving (sgai).
|
|
46
|
+
* @deprecated Prefer `sgai[0].customAssetKey` in manifest spec v1.4.0.
|
|
47
|
+
*/
|
|
48
|
+
customAssetKey: string;
|
|
49
|
+
/**
|
|
50
|
+
* Full-service DAI livestream asset key, required for a stitched (ssai) stream.
|
|
51
|
+
* @deprecated Prefer `ssai[0].assetKey` in manifest spec v1.4.0.
|
|
52
|
+
*/
|
|
53
|
+
assetKey?: string;
|
|
54
|
+
sgai?: GamSgaiConfiguration[];
|
|
55
|
+
ssai?: GamSsaiConfiguration[];
|
|
56
|
+
}
|
|
57
|
+
/** Known vendor configuration entries, kept open to unrecognized vendors from newer manifests. @category Break Manifests & Ad Formats */
|
|
58
|
+
export type VendorConfiguration = GamVendorConfiguration | VendorConfigurationBase;
|
|
59
|
+
/** Type guard: narrows a {@link VendorConfiguration} to a {@link GamVendorConfiguration}. */
|
|
60
|
+
export declare function isGamVendorConfiguration(entry: VendorConfiguration): entry is GamVendorConfiguration;
|
|
61
|
+
/** The root Break Manifest structure. @category Break Manifests & Ad Formats */
|
|
62
|
+
export interface BreakManifest {
|
|
63
|
+
/** Manifest version (semver format, e.g., "1.0.0") */
|
|
64
|
+
version: string;
|
|
65
|
+
/** Determines which 'time' reference is used */
|
|
66
|
+
timebase: Timebase;
|
|
67
|
+
/** Identifier of the organization owning the stream. */
|
|
68
|
+
organizationId?: string;
|
|
69
|
+
/** Identifier of the channel the stream belongs to. */
|
|
70
|
+
channelId?: string;
|
|
71
|
+
/** Identifier of the event being streamed. */
|
|
72
|
+
eventId?: string;
|
|
73
|
+
/** Determines how often the manifest should be refreshed */
|
|
74
|
+
polling?: Polling;
|
|
75
|
+
/** Ordered delivery-steering rules (first match wins), evaluated once on the first fetch; absent means sgai. */
|
|
76
|
+
delivery?: DeliveryRule[];
|
|
77
|
+
/** Played seconds (>= 0) before any break may start; omitted means 0. */
|
|
78
|
+
adStartDelay?: number;
|
|
79
|
+
/** Session-level configuration per vendor integration (spec 1.1.0). */
|
|
80
|
+
vendorConfiguration?: VendorConfiguration[];
|
|
81
|
+
/** The available breaks */
|
|
82
|
+
breaks: Break[];
|
|
83
|
+
}
|
|
84
|
+
/** Delivery architecture selected by a {@link DeliveryRule}. @category Break Manifests & Ad Formats */
|
|
85
|
+
export declare enum DeliveryMode {
|
|
86
|
+
/** Server-Guided Ad Insertion — the SDK schedules and renders breaks client-side. */
|
|
87
|
+
SGAI = "sgai",
|
|
88
|
+
/** Server-Side Ad Insertion — the content player plays a server-stitched stream. */
|
|
89
|
+
SSAI = "ssai"
|
|
90
|
+
}
|
|
91
|
+
/** One delivery-steering rule. Without targeting it matches every client (the default). @category Break Manifests & Ad Formats */
|
|
92
|
+
export interface DeliveryRule {
|
|
93
|
+
/** Typed as {@link DeliveryMode}, but unknown future values may arrive (forward compatibility). */
|
|
94
|
+
mode: DeliveryMode;
|
|
95
|
+
targeting?: Targeting;
|
|
96
|
+
}
|
|
97
|
+
/** User control options during a break. @category Break Manifests & Ad Formats */
|
|
98
|
+
export interface Controls {
|
|
99
|
+
/** Offset after which the break can be skipped, in seconds >= 0. */
|
|
100
|
+
skipOffset?: number;
|
|
101
|
+
/** Whether snapback is enabled. */
|
|
102
|
+
snapback?: boolean;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Break position relative to playback lifecycle (SDK shorthand for an {@link EventTrigger}).
|
|
106
|
+
* - `pre`: pre-roll, same as `start: { type: 'event', event: 'start' }`.
|
|
107
|
+
* @category Break Manifests & Ad Formats */
|
|
108
|
+
export type BreakPosition = 'pre';
|
|
109
|
+
/** Playback lifecycle events a break can be triggered by (spec 1.1.0). @category Break Manifests & Ad Formats */
|
|
110
|
+
export declare enum BreakEvent {
|
|
111
|
+
/** Content playback begins (pre-roll). Fires once per session. */
|
|
112
|
+
START = "start",
|
|
113
|
+
/** The viewer pauses content. */
|
|
114
|
+
PAUSE = "pause",
|
|
115
|
+
/** Content playback ends (post-roll). */
|
|
116
|
+
END = "end"
|
|
117
|
+
}
|
|
118
|
+
/** Event-triggered break start (spec 1.1.0): the break is scheduled by a playback event, not a time. @category Break Manifests & Ad Formats */
|
|
119
|
+
export interface EventTrigger {
|
|
120
|
+
type: 'event';
|
|
121
|
+
/** Typed as {@link BreakEvent}, but unknown future values may arrive (forward compatibility). */
|
|
122
|
+
event: BreakEvent;
|
|
123
|
+
/**
|
|
124
|
+
* Seconds after the event before the break triggers. For `start` this counts played media
|
|
125
|
+
* time only: pausing or seeking does not advance it.
|
|
126
|
+
* @default 0
|
|
127
|
+
*/
|
|
128
|
+
delay?: number;
|
|
129
|
+
}
|
|
130
|
+
/** A single ad break. @category Break Manifests & Ad Formats */
|
|
131
|
+
export interface Break {
|
|
132
|
+
/** The identifier of the break */
|
|
133
|
+
id: string;
|
|
134
|
+
/**
|
|
135
|
+
* Break start in the timebase: wallclock is an ISO-8601 string, pts/mediatime seconds >= 0,
|
|
136
|
+
* or an {@link EventTrigger}. Ignored when `position` is set (scheduling uses `delay`).
|
|
137
|
+
*/
|
|
138
|
+
start: string | number | EventTrigger;
|
|
139
|
+
/** `'pre'`: pre-roll relative to playback start. Not supported in SSAI mode. */
|
|
140
|
+
position?: BreakPosition;
|
|
141
|
+
/**
|
|
142
|
+
* Seconds of content played before a `'pre'` roll triggers.
|
|
143
|
+
* @default 0
|
|
144
|
+
*/
|
|
145
|
+
delay?: number;
|
|
146
|
+
/** The maximum duration of the break in seconds */
|
|
147
|
+
duration: number;
|
|
148
|
+
/** Where the player should resume after the break in seconds >= 0 */
|
|
149
|
+
resumeOffset?: number;
|
|
150
|
+
/** What the user is allowed to do during a break */
|
|
151
|
+
controls?: Controls;
|
|
152
|
+
/** The variant or list of variants for this break */
|
|
153
|
+
variant: BreakVariant | BreakVariant[];
|
|
154
|
+
}
|
|
155
|
+
/** The supported break formats. @category Break Manifests & Ad Formats */
|
|
156
|
+
export declare enum BreakFormat {
|
|
157
|
+
/** One slot covering the player surface */
|
|
158
|
+
SINGLE = "single",
|
|
159
|
+
/** Two zones — main video area + a companion area alongside */
|
|
160
|
+
DOUBLE = "double",
|
|
161
|
+
/** Main video shrinks into a corner, ad is played, backdrop filled with companion ad */
|
|
162
|
+
LSHAPE_AD = "lshape_ad",
|
|
163
|
+
/** Main video shrinks, content keeps playing, backdrop filled with ad */
|
|
164
|
+
LSHAPE_CONTENT = "lshape_content",
|
|
165
|
+
/** Ad rendered on top of main content, main keeps playing */
|
|
166
|
+
OVERLAY = "overlay"
|
|
167
|
+
}
|
|
168
|
+
/** Device type for targeting. @category Break Manifests & Ad Formats */
|
|
169
|
+
export declare enum DeviceType {
|
|
170
|
+
DESKTOP = "desktop",
|
|
171
|
+
MOBILE = "mobile",
|
|
172
|
+
TABLET = "tablet",
|
|
173
|
+
TV = "tv"
|
|
174
|
+
}
|
|
175
|
+
/** Targeting criteria for break variants. @category Break Manifests & Ad Formats */
|
|
176
|
+
export interface Targeting {
|
|
177
|
+
deviceType?: DeviceType;
|
|
178
|
+
}
|
|
179
|
+
/** Base fields for all break variants. @category Break Manifests & Ad Formats */
|
|
180
|
+
export interface BaseBreakVariant {
|
|
181
|
+
/** The format of the break */
|
|
182
|
+
format: BreakFormat;
|
|
183
|
+
/** Player-side match criteria, omit to mark as default variant */
|
|
184
|
+
targeting?: Targeting;
|
|
185
|
+
}
|
|
186
|
+
/** Single break variant - full-screen ad. @category Break Manifests & Ad Formats */
|
|
187
|
+
export interface SingleBreakVariant extends BaseBreakVariant {
|
|
188
|
+
format: BreakFormat.SINGLE;
|
|
189
|
+
/** A list of assets */
|
|
190
|
+
assets: Asset[];
|
|
191
|
+
}
|
|
192
|
+
/** An asset paired with a companion (double and lshape_ad). The companion is a flat property per spec. @category Break Manifests & Ad Formats */
|
|
193
|
+
export type AssetWithCompanion = Asset & {
|
|
194
|
+
companion: Asset;
|
|
195
|
+
};
|
|
196
|
+
/** Overlay position, fractional [0.0–1.0]; the SDK converts to CSS percentages. @category Break Manifests & Ad Formats */
|
|
197
|
+
export interface OverlayPosition {
|
|
198
|
+
top?: number;
|
|
199
|
+
bottom?: number;
|
|
200
|
+
left?: number;
|
|
201
|
+
right?: number;
|
|
202
|
+
}
|
|
203
|
+
/** Overlay size, fractional [0.0–1.0]; the SDK converts to CSS percentages. @category Break Manifests & Ad Formats */
|
|
204
|
+
export interface OverlaySize {
|
|
205
|
+
width: number;
|
|
206
|
+
height: number;
|
|
207
|
+
}
|
|
208
|
+
/** Double-box variant — ad on one side, companion on the other. Content pauses. @category Break Manifests & Ad Formats */
|
|
209
|
+
export interface DoubleBreakVariant extends BaseBreakVariant {
|
|
210
|
+
format: BreakFormat.DOUBLE;
|
|
211
|
+
/** Paired ad + companion assets. */
|
|
212
|
+
assets: AssetWithCompanion[];
|
|
213
|
+
}
|
|
214
|
+
/** L-shape (ad) variant — content shrinks to pip, ad fills main area, companion fills the backdrop. Content pauses. @category Break Manifests & Ad Formats */
|
|
215
|
+
export interface LshapeAdBreakVariant extends BaseBreakVariant {
|
|
216
|
+
format: BreakFormat.LSHAPE_AD;
|
|
217
|
+
/** Paired ad + companion assets. */
|
|
218
|
+
assets: AssetWithCompanion[];
|
|
219
|
+
}
|
|
220
|
+
/** L-shape (content) variant — content shrinks to pip and keeps playing, ad fills the main area. @category Break Manifests & Ad Formats */
|
|
221
|
+
export interface LshapeContentBreakVariant extends BaseBreakVariant {
|
|
222
|
+
format: BreakFormat.LSHAPE_CONTENT;
|
|
223
|
+
/** Ad assets (no companion). */
|
|
224
|
+
assets: Asset[];
|
|
225
|
+
}
|
|
226
|
+
/** Overlay variant — ad plays on top of content, which keeps playing. Position and size come from the manifest. @category Break Manifests & Ad Formats */
|
|
227
|
+
export interface OverlayBreakVariant extends BaseBreakVariant {
|
|
228
|
+
format: BreakFormat.OVERLAY;
|
|
229
|
+
/** Ad assets. */
|
|
230
|
+
assets: Asset[];
|
|
231
|
+
/** Position within the player container (CSS values). */
|
|
232
|
+
position: OverlayPosition;
|
|
233
|
+
/** Size of the overlay (CSS values). */
|
|
234
|
+
size: OverlaySize;
|
|
235
|
+
/** Opacity 0–1. Defaults to 1. */
|
|
236
|
+
opacity?: number;
|
|
237
|
+
}
|
|
238
|
+
/** Union of all break variants. @category Break Manifests & Ad Formats */
|
|
239
|
+
export type BreakVariant = SingleBreakVariant | DoubleBreakVariant | LshapeAdBreakVariant | LshapeContentBreakVariant | OverlayBreakVariant;
|
|
240
|
+
/** The type of the asset. @category Break Manifests & Ad Formats */
|
|
241
|
+
export declare enum AssetType {
|
|
242
|
+
/** Static resource, direct URL */
|
|
243
|
+
STATIC = "static",
|
|
244
|
+
/** VAST tag URL */
|
|
245
|
+
VAST = "vast",
|
|
246
|
+
/** Vendor-specific (e.g., Google DAI) */
|
|
247
|
+
VENDOR = "vendor"
|
|
248
|
+
}
|
|
249
|
+
/** Whether the asset is a video or image. @category Break Manifests & Ad Formats */
|
|
250
|
+
export declare enum MediaType {
|
|
251
|
+
VIDEO = "video",
|
|
252
|
+
IMAGE = "image"
|
|
253
|
+
}
|
|
254
|
+
/** Supported vendors for vendor assets. @category Break Manifests & Ad Formats */
|
|
255
|
+
export declare enum Vendor {
|
|
256
|
+
/** Google Ad Manager */
|
|
257
|
+
GAM = "gam"
|
|
258
|
+
}
|
|
259
|
+
/** Interaction options for an asset. @category Break Manifests & Ad Formats */
|
|
260
|
+
export interface Interaction {
|
|
261
|
+
/** Click-through URL */
|
|
262
|
+
clickThrough?: string;
|
|
263
|
+
}
|
|
264
|
+
/** Asset URI with optional targeting. @category Break Manifests & Ad Formats */
|
|
265
|
+
export interface AssetUri {
|
|
266
|
+
value: string;
|
|
267
|
+
targeting?: Targeting;
|
|
268
|
+
}
|
|
269
|
+
/** Base fields for all assets. @category Break Manifests & Ad Formats */
|
|
270
|
+
export interface BaseAsset {
|
|
271
|
+
/** The identifier of the asset, unique within the break */
|
|
272
|
+
id: string;
|
|
273
|
+
/** The type of the asset */
|
|
274
|
+
type: AssetType;
|
|
275
|
+
/** The media type, video or image */
|
|
276
|
+
mediaType: MediaType;
|
|
277
|
+
/** The mime type of the media */
|
|
278
|
+
mimeType?: string;
|
|
279
|
+
/** The maximum duration of the asset in seconds */
|
|
280
|
+
duration?: number;
|
|
281
|
+
/** Interaction options */
|
|
282
|
+
interaction?: Interaction;
|
|
283
|
+
}
|
|
284
|
+
/** Static asset - direct URL to media. @category Break Manifests & Ad Formats */
|
|
285
|
+
export interface StaticAsset extends BaseAsset {
|
|
286
|
+
type: AssetType.STATIC;
|
|
287
|
+
/** The resource URL or array of URLs with targeting */
|
|
288
|
+
uri: string | AssetUri[];
|
|
289
|
+
}
|
|
290
|
+
/** VAST asset, played by Google IMA as CSAI. SGAI only, linear formats only (single, double, lshape_ad). @category Break Manifests & Ad Formats */
|
|
291
|
+
export interface VastAsset extends BaseAsset {
|
|
292
|
+
type: AssetType.VAST;
|
|
293
|
+
/** The VAST tag URL, or an array of URLs with targeting. */
|
|
294
|
+
uri: string | AssetUri[];
|
|
295
|
+
/**
|
|
296
|
+
* Query parameters the player appends to the VAST tag URL. Values may be
|
|
297
|
+
* `$NAME$` macros (`$OPTIVIEW_*$` built-ins or customer-registered ones).
|
|
298
|
+
*/
|
|
299
|
+
assetParameters?: Record<string, string>;
|
|
300
|
+
}
|
|
301
|
+
/** Vendor asset - vendor-specific retrieval (e.g., Google DAI). @category Break Manifests & Ad Formats */
|
|
302
|
+
export interface VendorAsset extends BaseAsset {
|
|
303
|
+
type: AssetType.VENDOR;
|
|
304
|
+
/** The URI of the asset for the vendor (e.g., pod id for GAM DAI) */
|
|
305
|
+
uri: string;
|
|
306
|
+
/** The vendor used to retrieve the asset */
|
|
307
|
+
vendor: Vendor;
|
|
308
|
+
/** Vendor-specific parameters */
|
|
309
|
+
vendorParameters: Record<string, string>;
|
|
310
|
+
/** Asset-specific parameters (e.g., adTagParameters for GAM) */
|
|
311
|
+
assetParameters?: Record<string, string>;
|
|
312
|
+
}
|
|
313
|
+
/** Union of all assets. @category Break Manifests & Ad Formats */
|
|
314
|
+
export type Asset = StaticAsset | VastAsset | VendorAsset;
|
|
315
|
+
/** Type guard: narrows a break `start` to an {@link EventTrigger}. */
|
|
316
|
+
export declare function isEventTrigger(start: Break['start']): start is EventTrigger;
|
|
317
|
+
/**
|
|
318
|
+
* The lifecycle event a break is triggered by, or `null` for a timeline break. Reads both the
|
|
319
|
+
* spec shape (`start: { type: 'event', event }`) and the SDK shorthand (`position`).
|
|
320
|
+
*/
|
|
321
|
+
export declare function getBreakEvent(breakInfo: Break): string | null;
|
|
322
|
+
/** Whether the break is a pause ad: `start: { type: 'event', event: 'pause' }`. */
|
|
323
|
+
export declare function isPauseBreak(breakInfo: Break): boolean;
|
|
324
|
+
/** Seconds of played content before a pre-roll triggers, or `null` when the break is not a pre-roll. */
|
|
325
|
+
export declare function getPreRollDelay(breakInfo: Break): number | null;
|
|
326
|
+
/** Whether the break is a post-roll: `start: { type: 'event', event: 'end' }`. */
|
|
327
|
+
export declare function isPostRollBreak(breakInfo: Break): boolean;
|
|
328
|
+
/** Seconds after content playback ends before a post-roll triggers, or `null` when the break is not a post-roll. */
|
|
329
|
+
export declare function getPostRollDelay(breakInfo: Break): number | null;
|
|
330
|
+
/** Type guard: narrows an {@link Asset} to a {@link StaticAsset}. */
|
|
331
|
+
export declare function isStaticAsset(asset: Asset): asset is StaticAsset;
|
|
332
|
+
/** Type guard: narrows an {@link Asset} to a {@link VastAsset}. */
|
|
333
|
+
export declare function isVastAsset(asset: Asset): asset is VastAsset;
|
|
334
|
+
/** Type guard: narrows an {@link Asset} to a {@link VendorAsset}. */
|
|
335
|
+
export declare function isVendorAsset(asset: Asset): asset is VendorAsset;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var Timebase;!function(e){e.WALLCLOCK="wallclock",e.PTS="pts",e.MEDIATIME="mediatime"}(Timebase||(Timebase={}));export function isGamVendorConfiguration(e){return"gam"===e.type}export var DeliveryMode;!function(e){e.SGAI="sgai",e.SSAI="ssai"}(DeliveryMode||(DeliveryMode={}));export var BreakEvent;!function(e){e.START="start",e.PAUSE="pause",e.END="end"}(BreakEvent||(BreakEvent={}));export var BreakFormat;!function(e){e.SINGLE="single",e.DOUBLE="double",e.LSHAPE_AD="lshape_ad",e.LSHAPE_CONTENT="lshape_content",e.OVERLAY="overlay"}(BreakFormat||(BreakFormat={}));export var DeviceType;!function(e){e.DESKTOP="desktop",e.MOBILE="mobile",e.TABLET="tablet",e.TV="tv"}(DeviceType||(DeviceType={}));export var AssetType;!function(e){e.STATIC="static",e.VAST="vast",e.VENDOR="vendor"}(AssetType||(AssetType={}));export var MediaType;!function(e){e.VIDEO="video",e.IMAGE="image"}(MediaType||(MediaType={}));export var Vendor;!function(e){e.GAM="gam"}(Vendor||(Vendor={}));export function isEventTrigger(e){return"object"==typeof e&&null!==e&&"event"===e.type}export function getBreakEvent(e){return"pre"===e.position?BreakEvent.START:isEventTrigger(e.start)?e.start.event:null}export function isPauseBreak(e){return getBreakEvent(e)===BreakEvent.PAUSE}export function getPreRollDelay(e){return getBreakEvent(e)!==BreakEvent.START?null:"pre"===e.position?e.delay??0:isEventTrigger(e.start)?e.start.delay??0:0}export function isPostRollBreak(e){return getBreakEvent(e)===BreakEvent.END}export function getPostRollDelay(e){return isEventTrigger(e.start)&&e.start.event===BreakEvent.END?e.start.delay??0:null}export function isStaticAsset(e){return e.type===AssetType.STATIC}export function isVastAsset(e){return e.type===AssetType.VAST}export function isVendorAsset(e){return e.type===AssetType.VENDOR}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { Break, Asset, BreakFormat } from './BreakManifest';
|
|
2
|
+
import type { OptiViewAdsMode } from './OptiViewAdsConfig';
|
|
3
|
+
/**
|
|
4
|
+
* Lifecycle phase reported by {@link AdBreakStatus}.
|
|
5
|
+
* - `idle`: no break is upcoming or active.
|
|
6
|
+
* - `upcoming`: a break is scheduled in the future (including pre-break warnings).
|
|
7
|
+
* - `active`: a break is currently playing.
|
|
8
|
+
* @category Events */
|
|
9
|
+
export type AdBreakPhase = 'idle' | 'upcoming' | 'active' | 'complete';
|
|
10
|
+
/** Playback-gated snapshot of an ad break for UI countdowns (`adbreakstatus` event, `sdk.getAdBreakStatus()`). @category Events */
|
|
11
|
+
export interface AdBreakStatus {
|
|
12
|
+
/** Current lifecycle phase of the ad break. */
|
|
13
|
+
phase: AdBreakPhase;
|
|
14
|
+
/** The break this status describes; `null` when `phase` is `idle`. */
|
|
15
|
+
break: Break | null;
|
|
16
|
+
/** Declared format of the break's selected variant, when known. */
|
|
17
|
+
format?: BreakFormat | undefined;
|
|
18
|
+
/** Seconds until the break starts; for a pre-break warning, the countdown value when it fired. */
|
|
19
|
+
secondsUntilBreak?: number | undefined;
|
|
20
|
+
/** Estimated seconds left in the active break; `undefined` when not yet derivable (e.g. a backdrop break with no per-ad `timeupdate`). */
|
|
21
|
+
breakRemainingSec?: number | undefined;
|
|
22
|
+
/** 0-based index of the ad currently playing within the break. */
|
|
23
|
+
adIndex?: number | undefined;
|
|
24
|
+
/** Total number of ads in the break, when known. */
|
|
25
|
+
totalAds?: number | undefined;
|
|
26
|
+
/** Number of ads remaining including the currently playing one. */
|
|
27
|
+
adsRemaining?: number | undefined;
|
|
28
|
+
/** Whether the countdown is advancing (ad rendered, playback progressing). `false` while buffering or before a held pre-roll's first frame. */
|
|
29
|
+
ticking: boolean;
|
|
30
|
+
/** The configured warning second that was crossed, when a pre-break warning triggered this status. */
|
|
31
|
+
warningSec?: number | undefined;
|
|
32
|
+
}
|
|
33
|
+
/** Event types emitted by the OptiViewAds SDK. @category Events */
|
|
34
|
+
export type OptiViewAdsEventType = 'adbreakbegin' | 'adbreakend' | 'adbegin' | 'adend' | 'aderror' | 'adfirstquartile' | 'admidpoint' | 'adthirdquartile' | 'adtimeupdate' | 'adbreakstatus' | 'adclick' | 'waiting' | 'playing' | 'volumechange' | 'adchannelchange';
|
|
35
|
+
/** Which player a playback event originated from. @category Events */
|
|
36
|
+
export type PlaybackSource = 'ad' | 'content';
|
|
37
|
+
/** Base event interface. @category Events */
|
|
38
|
+
export interface OptiViewAdsEvent {
|
|
39
|
+
type: OptiViewAdsEventType;
|
|
40
|
+
timestamp: number;
|
|
41
|
+
}
|
|
42
|
+
/** Emitted when an ad break starts. @category Events */
|
|
43
|
+
export interface AdBreakBeginEvent extends OptiViewAdsEvent {
|
|
44
|
+
type: 'adbreakbegin';
|
|
45
|
+
break: Break;
|
|
46
|
+
/** Declared format of the break's selected variant. */
|
|
47
|
+
format?: BreakFormat | undefined;
|
|
48
|
+
/** Seconds elapsed since the break's start when this viewer joined; zero only at the exact start. */
|
|
49
|
+
elapsedSec: number;
|
|
50
|
+
/**
|
|
51
|
+
* Seconds the break is presented for. Always reported: a viewer can be part-way into a break
|
|
52
|
+
* without a tune-in classification (inside the scheduler's start tolerance).
|
|
53
|
+
*/
|
|
54
|
+
remainingSec: number;
|
|
55
|
+
/**
|
|
56
|
+
* Present when the viewer joined a break already in progress (tune-in).
|
|
57
|
+
* @deprecated Read the top-level `elapsedSec` / `remainingSec`; use this only as the join
|
|
58
|
+
* classification, since part-way joins inside the start tolerance do not set it.
|
|
59
|
+
*/
|
|
60
|
+
tuneIn?: {
|
|
61
|
+
/** Seconds already elapsed since the break's start when the viewer joined. */
|
|
62
|
+
elapsedSec: number;
|
|
63
|
+
/** Effective remaining duration, in seconds, the break is presented for. */
|
|
64
|
+
remainingSec: number;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/** Emitted when an ad break ends. @category Events */
|
|
68
|
+
export interface AdBreakEndEvent extends OptiViewAdsEvent {
|
|
69
|
+
type: 'adbreakend';
|
|
70
|
+
break: Break;
|
|
71
|
+
/** Declared format of the break's selected variant. */
|
|
72
|
+
format?: BreakFormat | undefined;
|
|
73
|
+
}
|
|
74
|
+
/** Emitted when the current or upcoming break's status changes; carries a full {@link AdBreakStatus}. @category Events */
|
|
75
|
+
export interface AdBreakStatusEvent extends OptiViewAdsEvent {
|
|
76
|
+
type: 'adbreakstatus';
|
|
77
|
+
status: AdBreakStatus;
|
|
78
|
+
}
|
|
79
|
+
/** Emitted when an individual ad starts playing. @category Events */
|
|
80
|
+
export interface AdBeginEvent extends OptiViewAdsEvent {
|
|
81
|
+
type: 'adbegin';
|
|
82
|
+
break: Break;
|
|
83
|
+
/** Declared format of the break's selected variant. */
|
|
84
|
+
format?: BreakFormat | undefined;
|
|
85
|
+
asset: Asset;
|
|
86
|
+
adIndex: number;
|
|
87
|
+
totalAds: number;
|
|
88
|
+
/** IMA's ad id for an ad of a GAM pod, where several creatives play under one asset. Absent otherwise. */
|
|
89
|
+
adId?: string | undefined;
|
|
90
|
+
/** IMA's creative id for an ad of a GAM pod. */
|
|
91
|
+
creativeId?: string | undefined;
|
|
92
|
+
/** 1-based position within the pod as reported at runtime (IMA `getAdPodInfo().getAdPosition()` / VAST `sequence`). */
|
|
93
|
+
podPosition?: number | undefined;
|
|
94
|
+
}
|
|
95
|
+
/** Emitted when an individual ad finishes playing. @category Events */
|
|
96
|
+
export interface AdEndEvent extends OptiViewAdsEvent {
|
|
97
|
+
type: 'adend';
|
|
98
|
+
break: Break;
|
|
99
|
+
/** Declared format of the break's selected variant. */
|
|
100
|
+
format?: BreakFormat | undefined;
|
|
101
|
+
asset: Asset;
|
|
102
|
+
adIndex: number;
|
|
103
|
+
totalAds: number;
|
|
104
|
+
/** IMA's ad id for an ad of a GAM pod. */
|
|
105
|
+
adId?: string | undefined;
|
|
106
|
+
/** IMA's creative id for an ad of a GAM pod. */
|
|
107
|
+
creativeId?: string | undefined;
|
|
108
|
+
}
|
|
109
|
+
/** Emitted when playback fails (ad or content; see `source`). `break`/`asset` only for ad errors. @category Events */
|
|
110
|
+
export interface AdErrorEvent extends OptiViewAdsEvent {
|
|
111
|
+
type: 'aderror';
|
|
112
|
+
source: PlaybackSource;
|
|
113
|
+
break?: Break;
|
|
114
|
+
/** Declared format of the break's selected variant; absent for content errors. */
|
|
115
|
+
format?: BreakFormat | undefined;
|
|
116
|
+
asset?: Asset;
|
|
117
|
+
error: Error;
|
|
118
|
+
}
|
|
119
|
+
/** Emitted when an ad reaches the first quartile (25%). @category Events */
|
|
120
|
+
export interface AdFirstQuartileEvent extends OptiViewAdsEvent {
|
|
121
|
+
type: 'adfirstquartile';
|
|
122
|
+
break: Break;
|
|
123
|
+
/** Declared format of the break's selected variant. */
|
|
124
|
+
format?: BreakFormat | undefined;
|
|
125
|
+
asset: Asset;
|
|
126
|
+
/** Which ad the milestone belongs to, for multi-ad GAM pods where quartile cycles repeat under one asset. */
|
|
127
|
+
adIndex?: number | undefined;
|
|
128
|
+
/** Ads in the break, when known. */
|
|
129
|
+
totalAds?: number | undefined;
|
|
130
|
+
}
|
|
131
|
+
/** Emitted when an ad reaches the midpoint (50%). @category Events */
|
|
132
|
+
export interface AdMidpointEvent extends OptiViewAdsEvent {
|
|
133
|
+
type: 'admidpoint';
|
|
134
|
+
break: Break;
|
|
135
|
+
/** Declared format of the break's selected variant. */
|
|
136
|
+
format?: BreakFormat | undefined;
|
|
137
|
+
asset: Asset;
|
|
138
|
+
/** Which ad the milestone belongs to, when known. */
|
|
139
|
+
adIndex?: number | undefined;
|
|
140
|
+
/** Ads in the break, when known. */
|
|
141
|
+
totalAds?: number | undefined;
|
|
142
|
+
}
|
|
143
|
+
/** Emitted when an ad reaches the third quartile (75%). @category Events */
|
|
144
|
+
export interface AdThirdQuartileEvent extends OptiViewAdsEvent {
|
|
145
|
+
type: 'adthirdquartile';
|
|
146
|
+
break: Break;
|
|
147
|
+
/** Declared format of the break's selected variant. */
|
|
148
|
+
format?: BreakFormat | undefined;
|
|
149
|
+
asset: Asset;
|
|
150
|
+
/** Which ad the milestone belongs to, when known. */
|
|
151
|
+
adIndex?: number | undefined;
|
|
152
|
+
/** Ads in the break, when known. */
|
|
153
|
+
totalAds?: number | undefined;
|
|
154
|
+
}
|
|
155
|
+
/** Emitted on each timeupdate tick during ad playback. @category Events */
|
|
156
|
+
export interface AdTimeupdateEvent extends OptiViewAdsEvent {
|
|
157
|
+
type: 'adtimeupdate';
|
|
158
|
+
break: Break;
|
|
159
|
+
/** Declared format of the break's selected variant. */
|
|
160
|
+
format?: BreakFormat | undefined;
|
|
161
|
+
asset: Asset;
|
|
162
|
+
/** Current playback position within the ad asset, in seconds. */
|
|
163
|
+
currentTime: number;
|
|
164
|
+
/** Total duration of the ad asset in seconds. May be Infinity for live/unknown assets. */
|
|
165
|
+
duration: number;
|
|
166
|
+
}
|
|
167
|
+
/** Emitted when playback stalls (native `waiting`), ad or content per `source`. `break`/`asset` only for ads. @category Events */
|
|
168
|
+
export interface WaitingEvent extends OptiViewAdsEvent {
|
|
169
|
+
type: 'waiting';
|
|
170
|
+
source: PlaybackSource;
|
|
171
|
+
break?: Break;
|
|
172
|
+
asset?: Asset;
|
|
173
|
+
}
|
|
174
|
+
/** Emitted on every native `playing`, ad or content per `source`. `break`/`asset` only for ads. @category Events */
|
|
175
|
+
export interface PlayingEvent extends OptiViewAdsEvent {
|
|
176
|
+
type: 'playing';
|
|
177
|
+
source: PlaybackSource;
|
|
178
|
+
break?: Break;
|
|
179
|
+
asset?: Asset;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Emitted when the unified mute/volume state changes (setters, a direct element mutation the
|
|
183
|
+
* sync picked up, or the `double`-break audio-focus handoff). Describes the effective audio
|
|
184
|
+
* owner: the ad player during a break, content otherwise.
|
|
185
|
+
* @category Events */
|
|
186
|
+
export interface VolumeChangeEvent extends OptiViewAdsEvent {
|
|
187
|
+
type: 'volumechange';
|
|
188
|
+
muted: boolean;
|
|
189
|
+
volume: number;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Emitted when the on-screen ad is clicked (viewer tap or {@link OptiViewAds.clickAd}).
|
|
193
|
+
* `clickThrough` is the asset's declared URL. The SDK does not navigate automatically;
|
|
194
|
+
* your application decides how to open the destination.
|
|
195
|
+
* @category Events */
|
|
196
|
+
export interface AdClickEvent extends OptiViewAdsEvent {
|
|
197
|
+
type: 'adclick';
|
|
198
|
+
break: Break;
|
|
199
|
+
/** Declared format of the break's selected variant. */
|
|
200
|
+
format?: BreakFormat | undefined;
|
|
201
|
+
asset: Asset;
|
|
202
|
+
clickThrough?: string | undefined;
|
|
203
|
+
}
|
|
204
|
+
/** Why the SDK rebuilt its ad setup from a polled manifest; see {@link AdChannelChangeEvent}. @category Events */
|
|
205
|
+
export type AdChannelChangeReason = 'channel-id-changed' | 'channel-id-added' | 'channel-id-removed' | 'vendor-configuration-changed' | 'timebase-changed';
|
|
206
|
+
/**
|
|
207
|
+
* Emitted when a polled manifest describes a different ads channel than the one the session
|
|
208
|
+
* was started on. During an active break, the event is emitted after that break finishes and
|
|
209
|
+
* the latest polled manifest is applied. Before playback starts, the new manifest's
|
|
210
|
+
* `adStartDelay` applies; after playback starts, the delay in effect is unchanged.
|
|
211
|
+
* @category Events */
|
|
212
|
+
export interface AdChannelChangeEvent extends OptiViewAdsEvent {
|
|
213
|
+
type: 'adchannelchange';
|
|
214
|
+
/** `channelId` of the manifest the session was aligned to before; `null` when it had none. */
|
|
215
|
+
previousChannelId: string | null;
|
|
216
|
+
/** `channelId` of the manifest the session is aligned to now; `null` when it has none. */
|
|
217
|
+
channelId: string | null;
|
|
218
|
+
reason: AdChannelChangeReason;
|
|
219
|
+
/** The polled manifest URL (unchanged by the switch). */
|
|
220
|
+
manifestUrl: string;
|
|
221
|
+
/** Delivery mode in effect before the switch. */
|
|
222
|
+
previousDeliveryMode: OptiViewAdsMode;
|
|
223
|
+
/** Delivery mode in effect after the switch. */
|
|
224
|
+
deliveryMode: OptiViewAdsMode;
|
|
225
|
+
}
|
|
226
|
+
/** Union type of all SDK events. @category Events */
|
|
227
|
+
export type OptiViewAdsEventMap = {
|
|
228
|
+
adbreakbegin: AdBreakBeginEvent;
|
|
229
|
+
adbreakend: AdBreakEndEvent;
|
|
230
|
+
adbegin: AdBeginEvent;
|
|
231
|
+
adend: AdEndEvent;
|
|
232
|
+
aderror: AdErrorEvent;
|
|
233
|
+
adfirstquartile: AdFirstQuartileEvent;
|
|
234
|
+
admidpoint: AdMidpointEvent;
|
|
235
|
+
adthirdquartile: AdThirdQuartileEvent;
|
|
236
|
+
adtimeupdate: AdTimeupdateEvent;
|
|
237
|
+
adbreakstatus: AdBreakStatusEvent;
|
|
238
|
+
adclick: AdClickEvent;
|
|
239
|
+
waiting: WaitingEvent;
|
|
240
|
+
playing: PlayingEvent;
|
|
241
|
+
volumechange: VolumeChangeEvent;
|
|
242
|
+
adchannelchange: AdChannelChangeEvent;
|
|
243
|
+
};
|
|
244
|
+
/** Event handler type. @category Events */
|
|
245
|
+
export type OptiViewAdsEventHandler<T extends OptiViewAdsEventType> = (event: OptiViewAdsEventMap[T]) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|