@playkit-js/banner-overlay 1.2.4 → 1.2.5-canary.0-e6e19ab

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playkit-js/banner-overlay",
3
- "version": "1.2.4",
3
+ "version": "1.2.5-canary.0-e6e19ab",
4
4
  "description": "Banner overlay plugin for Kaltura player - displays configurable text banners with various positioning and styling options",
5
5
  "main": "dist/playkit-banner-overlay.js",
6
6
  "typings": "dist/index.d.ts",
@@ -17,6 +17,7 @@ export class BannerOverlayPlugin extends BasePlugin {
17
17
  alignment: BannerAlignment.TOP_LEFT,
18
18
  allowWrapping: true,
19
19
  allowClose: false,
20
+ isMetadataBased: false
20
21
  };
21
22
 
22
23
  public static isValid(): boolean {
@@ -29,7 +30,7 @@ export class BannerOverlayPlugin extends BasePlugin {
29
30
  this.logger.info('BannerOverlay: loadMedia lifecycle hook called');
30
31
  this.initialConfig = { ...this.config };
31
32
  let validData = true;
32
- if (this.config.metadataProfileId){
33
+ if (this.useMetadata()) {
33
34
  const metadata = await this.getMetadataFromEntry();
34
35
  if (metadata){
35
36
  validData = this.isValidBannerMetadata(metadata)
@@ -37,6 +38,9 @@ export class BannerOverlayPlugin extends BasePlugin {
37
38
  this.updateConfigFromMetadata(metadata);
38
39
  }
39
40
  }
41
+ else {
42
+ this.config.text = '';
43
+ }
40
44
  }
41
45
  this.removeBannerComponent();
42
46
  if (this.config.text && validData) {
@@ -135,6 +139,10 @@ export class BannerOverlayPlugin extends BasePlugin {
135
139
  }
136
140
  }
137
141
 
142
+ private useMetadata(): boolean {
143
+ return this.config.isMetadataBased && !!this.config.metadataProfileId;
144
+ }
145
+
138
146
  public reset(): void {
139
147
  this.logger.info('BannerOverlay: reset lifecycle hook called');
140
148
  this.config = { ...this.initialConfig };
@@ -14,4 +14,5 @@ export interface BannerOverlayConfig {
14
14
  allowWrapping?: boolean | string; // default: true
15
15
  allowClose?: boolean | string; // default: false
16
16
  useConfigFromMetadata?: boolean;
17
+ isMetadataBased: boolean;
17
18
  };