@glomex/integration-web-component 1.1313.0 → 1.1314.5

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.
Files changed (2) hide show
  1. package/build/index.d.ts +104 -32
  2. package/package.json +3 -3
package/build/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export declare interface Ad {
9
9
  breakIndex: number;
10
10
  breakName: string;
11
11
  mimetype: string;
12
+ totalAds: number;
12
13
  nonLinearWidth?: number;
13
14
  nonLinearHeight?: number;
14
15
  }
@@ -30,6 +31,45 @@ export declare enum ComponentName {
30
31
  GLOMEX_MEDIA_ITEM = "glomex-media-item"
31
32
  }
32
33
 
34
+ /**
35
+ * Describes the contract that an external API tracking script must implement so that it can be
36
+ * imported and executed by the integration. The API script must be hosted on the remote server
37
+ * with CORS enabled.
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * import { IntegrationEvent } from '@glomex/integration';
42
+ * export const connectIntegration: ConnectIntegration = (
43
+ * integration,
44
+ * // userId will be undefined when no consent is given
45
+ * { userCountryCode, userId, integrationEnvironment }
46
+ * ) => {
47
+ * integration.addEventListener(IntegrationEvent.CONTENT_PLAY, () => {
48
+ * console.log('play', integration.content);
49
+ * });
50
+ * };
51
+ * ```
52
+ *
53
+ * @example
54
+ * ```js
55
+ * export const connectIntegration = (
56
+ * integration,
57
+ * // userId will be undefined when no consent is given
58
+ * { userCountryCode, userId, integrationEnvironment }
59
+ * ) => {
60
+ * const { IntegrationEvent } = integration.constructor;
61
+ * integration.addEventListener(IntegrationEvent.CONTENT_PLAY, () => {
62
+ * console.log('play', integration.content);
63
+ * });
64
+ * };
65
+ * ```
66
+ */
67
+ export declare type ConnectIntegration = (integration: IntegrationElement, context: {
68
+ userCountryCode?: string;
69
+ userId?: string;
70
+ integrationEnvironment?: string;
71
+ }) => (() => void) | undefined;
72
+
33
73
  export declare interface Consent {
34
74
  gdprApplies: boolean;
35
75
  consentString?: string;
@@ -44,6 +84,18 @@ export declare interface Consent {
44
84
  addtlConsent?: string;
45
85
  }
46
86
 
87
+ /**
88
+ * Selected source of the given content.
89
+ */
90
+ declare interface ContentSource {
91
+ id: string;
92
+ mimetype: Mimetype;
93
+ src: string;
94
+ playbackMode: PlaybackMode;
95
+ entitlementToken?: string;
96
+ drm: boolean;
97
+ }
98
+
47
99
  export declare interface CustomMarker {
48
100
  /** {@inheritDoc Marker.name} */
49
101
  name: string;
@@ -226,6 +278,7 @@ export declare function getIntegrationCssUrl(integrationId: string): string;
226
278
  * ```
227
279
  */
228
280
  export declare class GlomexMediaItemElement extends HTMLElement {
281
+ #private;
229
282
  /**
230
283
  * {@inheritDoc MediaItem#id}
231
284
  */
@@ -233,7 +286,7 @@ export declare class GlomexMediaItemElement extends HTMLElement {
233
286
  /**
234
287
  * Overridden poster of the media item.
235
288
  */
236
- poster?: string;
289
+ poster: string;
237
290
  /**
238
291
  * Overridden title of the media item.
239
292
  */
@@ -242,11 +295,7 @@ export declare class GlomexMediaItemElement extends HTMLElement {
242
295
 
243
296
  export declare interface GlomexMediaItemWithOverrides {
244
297
  id: string;
245
- overrides: {
246
- title?: string;
247
- poster?: string;
248
- teaserVideo?: string;
249
- };
298
+ overrides: Partial<Omit<MediaItem, 'id' | 'sources' | 'isExternal'>>;
250
299
  }
251
300
 
252
301
  /**
@@ -369,10 +418,18 @@ export declare class IntegrationElement extends HTMLElement implements Integrati
369
418
  * Returns `true` if the media playback is currently paused; otherwise, returns `false`.
370
419
  */
371
420
  get paused(): boolean;
421
+ /**
422
+ * Indicates whether the media playback has ended.
423
+ */
424
+ get ended(): boolean;
372
425
  /**
373
426
  * Indicates whether the media is currently in a seeking state.
374
427
  */
375
428
  get seeking(): boolean;
429
+ /**
430
+ * Indicates whether the media is currently in a buffering state.
431
+ */
432
+ get buffering(): boolean;
376
433
  /**
377
434
  * Retrieves the current presentation mode of the media player.
378
435
  * This mode may affect how the media is displayed.
@@ -422,6 +479,8 @@ export declare class IntegrationElement extends HTMLElement implements Integrati
422
479
  * Retrieves details about the currently selected ad, if any.
423
480
  */
424
481
  get currentAd(): Ad | undefined;
482
+ /** Version of the integration */
483
+ get version(): string;
425
484
  /**
426
485
  * Sets the presentation mode of the media player to the specified mode. This mode affects how the integration gets displayed
427
486
  * (e.g. inline, dock, lightbox, fullscreen).
@@ -483,7 +542,10 @@ export declare interface IntegrationElementEventMap {
483
542
  mode: PresentationMode;
484
543
  }>;
485
544
  /** @eventProperty */
486
- contentselect: CustomEvent<unknown>;
545
+ contentselect: CustomEvent<unknown & {
546
+ sessionId: string;
547
+ source: ContentSource;
548
+ }>;
487
549
  /** @eventProperty */
488
550
  contentstart: CustomEvent<unknown>;
489
551
  /** @eventProperty */
@@ -640,6 +702,11 @@ export declare interface IntegrationProperties {
640
702
  * Allows the publisher to provide an optional placement attribute, which supplies additional contextual information for enhanced analytics tracking.
641
703
  */
642
704
  placement?: string;
705
+ /**
706
+ * Allows the publisher to provide an optional ppid (publisher provided user id) attribute, which supplies additional contextual information for enhanced analytics tracking.
707
+ */
708
+ ppid?: string;
709
+ env?: 'stage' | 'local';
643
710
  variant?: string;
644
711
  }
645
712
 
@@ -702,6 +769,19 @@ export declare interface MediaItem {
702
769
  * Unique identifier of the media item.
703
770
  */
704
771
  id: string;
772
+ /**
773
+ * Additional ids that identify the media item in other systems
774
+ */
775
+ additionalIds?: {
776
+ joynId?: string;
777
+ joynMediaId?: string;
778
+ externalId?: string;
779
+ };
780
+ /**
781
+ * Whether the media item is external. This automatically gets set when an external media item is assigned.
782
+ * @ignore
783
+ */
784
+ isExternal?: boolean;
705
785
  /**
706
786
  * Poster image of the media item.
707
787
  */
@@ -837,15 +917,27 @@ export declare interface MediaItem {
837
917
  ageRatingDetails?: string[];
838
918
  /** Keywords of the media item */
839
919
  keywords?: string[];
840
- /** Show id and name of the media item */
920
+ /** Show (often referred to as series, format or tv-show) the media item belongs to */
841
921
  show?: {
922
+ id?: string;
842
923
  name: string;
924
+ episodeNumber?: number;
925
+ seasonNumber?: number;
926
+ };
927
+ /** Competition the media item belongs to */
928
+ competition?: {
929
+ id?: string;
930
+ name?: string;
931
+ };
932
+ /** Compilation the media item belongs to */
933
+ compilation?: {
843
934
  id?: string;
935
+ name?: string;
844
936
  };
845
937
  /** Category id and name of the media item */
846
938
  category?: {
847
- name: string;
848
939
  id?: string;
940
+ name: string;
849
941
  };
850
942
  /** Error information if the media item is not available upfront. */
851
943
  error?: MediaItemError;
@@ -873,7 +965,7 @@ export declare interface MediaItem {
873
965
  endTime?: number;
874
966
  };
875
967
  /**
876
- * Only relevant for glomex-internal use.
968
+ * Only relevant for glomex-internal use. Mark it to allow teaser experiments.
877
969
  * @ignore
878
970
  */
879
971
  allowTeaserExperiments?: boolean;
@@ -884,26 +976,6 @@ export declare interface MediaItem {
884
976
  * @ignore
885
977
  */
886
978
  apiScriptUrl?: string;
887
- /**
888
- * An external episode identifier. Often the id the episode was imported from.
889
- */
890
- externalEpisodeId?: string;
891
- /**
892
- * An additional external show name. Often the name the show was imported from.
893
- */
894
- externalShowName?: string;
895
- /**
896
- * An additional external show identifier. Often the id the show was imported from.
897
- */
898
- externalShowId?: string;
899
- /**
900
- * An additional external channel name. Often the name the channel was imported from.
901
- */
902
- externalChannelName?: string;
903
- /**
904
- * Whether the media item is exclusive for the web.
905
- */
906
- isWebExclusive?: boolean;
907
979
  }
908
980
 
909
981
  /**
@@ -970,7 +1042,7 @@ declare interface MediaSourceBase {
970
1042
  /**
971
1043
  * Unique identifier of the media source.
972
1044
  *
973
- * @defaultValue `...` a generated identifier
1045
+ * @defaultValue `V1StGXR8_Z5jdHi6B-myT` a generated identifier
974
1046
  */
975
1047
  id?: string;
976
1048
  /**
@@ -1036,7 +1108,7 @@ declare interface MediaSourceDynamicContent extends MediaSourceBase {
1036
1108
 
1037
1109
  declare interface MediaSourceJoyn {
1038
1110
  /**
1039
- * Content / video identifier of joyn.
1111
+ * Media / asset identifier of joyn.
1040
1112
  */
1041
1113
  id: string;
1042
1114
  mimetype: Mimetype.JOYN;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glomex/integration-web-component",
3
- "version": "1.1313.0",
3
+ "version": "1.1314.5",
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",
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "devDependencies": {
31
31
  "@biomejs/biome": "^1.9.4",
32
- "@glomex/integration": "^1.1313.0",
32
+ "@glomex/integration": "^1.1314.5",
33
33
  "@microsoft/api-extractor": "^7.52.1",
34
34
  "@rslib/core": "^0.5.4",
35
35
  "typescript": "^5.8.2"
@@ -37,5 +37,5 @@
37
37
  "publishConfig": {
38
38
  "access": "public"
39
39
  },
40
- "gitHead": "826b6ea31ff6915e2677d2cfd8d01c14d9fb6aff"
40
+ "gitHead": "5c827dce4db3d982e8262e43ccc78fcd54619d84"
41
41
  }