@glomex/integration-web-component 1.1544.0 → 1.1545.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/index.js CHANGED
@@ -1 +1,73 @@
1
- function e(e){if("provider"in e)return e;let t=e.sources?.some(e=>e.mimetype===w.JOYN);return{id:e.id||"",provider:t?K.JOYN:K.EXTERNAL,item:e}}(T=x||(x={})).DEFAULT="turbo-integration",T.SCRIPT="turbo-script",T.IFRAME="turbo-iframe",T.FULLPAGE="turbo-fullpage",T.AMP_VIDEO_IFRAME="turbo-amp-video-iframe",T.AMP_IFRAME="turbo-amp-iframe",(p=G||(G={})).INTEGRATION="glomex-integration",p.TURBO_INTEGRATION="turbo-integration",p.EXTERNAL_MEDIA_ITEM="external-media-item",p.GLOMEX_MEDIA_ITEM="glomex-media-item",p.JOYN_MEDIA_ITEM="joyn-media-item",(N=b||(b={})).INTEGRATION_CONFIGS="application/integration-configs+json",N.INTEGRATION_CONFIGS_LEGACY="application/glomex-integration-configs+json",N.EXTERNAL_MEDIA_ITEM="application/external-media-item+json",N.EXTERNAL_MEDIA_ITEM_LEGACY="application/glomex-external-media-item+json";let t="turbo-player";(_=F||(F={})).NET_ID="netId",_.PPID="ppid",_.UTIQ_ID="utiqId",_.LIVERAMP_ID="liverampId",_.PAIR_ID="pairId",_.ATS_DIRECT="atsDirect",(m=k||(k={})).AAID="aaid",m.AFAI="afai",m.ASIA="asia",m.ASID="asid",m.TIFA="tifa",m.VAID="vaid",m.IDFA="idfa",m.IDFV="idfv",m.LGUDID="lgudid",m.MSAI="msai",m.OAID="oaid",m.PSNAI="psnai",m.RIDA="rida",m.VIDA="vida",m.WAID="waid",(A=V||(V={})).HIDDEN="hidden",A.INLINE="inline",A.DOCK="dock",A.LIGHTBOX="lightbox",A.LIGHTBOX_EXTERNAL="lightbox-external",A.FULLSCREEN="fullscreen",A.AMP_DOCK="amp-dock",(R=Y||(Y={})).READY="ready",R.INTEGRATION_ABORT="integrationabort",R.INTEGRATION_AD_AVAILABLE="integrationadavailable",R.INTEGRATION_PASSBACK="integrationpassback",R.USER_UPDATE_CONSENT="userupdateconsent",R.PLAYLIST_UPDATE="playlistupdate",R.PLAYER_SET_PRESENTATION_MODE="playersetpresentationmode",R.CONTENT_SELECT="contentselect",R.CONTENT_START="contentstart",R.CONTENT_IMPRESSION="contentimpression",R.CONTENT_BUFFERING_START="contentbufferingstart",R.CONTENT_BUFFERING_END="contentbufferingend",R.CONTENT_STOP="contentstop",R.CONTENT_SUSPEND="contentsuspend",R.CONTENT_ERROR="contenterror",R.CONTENT_MARKER_REACHED="contentmarkerreached",R.CONTENT_TIME_UPDATE="timeupdate",R.CONTENT_SEEKING="seeking",R.CONTENT_SEEKED="seeked",R.CONTENT_PLAY="play",R.CONTENT_PAUSE="pause",R.CONTENT_VOLUME_CHANGE="volumechange",R.CONTENT_RATECHANGE="ratechange",R.CONTENT_ENDED="ended",R.AD_BREAK_REQUEST="adbreakrequest",R.AD_BREAK_REQUEST_ERROR="adbreakrequesterror",R.AD_LOADED="adloaded",R.AD_IMPRESSION="adimpression",R.AD_BUFFERING_START="adbufferingstart",R.AD_BUFFERING_END="adbufferingend",R.AD_TIME_UPDATE="adtimeupdate",R.AD_VOLUME_CHANGE="advolumechange",R.AD_PAUSED="adpaused",R.AD_RESUMED="adresumed",R.AD_CLICK="adclick",R.AD_SKIPPED="adskipped",R.AD_COMPLETE="adcomplete",R.AD_ERROR="aderror",R.UI_INTERACTION="uiinteraction",(g=B||(B={})).TIME_IN_SECONDS="time",g.PERCENT="percent",g.TIME_IN_SECONDS_RECURRING="timeRecurring",(u=H||(H={})).PREROLL="preroll",u.MIDROLL="midroll",u.POSTROLL="postroll",u.FIRST_QUARTILE="contentFirstQuartile",u.MIDPOINT="contentMidpoint",u.THIRD_QUARTILE="contentThirdQuartile",u.COMPLETE="contentComplete",u.STILL_INTERESTING="stillInteresting",u.REQUEST_RECOMMENDATIONS="requestRecommendations",(O=j||(j={})).NOT_FOUND="NotFound",O.FORBIDDEN="Forbidden",O.HIDDEN="Hidden",O.NO_CONTENT="NoContent",O.GENERIC="Generic",(D=X||(X={})).NOT_FOUND="NotFound",D.NOT_AVAILABLE="NotAvailable",D.GEOBLOCKED="Geoblocked",D.YOUTH_PROTECTED="YouthProtected",D.TERMINATED="Terminated",D.EXPIRED="Expired",D.LOGIN_REQUIRED="LoginRequired",D.HIGHER_TIER_ACCOUNT_REQUIRED="HigherTierAccountRequired",D.VPN_DETECTED="VpnDetected",D.AGE_VERIFICATION_REQUIRED="AgeVerificationRequired",D.PIN_REQUIRED="PinRequired",D.INVALID_PIN="InvalidPin",D.GENERIC="Generic",(L=K||(K={})).GLOMEX="glomex",L.JOYN="joyn",L.EXTERNAL="external",(C=w||(w={})).HLS="application/vnd.apple.mpegurl",C.HLS_LEGACY="application/x-mpegURL",C.DASH="application/dash+xml",C.MP4="video/mp4",C.OGG="video/ogg",C.WEBM="video/webm",C.MP3="audio/mp3",C.AAC="audio/aac",C.WAV="audio/wav",C.OGG_AUDIO="audio/ogg",C.MPEG_AUDIO="audio/mpeg",C.DYNAMIC_CONTENT="application/x-turbo-dynamic-content",C.JOYN="application/x-joyn-source",(S=Q||(Q={})).LIVE="live",S.VOD="vod",S.INTERACTIVE="interactive",S.EMBED="embed",(P=q||(q={})).COMPILATION="compilation",P.CLIP="clip",P.INTERACTIVE="interactive",P.LIVE_ON_DEMAND="live-on-demand",P.LIVE="live",P.MOVIE="movie",P.SERIES="series",P.SPORTS_MATCH="sports-match",P.TRAILER="trailer",(y=$||($={})).ANONYMOUS="anonymous",y.REGISTERED="registered",y.PAID="paid",(M=J||(J={})).FAIRPLAY="com.apple.fps",M.WIDEVINE="com.widevine.alpha",M.PLAYREADY="com.microsoft.playready",(v=W||(W={})).PREROLL="preroll",v.MIDROLL="midroll",v.POSTROLL="postroll",v.OVERLAY="overlay",(f=z||(z={})).LINEAR="linear",f.OVERLAY="overlay",f.CUTIN="cutin",f.PAUSE="pause",(U=Z||(Z={})).PRE_CLICK="pre-click-to-play",U.CLICK="click-to-play",U.AUTOPLAY_SCROLL="autoplay-scroll",U.AUTOPLAY_SCROLL_OUT="autoplay-scroll-out",U.CLICK_NEXT="click-to-play-next",U.CLICK_REPLAY="click-to-play-replay",U.AUTOPLAY_NEXT="autoplay-next",(h=ee||(ee={})).CLEAR_PLAYLIST="clearPlaylist",h.SELECT_PLAYLIST_ITEM="selectPlaylistItem",h.ENDED="ended",h.CONTENT_ERROR="contentError",h.API_STOP="apiStop",h.LIVESTREAM_STOP="livestreamStop",h.LIVESTREAM_NOT_STARTED="livestreamNotStarted",h.PAGE_HIDE="pageHide",h.BEFORE_UNLOAD="beforeUnload";let o=["glomex","joyn"],a={glomex:{name:"glomex",domains:["player.glomex.com","player.mes.glomex.cloud","player.stage.mes.glomex.cloud"],configVersion:1,skipLegacyAuth:!1,trackingTarget:"player-feedback",configService:{prod:"https://config-vvs.glomex.com",stage:"https://vvs-config.stage.mes.glomex.cloud"},integrationService:{prod:"https://integration-cloudfront-eu-west-1.mes.glomex.cloud",stage:"https://integration-cloudfront-eu-west-1.stage.mes.glomex.cloud"},salesHouseService:{prod:"https://sales-house-configuration.mes.glomex.cloud/v2/config/",stage:"https://sales-house-configuration.stage.mes.glomex.cloud/v2/config/"},variantService:{prod:"https://player.glomex.com",stage:"https://player.stage.mes.glomex.cloud"},integrationLoader:{scriptBase:{prod:"https://player.glomex.com",stage:"https://player.stage.mes.glomex.cloud"},cssPath:"/variant/{id}/variant.css",componentName:"glomex-integration"}},joyn:{name:"joyn",domains:["player.joyn.de","player-stage.joyn.de"],configVersion:2,skipLegacyAuth:!0,configService:{prod:"https://player.joyn.de",stage:"https://player-stage.joyn.de",local:"https://localhost:5174"},integrationService:void 0,salesHouseService:void 0,telemetryService:{prod:"https://player.joyn.de/events",stage:"https://player-stage.joyn.de/events",local:"https://player-stage.joyn.de/events"},trackingTarget:"both",integrationLoader:{cssPath:"/config/{id}/styles.css",componentName:"turbo-integration"}}};function n(e){var t;return e&&"string"==typeof(t=e)&&o.includes(t)?a[e]:a.glomex}function r(e,t){let o=n(e);var a=o.integrationLoader.scriptBase??o.configService,r=t??"prod";if(a)return"local"===r&&a.local?a.local:"stage"===r||"local"===r?a.stage:a.prod}function i(e,t,o){let a=n(t),i=r(t,o);return`${i}${a.integrationLoader.cssPath.replace("{id}",e)}`}function s(e){return n(e).integrationLoader.componentName}function E(e,t,o){return i(e,t,o)}function l(e){return s(e)}function d(e,t){let o=s(e);if(window.customElements.get(o))return;let a=`${r(e,t)}/integration/1/integration.js`,n=document.createElement("script");n.innerText=`import('${a}');`,n.type="module",(document.head||document.body).appendChild(n)}function c(e,t,o){let a=i(e,t,o);if(document.querySelector(`link[href="${a}"]`))return;let n=document.createElement("link");n.rel="stylesheet",n.href=a,(document.head||document.body).appendChild(n)}async function I(e){let t=s(e);await customElements.whenDefined(t);let o=customElements.get(t);if(!o?.sharedContext)throw Error(`sharedContext not available on ${t} element`);return o.sharedContext}var T,p,N,_,m,A,R,g,u,O,D,L,C,S,P,y,M,v,f,U,h,x,G,b,F,k,V,Y,B,H,j,X,K,w,Q,q,$,J,W,z,Z,ee,et="turbo",eo="glomex";export{W as AdBreakName,z as AdFormat,G as ComponentName,ee as ContentStopReason,k as DeviceIdName,J as DrmSystem,t as EXTERNAL_PLAYER_NAME,Y as IntegrationEvent,H as KnownMarkerName,B as MarkerType,X as MediaItemErrorCode,K as MediaItemProvider,j as MediaProviderErrorCode,w as Mimetype,x as Origin,Q as PlaybackMode,V as PresentationMode,q as ProgramType,b as ScriptType,Z as StartMethod,F as UserIdName,$ as UserTier,l as getIntegrationComponentName,E as getIntegrationCssUrl,I as getSharedContext,d as loadIntegrationComponent,c as loadIntegrationStyles,e as normalizeMediaItem,et as INTERNAL_PREFIX,eo as PUBLIC_PREFIX};
1
+ export * from '@turbo-player/integration-web-component';
2
+ import { ComponentName as BaseComponentName, createIntegrationClient } from '@turbo-player/integration-web-component';
3
+ export const ComponentName = {
4
+ ...BaseComponentName,
5
+ INTEGRATION: 'glomex-integration'
6
+ };
7
+ const glomexClient = createIntegrationClient({
8
+ moduleUrl: 'https://player.glomex.com/integration/1/integration.js',
9
+ tagName: 'glomex-integration',
10
+ stylesUrl: 'https://player.glomex.com/variant/{id}/variant.css'
11
+ });
12
+ // =============================================================================
13
+ // Public API
14
+ // =============================================================================
15
+ /** Returns the CSS URL for a given integration */
16
+ export function getIntegrationCssUrl(integrationId) {
17
+ return glomexClient.getCssUrl(integrationId);
18
+ }
19
+ /** Returns the custom element name. */
20
+ export function getIntegrationComponentName() {
21
+ return glomexClient.getComponentName();
22
+ }
23
+ /**
24
+ * Loads the integration custom element by injecting the script into the document.
25
+ * Does nothing if the element is already defined.
26
+ */
27
+ export function loadIntegrationComponent() {
28
+ glomexClient.loadComponent();
29
+ }
30
+ /**
31
+ * Loads the variant CSS for the given integration ID by injecting a
32
+ * `<link>` element into the document head. Does nothing if the stylesheet
33
+ * is already loaded.
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * import { loadIntegrationStyles } from '@glomex/integration-web-component';
38
+ *
39
+ * loadIntegrationStyles('your-integration-id');
40
+ * ```
41
+ */
42
+ export function loadIntegrationStyles(integrationId, doc) {
43
+ glomexClient.loadStyles(integrationId, doc);
44
+ }
45
+ /**
46
+ * Returns the {@link SharedContext} singleton from the loaded integration.
47
+ *
48
+ * Waits for the integration custom element to be defined, then
49
+ * reads the singleton from its static property — guaranteeing the same
50
+ * instance that the running player uses.
51
+ *
52
+ * @example
53
+ * ```ts
54
+ * import { getSharedContext } from '@glomex/integration-web-component';
55
+ *
56
+ * const sharedContext = await getSharedContext();
57
+ * sharedContext.set({
58
+ * appVersion: '2.3.0',
59
+ * providers: {
60
+ * 'my-provider': async () => ({ token: await myAuth.getFreshToken() }),
61
+ * }
62
+ * });
63
+ * ```
64
+ */
65
+ export async function getSharedContext() {
66
+ const componentName = glomexClient.getComponentName();
67
+ await customElements.whenDefined(componentName);
68
+ const ctor = customElements.get(componentName);
69
+ if (!ctor?.sharedContext) {
70
+ throw new Error(`sharedContext not available on ${componentName} element`);
71
+ }
72
+ return ctor.sharedContext;
73
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glomex/integration-web-component",
3
- "version": "1.1544.0",
3
+ "version": "1.1545.1",
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",
@@ -24,24 +24,21 @@
24
24
  ],
