@glomex/integration-web-component 1.1476.0 → 1.1478.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/index.d.ts CHANGED
@@ -27,6 +27,12 @@ export declare interface Ad {
27
27
  clickThroughUrl?: string;
28
28
  }
29
29
 
30
+ export declare class AdError extends Error {
31
+ code: string;
32
+ name: string;
33
+ constructor(message: string, code: string);
34
+ }
35
+
30
36
  export declare const ALLOWED_UI_ACTIONS: readonly ["play", "pause", "openEpg", "startAgeSetup", "forgotPin"];
31
37
 
32
38
  /**
@@ -971,6 +977,13 @@ export declare interface IntegrationElementEventMap {
971
977
  * @eventProperty
972
978
  */
973
979
  [IntegrationEvent.AD_COMPLETE]: CustomEvent<void>;
980
+ /**
981
+ * @inheritdoc IntegrationEvent.AD_ERROR
982
+ * @eventProperty
983
+ */
984
+ [IntegrationEvent.AD_ERROR]: CustomEvent<{
985
+ error: AdError;
986
+ }>;
974
987
  /**
975
988
  * @inheritdoc IntegrationEvent.UI_INTERACTION
976
989
  * @eventProperty
@@ -1174,6 +1187,11 @@ export declare enum IntegrationEvent {
1174
1187
  * @eventProperty
1175
1188
  */
1176
1189
  AD_COMPLETE = "adcomplete",
1190
+ /**
1191
+ * When a non-fatal ad error occurs during playback or setup (not triggered when ad loading fails).
1192
+ * @eventProperty
1193
+ */
1194
+ AD_ERROR = "aderror",
1177
1195
  /**
1178
1196
  * When the user interacted with the UI (e.g. play, pause, seek, etc.). The specific action is provided in the payload.
1179
1197
  * @eventProperty
@@ -1261,7 +1279,7 @@ export declare interface Marker {
1261
1279
  type: MarkerType;
1262
1280
  /**
1263
1281
  * Threshold for the marker:
1264
- * - {@link MarkerType.TIME_IN_SECONDS}: seconds
1282
+ * - {@link MarkerType.TIME_IN_SECONDS}: seconds (use negative values to calculate position from end of content, e.g., -10 means 10 seconds before the end; only valid for VoD content)
1265
1283
  * - {@link MarkerType.PERCENT}: percent as fraction (0-1)
1266
1284
  * - {@link MarkerType.TIME_IN_SECONDS_RECURRING}: seconds
1267
1285
  */
