@latest-thinking/lt-player 1.1.0-b → 1.1.0-c

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": "@latest-thinking/lt-player",
3
- "version": "1.1.0-b",
3
+ "version": "1.1.0-c",
4
4
  "description": "LT player.",
5
5
  "main": "dist/js/lt-player-main.js",
6
6
  "module": "dist/js/lt-player-main.js",
@@ -6,6 +6,7 @@ export class LTPlayerConfig {
6
6
 
7
7
  private configData: playerConfigType = {
8
8
  version : null,
9
+ embed: false,
9
10
  preload: false,
10
11
  autoPlay : false,
11
12
  videoTitle: '',
@@ -233,5 +234,9 @@ export class LTPlayerConfig {
233
234
  return false
234
235
  }
235
236
  }
237
+
238
+ getEmbed() {
239
+ return this.configData.embed;
240
+ }
236
241
  }
237
242
 
@@ -15,6 +15,8 @@ export namespace LTPlayerConfigProcessor {
15
15
 
16
16
  mapByVersion(name: string, value : any) {
17
17
  switch (name) {
18
+ case 'embed':
19
+ return Processor.processEmbed(value, this.version);
18
20
  case 'preload':
19
21
  return Processor.processPreload(value, this.version);
20
22
  case 'autoPlay' :
@@ -544,6 +546,34 @@ export namespace LTPlayerConfigProcessor {
544
546
 
545
547
  return false;
546
548
  }
549
+
550
+ static processEmbed(data : boolean | string | object, version : number) {
551
+
552
+ if (!data) {
553
+ return null;
554
+ }
555
+
556
+ let outputData : boolean = false;
557
+
558
+ if (version === 1) {
559
+ return outputData;
560
+ }
561
+
562
+
563
+ if (typeof data === 'string') {
564
+ if (data === 'true') {
565
+ outputData = true;
566
+ }
567
+ }
568
+
569
+ if (typeof data === 'boolean') {
570
+ if (data) {
571
+ outputData = true;
572
+ }
573
+ }
574
+
575
+ return outputData;
576
+ }
547
577
  }
548
578
  }
549
579
 
@@ -2,14 +2,6 @@ import {defaultType} from "../global/types/ModuleTypes";
2
2
 
3
3
  export class Helper {
4
4
 
5
- static inIframe () {
6
- try {
7
- return window.self !== window.top;
8
- } catch (e) {
9
- return true;
10
- }
11
- }
12
-
13
5
  static getDevice() {
14
6
  let device = 'desktop'; //initiate as false
15
7
  if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)
@@ -212,7 +212,7 @@ export class ResizeService {
212
212
  }
213
213
  }
214
214
 
215
- if (Helper.inIframe()) {
215
+ if (this.playerInstance.playerConfig.getEmbed()) {
216
216
  createAddInfoButtonsInSide();
217
217
  return;
218
218
  }