25
25
  "scripts": {
26
26
  "prepack": "npm run build",
27
- "build": "rm -rf dist && npm-run-all --sequential build:ts build:rslib",
28
- "build:ts": "tsc --build --force",
29
- "build:rslib": "rslib build",
27
+ "build": "rm -rf dist && tsc --build --force",
30
28
  "lint": "tsc --noEmit && biome ci",
31
- "watch": "npm-run-all --parallel \"build:* --watch\""
29
+ "watch": "tsc --build --watch"
30
+ },
31
+ "dependencies": {
32
+ "@turbo-player/integration-web-component": "1.1545.1"
32
33
  },
33
34
  "devDependencies": {
34
35
  "@biomejs/biome": "catalog:",
35
- "@glomex/integration": "1.1544.0",
36
- "@glomex/turbo-shared-types": "1.1543.0",
37
- "@microsoft/api-extractor": "catalog:",
38
- "@rslib/core": "catalog:",
39
- "npm-run-all": "catalog:",
36
+ "@glomex/turbo-shared-types": "1.1545.1",
40
37
  "typescript": "catalog:"
41
38
  },
42
39
  "publishConfig": {
43
40
  "access": "public"
44
41
  },
45
42
  "license": "MIT",
46
- "gitHead": "ecc9b4d93962b583e81d102856ee072381612e6d"
43
+ "gitHead": "809a199d4ac2da3879924b43be9df0fa086b206c"
47
44
  }