@@ -1387,7 +1405,52 @@ export declare interface MediaItem {
1387
1405
  */
1388
1406
  channel?: Channel;
1389
1407
  /**
1390
- * Markers of the media item.
1408
+ * Markers control ad breaks and custom time-based events during playback.
1409
+ *
1410
+ * **⚠️ Important:** When providing custom markers, the default PREROLL is **not** added automatically.
1411
+ * You must explicitly include a PREROLL marker if you want ads to play.
1412
+ *
1413
+ * **Reserved marker names:** Only `PREROLL`, `MIDROLL`, and `POSTROLL` from {@link KnownMarkerName}
1414
+ * can be used for ad markers. All other `KnownMarkerName` values are reserved for internal use.
1415
+ * Use custom string names (e.g., `'halfwayPoint'`) for your own markers.
1416
+ *
1417
+ * **Listening for custom markers:** When a custom marker is reached, the player dispatches
1418
+ * an {@link IntegrationEvent.CONTENT_MARKER_REACHED} event. Listen for this event to react
1419
+ * to your custom markers:
1420
+ *
1421
+ * ```js
1422
+ * player.addEventListener('contentmarkerreached', (event) => {
1423
+ * const { markerName, markerData } = event.detail;
1424
+ * if (markerName === 'showEndCreditsOverlay') {
1425
+ * // Show your overlay
1426
+ * }
1427
+ * });
1428
+ * ```
1429
+ *
1430
+ * @example
1431
+ * // Default: pre-roll ads only (same as omitting markers)
1432
+ * markers: [{ name: KnownMarkerName.PREROLL, type: MarkerType.TIME_IN_SECONDS, threshold: 0 }]
1433
+ *
1434
+ * @example
1435
+ * // Pre-roll + mid-roll at 60 seconds
1436
+ * markers: [
1437
+ * { name: KnownMarkerName.PREROLL, type: MarkerType.TIME_IN_SECONDS, threshold: 0 },
1438
+ * { name: KnownMarkerName.MIDROLL, type: MarkerType.TIME_IN_SECONDS, threshold: 60 }
1439
+ * ]
1440
+ *
1441
+ * @example
1442
+ * // Custom marker at 50% of content
1443
+ * markers: [
1444
+ * { name: KnownMarkerName.PREROLL, type: MarkerType.TIME_IN_SECONDS, threshold: 0 },
1445
+ * { name: 'halfwayPoint', type: MarkerType.PERCENT, threshold: 0.5 }
1446
+ * ]
1447
+ *
1448
+ * @example
1449
+ * // Custom marker 15 seconds before end (e.g., for end credits overlay)
1450
+ * markers: [
1451
+ * { name: KnownMarkerName.PREROLL, type: MarkerType.TIME_IN_SECONDS, threshold: 0 },
1452
+ * { name: 'showEndCreditsOverlay', type: MarkerType.TIME_IN_SECONDS, threshold: -15 }
1453
+ * ]
1391
1454
  *
1392
1455
  * @defaultValue `[{ name: KnownMarkerName.PREROLL, type: MarkerType.TIME_IN_SECONDS, threshold: 0 }]`
1393
1456
  */
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- (_=m||(m={})).DEFAULT="turbo-integration",_.SCRIPT="turbo-script",_.IFRAME="turbo-iframe",_.FULLPAGE="turbo-fullpage",_.AMP_VIDEO_IFRAME="turbo-amp-video-iframe",_.AMP_IFRAME="turbo-amp-iframe",(N=u||(u={})).INTEGRATION="glomex-integration",N.EXTERNAL_MEDIA_ITEM="glomex-external-media-item",N.GLOMEX_MEDIA_ITEM="glomex-media-item",(I=D||(D={})).INTEGRATION_CONFIGS="application/glomex-integration-configs+json",I.EXTERNAL_MEDIA_ITEM="application/glomex-external-media-item+json";let e="turbo",t=`${e}-player`,n=`${e}DebugPlayerConfig`;(A=S||(S={})).HIDDEN="hidden",A.INLINE="inline",A.DOCK="dock",A.LIGHTBOX="lightbox",A.LIGHTBOX_EXTERNAL="lightbox-external",A.FULLSCREEN="fullscreen",A.AMP_DOCK="amp-dock",(l=P||(P={})).READY="ready",l.INTEGRATION_ABORT="integrationabort",l.INTEGRATION_AD_AVAILABLE="integrationadavailable",l.INTEGRATION_PASSBACK="integrationpassback",l.USER_UPDATE_CONSENT="userupdateconsent",l.PLAYLIST_UPDATE="playlistupdate",l.PLAYER_SET_PRESENTATION_MODE="playersetpresentationmode",l.CONTENT_SELECT="contentselect",l.CONTENT_START="contentstart",l.CONTENT_IMPRESSION="contentimpression",l.CONTENT_BUFFERING_START="contentbufferingstart",l.CONTENT_BUFFERING_END="contentbufferingend",l.CONTENT_STOP="contentstop",l.CONTENT_ERROR="contenterror",l.CONTENT_MARKER_REACHED="contentmarkerreached",l.CONTENT_QUALITY_CHANGED="contentqualitychanged",l.CONTENT_TIME_UPDATE="timeupdate",l.CONTENT_SEEKING="seeking",l.CONTENT_SEEKED="seeked",l.CONTENT_PLAY="play",l.CONTENT_PAUSE="pause",l.CONTENT_VOLUME_CHANGE="volumechange",l.CONTENT_ENDED="ended",l.AD_BREAK_REQUEST="adbreakrequest",l.AD_BREAK_REQUEST_ERROR="adbreakrequesterror",l.AD_LOADED="adloaded",l.AD_IMPRESSION="adimpression",l.AD_BUFFERING_START="adbufferingstart",l.AD_BUFFERING_END="adbufferingend",l.AD_TIME_UPDATE="adtimeupdate",l.AD_VOLUME_CHANGE="advolumechange",l.AD_PAUSED="adpaused",l.AD_RESUMED="adresumed",l.AD_CLICK="adclick",l.AD_SKIPPED="adskipped",l.AD_COMPLETE="adcomplete",l.UI_INTERACTION="uiinteraction",(s=M||(M={})).TIME_IN_SECONDS="time",s.PERCENT="percent",s.TIME_IN_SECONDS_RECURRING="timeRecurring",(d=g||(g={})).PREROLL="preroll",d.MIDROLL="midroll",d.POSTROLL="postroll",d.FIRST_QUARTILE="contentFirstQuartile",d.MIDPOINT="contentMidpoint",d.THIRD_QUARTILE="contentThirdQuartile",d.COMPLETE="contentComplete",d.STILL_INTERESTING="stillInteresting",d.REQUEST_RECOMMENDATIONS="requestRecommendations",(c=U||(U={})).NOT_FOUND="NotFound",c.NOT_AVAILABLE="NotAvailable",c.GEOBLOCKED="Geoblocked",c.YOUTH_PROTECTED="YouthProtected",c.TERMINATED="Terminated",c.LOGIN_REQUIRED="LoginRequired",c.HIGHER_TIER_ACCOUNT_REQUIRED="HigherTierAccountRequired",c.GENERIC="Generic",(R=G||(G={})).GLOMEX="glomex",R.JOYN="joyn",R.EXTERNAL="external",(p=y||(y={})).HLS="application/vnd.apple.mpegurl",p.HLS_LEGACY="application/x-mpegURL",p.DASH="application/dash+xml",p.MP4="video/mp4",p.OGG="video/ogg",p.WEBM="video/webm",p.MP3="audio/mp3",p.AAC="audio/aac",p.WAV="audio/wav",p.OGG_AUDIO="audio/ogg",p.MPEG_AUDIO="audio/mpeg",p.DYNAMIC_CONTENT="application/x-turbo-dynamic-content",p.JOYN="application/x-joyn-source",(O=b||(b={})).LIVE="live",O.VOD="vod",O.INTERACTIVE="interactive",O.EMBED="embed",(C=F||(F={})).PRE_CLICK="pre-click-to-play",C.CLICK="click-to-play",C.AUTOPLAY_SCROLL="autoplay-scroll",C.AUTOPLAY_SCROLL_OUT="autoplay-scroll-out",C.CLICK_NEXT="click-to-play-next",C.CLICK_REPLAY="click-to-play-replay",C.AUTOPLAY_NEXT="autoplay-next",(L=f||(f={})).CLEAR_PLAYLIST="clearPlaylist",L.SELECT_PLAYLIST_ITEM="selectPlaylistItem",L.ENDED="ended",L.CONTENT_ERROR="contentError",L.API_STOP="apiStop",L.LIVESTREAM_STOP="livestreamStop",L.PAGE_HIDE="pageHide",L.BEFORE_UNLOAD="beforeUnload";let a=["play","pause","openEpg","startAgeSetup","forgotPin"],E="player.glomex.com",o=`https://${E}/integration/1/integration.js`;function i(e){return`https://${E}/variant/${e}/variant.css`}function r(){if(window.customElements.get(u.INTEGRATION))return;let e=document.createElement("script");e.innerText=`import('${o}');`,e.type="module",(document.head||document.body).appendChild(e)}function T(e){if(document.querySelector(`link[href="${i(e)}"]`))return;let t=document.createElement("link");t.rel="stylesheet",t.href=i(e),(document.head||document.body).appendChild(t)}var _,N,I,A,l,s,d,c,R,p,O,C,L,m,u,D,S,P,M,g,U,G,y,b,F,f,k="turbo",h="glomex";export{a as ALLOWED_UI_ACTIONS,n as DEBUG_CONFIG_STORAGE_KEY,t as EXTERNAL_PLAYER_NAME,u as ComponentName,f as ContentStopReason,P as IntegrationEvent,g as KnownMarkerName,M as MarkerType,U as MediaItemErrorCode,G as MediaItemProvider,y as Mimetype,m as Origin,b as PlaybackMode,S as PresentationMode,D as ScriptType,F as StartMethod,i as getIntegrationCssUrl,r as loadIntegrationComponent,T as loadIntegrationStyles,k as INTERNAL_PREFIX,h as PUBLIC_PREFIX};
1
+ (_=m||(m={})).DEFAULT="turbo-integration",_.SCRIPT="turbo-script",_.IFRAME="turbo-iframe",_.FULLPAGE="turbo-fullpage",_.AMP_VIDEO_IFRAME="turbo-amp-video-iframe",_.AMP_IFRAME="turbo-amp-iframe",(N=u||(u={})).INTEGRATION="glomex-integration",N.EXTERNAL_MEDIA_ITEM="glomex-external-media-item",N.GLOMEX_MEDIA_ITEM="glomex-media-item",(I=D||(D={})).INTEGRATION_CONFIGS="application/glomex-integration-configs+json",I.EXTERNAL_MEDIA_ITEM="application/glomex-external-media-item+json";let e="turbo",t=`${e}-player`,n=`${e}DebugPlayerConfig`;(A=S||(S={})).HIDDEN="hidden",A.INLINE="inline",A.DOCK="dock",A.LIGHTBOX="lightbox",A.LIGHTBOX_EXTERNAL="lightbox-external",A.FULLSCREEN="fullscreen",A.AMP_DOCK="amp-dock",(l=P||(P={})).READY="ready",l.INTEGRATION_ABORT="integrationabort",l.INTEGRATION_AD_AVAILABLE="integrationadavailable",l.INTEGRATION_PASSBACK="integrationpassback",l.USER_UPDATE_CONSENT="userupdateconsent",l.PLAYLIST_UPDATE="playlistupdate",l.PLAYER_SET_PRESENTATION_MODE="playersetpresentationmode",l.CONTENT_SELECT="contentselect",l.CONTENT_START="contentstart",l.CONTENT_IMPRESSION="contentimpression",l.CONTENT_BUFFERING_START="contentbufferingstart",l.CONTENT_BUFFERING_END="contentbufferingend",l.CONTENT_STOP="contentstop",l.CONTENT_ERROR="contenterror",l.CONTENT_MARKER_REACHED="contentmarkerreached",l.CONTENT_QUALITY_CHANGED="contentqualitychanged",l.CONTENT_TIME_UPDATE="timeupdate",l.CONTENT_SEEKING="seeking",l.CONTENT_SEEKED="seeked",l.CONTENT_PLAY="play",l.CONTENT_PAUSE="pause",l.CONTENT_VOLUME_CHANGE="volumechange",l.CONTENT_ENDED="ended",l.AD_BREAK_REQUEST="adbreakrequest",l.AD_BREAK_REQUEST_ERROR="adbreakrequesterror",l.AD_LOADED="adloaded",l.AD_IMPRESSION="adimpression",l.AD_BUFFERING_START="adbufferingstart",l.AD_BUFFERING_END="adbufferingend",l.AD_TIME_UPDATE="adtimeupdate",l.AD_VOLUME_CHANGE="advolumechange",l.AD_PAUSED="adpaused",l.AD_RESUMED="adresumed",l.AD_CLICK="adclick",l.AD_SKIPPED="adskipped",l.AD_COMPLETE="adcomplete",l.AD_ERROR="aderror",l.UI_INTERACTION="uiinteraction",(s=M||(M={})).TIME_IN_SECONDS="time",s.PERCENT="percent",s.TIME_IN_SECONDS_RECURRING="timeRecurring",(d=g||(g={})).PREROLL="preroll",d.MIDROLL="midroll",d.POSTROLL="postroll",d.FIRST_QUARTILE="contentFirstQuartile",d.MIDPOINT="contentMidpoint",d.THIRD_QUARTILE="contentThirdQuartile",d.COMPLETE="contentComplete",d.STILL_INTERESTING="stillInteresting",d.REQUEST_RECOMMENDATIONS="requestRecommendations",(c=U||(U={})).NOT_FOUND="NotFound",c.NOT_AVAILABLE="NotAvailable",c.GEOBLOCKED="Geoblocked",c.YOUTH_PROTECTED="YouthProtected",c.TERMINATED="Terminated",c.LOGIN_REQUIRED="LoginRequired",c.HIGHER_TIER_ACCOUNT_REQUIRED="HigherTierAccountRequired",c.GENERIC="Generic",(R=G||(G={})).GLOMEX="glomex",R.JOYN="joyn",R.EXTERNAL="external",(p=y||(y={})).HLS="application/vnd.apple.mpegurl",p.HLS_LEGACY="application/x-mpegURL",p.DASH="application/dash+xml",p.MP4="video/mp4",p.OGG="video/ogg",p.WEBM="video/webm",p.MP3="audio/mp3",p.AAC="audio/aac",p.WAV="audio/wav",p.OGG_AUDIO="audio/ogg",p.MPEG_AUDIO="audio/mpeg",p.DYNAMIC_CONTENT="application/x-turbo-dynamic-content",p.JOYN="application/x-joyn-source",(O=b||(b={})).LIVE="live",O.VOD="vod",O.INTERACTIVE="interactive",O.EMBED="embed",(C=F||(F={})).PRE_CLICK="pre-click-to-play",C.CLICK="click-to-play",C.AUTOPLAY_SCROLL="autoplay-scroll",C.AUTOPLAY_SCROLL_OUT="autoplay-scroll-out",C.CLICK_NEXT="click-to-play-next",C.CLICK_REPLAY="click-to-play-replay",C.AUTOPLAY_NEXT="autoplay-next",(L=f||(f={})).CLEAR_PLAYLIST="clearPlaylist",L.SELECT_PLAYLIST_ITEM="selectPlaylistItem",L.ENDED="ended",L.CONTENT_ERROR="contentError",L.API_STOP="apiStop",L.LIVESTREAM_STOP="livestreamStop",L.PAGE_HIDE="pageHide",L.BEFORE_UNLOAD="beforeUnload";let a=["play","pause","openEpg","startAgeSetup","forgotPin"],E="player.glomex.com",o=`https://${E}/integration/1/integration.js`;function r(e){return`https://${E}/variant/${e}/variant.css`}function i(){if(window.customElements.get(u.INTEGRATION))return;let e=document.createElement("script");e.innerText=`import('${o}');`,e.type="module",(document.head||document.body).appendChild(e)}function T(e){if(document.querySelector(`link[href="${r(e)}"]`))return;let t=document.createElement("link");t.rel="stylesheet",t.href=r(e),(document.head||document.body).appendChild(t)}var _,N,I,A,l,s,d,c,R,p,O,C,L,m,u,D,S,P,M,g,U,G,y,b,F,f,k="turbo",h="glomex";export{a as ALLOWED_UI_ACTIONS,n as DEBUG_CONFIG_STORAGE_KEY,t as EXTERNAL_PLAYER_NAME,u as ComponentName,f as ContentStopReason,P as IntegrationEvent,g as KnownMarkerName,M as MarkerType,U as MediaItemErrorCode,G as MediaItemProvider,y as Mimetype,m as Origin,b as PlaybackMode,S as PresentationMode,D as ScriptType,F as StartMethod,r as getIntegrationCssUrl,i as loadIntegrationComponent,T as loadIntegrationStyles,k as INTERNAL_PREFIX,h as PUBLIC_PREFIX};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glomex/integration-web-component",
3
- "version": "1.1476.0",
3
+ "version": "1.1478.0",
4
4
  "description": "Web component and types to integrate the glomex player",
5
5
  "documentation": "https://docs.glomex.com",
6
6
  "homepage": "https://glomex.com",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "devDependencies": {
34
34
  "@biomejs/biome": "catalog:",
35
- "@glomex/integration": "1.1476.0",
35
+ "@glomex/integration": "1.1478.0",
36
36
  "@microsoft/api-extractor": "catalog:",
37
37
  "@rslib/core": "catalog:",
38
38
  "npm-run-all": "catalog:",
@@ -42,5 +42,5 @@
42
42
  "access": "public"
43
43
  },
44
44
  "license": "MIT",
45
- "gitHead": "427cef38d6a250af73113546e27ea766e1530a45"
45
+ "gitHead": "5c4af5f5c3f822a09675e6fb49b3bcc01a93853c"
46
46
  }