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

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-a",
3
+ "version": "1.1.0-b",
4
4
  "description": "LT player.",
5
5
  "main": "dist/js/lt-player-main.js",
6
6
  "module": "dist/js/lt-player-main.js",
@@ -1,6 +1,15 @@
1
1
  import {defaultType} from "../global/types/ModuleTypes";
2
2
 
3
3
  export class Helper {
4
+
5
+ static inIframe () {
6
+ try {
7
+ return window.self !== window.top;
8
+ } catch (e) {
9
+ return true;
10
+ }
11
+ }
12
+
4
13
  static getDevice() {
5
14
  let device = 'desktop'; //initiate as false
6
15
  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,37 +212,39 @@ export class ResizeService {
212
212
  }
213
213
  }
214
214
 
215
- // if (containerWidth >= 380) {
216
- //
217
- // if (this.addInfoInSide && (containerWidth + 70 <= 380)) {
218
- // return;
219
- // }
220
- //
221
- // if (this.addInfoOutSide) {
222
- // return;
223
- // }
224
- //
225
- // this.addInfoOutSide = true;
226
- // this.addInfoInSide = false;
227
- //
228
- // createAddInfoButtonsOutSide();
229
- // } else {
230
- //
231
- // if (this.addInfoOutSide && (containerWidth + 70 >= 380)) {
232
- // return;
233
- // }
234
- //
235
- // if (this.addInfoInSide) {
236
- // return;
237
- // }
238
- //
239
- // this.addInfoInSide = true;
240
- // this.addInfoOutSide = false;
241
- // createAddInfoButtonsInSide();
242
- // }
243
-
244
- createAddInfoButtonsInSide();
215
+ if (Helper.inIframe()) {
216
+ createAddInfoButtonsInSide();
217
+ return;
218
+ }
219
+
220
+ if (containerWidth >= 380) {
221
+
222
+ if (this.addInfoInSide && (containerWidth + 70 <= 380)) {
223
+ return;
224
+ }
225
+
226
+ if (this.addInfoOutSide) {
227
+ return;
228
+ }
229
+
230
+ this.addInfoOutSide = true;
231
+ this.addInfoInSide = false;
245
232
 
233
+ createAddInfoButtonsOutSide();
234
+ } else {
235
+
236
+ if (this.addInfoOutSide && (containerWidth + 70 >= 380)) {
237
+ return;
238
+ }
239
+
240
+ if (this.addInfoInSide) {
241
+ return;
242
+ }
243
+
244
+ this.addInfoInSide = true;
245
+ this.addInfoOutSide = false;
246
+ createAddInfoButtonsInSide();
247
+ }
246
248
  }
247
249
 
248
250
  protected setDimensions(containerWidth: number, containerHeight: number, defaultData: defaultType) {