@latest-thinking/lt-player 1.1.0-a → 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/dist/js/lt-player-main.js +1 -1
- package/dist/js/lt-player-main.js.map +1 -1
- package/package.json +1 -1
- package/src/components/config/LTPlayerConfig.ts +5 -0
- package/src/components/config/LTPlayerConfigProcessor.ts +30 -0
- package/src/services/Helper.ts +1 -0
- package/src/services/ResizeService.ts +32 -30
package/package.json
CHANGED
|
@@ -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
|
|
package/src/services/Helper.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {defaultType} from "../global/types/ModuleTypes";
|
|
2
2
|
|
|
3
3
|
export class Helper {
|
|
4
|
+
|
|
4
5
|
static getDevice() {
|
|
5
6
|
let device = 'desktop'; //initiate as false
|
|
6
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,37 +212,39 @@ export class ResizeService {
|
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
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 (this.playerInstance.playerConfig.getEmbed()) {
|
|
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) {
|