@latest-thinking/lt-player 1.1.0-k → 1.1.0-m

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.
@@ -0,0 +1,7 @@
1
+ WEBVTT
2
+
3
+ 00:00:00.500 --> 00:00:20.000
4
+ The Web is always changing and the way we access it is changing and the way we access it is changing<br> Hello <br> and the way we access it is changing
5
+
6
+ 00:00:20.500 --> 00:00:60.300
7
+ and the way we access it is changing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@latest-thinking/lt-player",
3
- "version": "1.1.0-k",
3
+ "version": "1.1.0-m",
4
4
  "description": "LT player.",
5
5
  "main": "dist/js/lt-player-main.js",
6
6
  "module": "dist/js/lt-player-main.js",
@@ -50,4 +50,18 @@
50
50
  .fullscreen-custom-control {
51
51
  display: none !important;
52
52
  }
53
+ }
54
+
55
+ .lt-player-wrapper {
56
+ width: 100%;
57
+ height: 100%;
58
+ object-fit: cover;
59
+ }
60
+
61
+ .lt-player {
62
+ &.fullscreen-disabled {
63
+ .fullscreen-custom-control {
64
+ display: none;
65
+ }
66
+ }
53
67
  }
@@ -21,7 +21,6 @@
21
21
  background: none!important;
22
22
  display: flex!important;
23
23
  flex-direction: column;
24
- justify-content: space-between!important;
25
24
  position: relative;
26
25
  padding: 0!important;
27
26
  }
@@ -316,3 +316,71 @@
316
316
  }
317
317
  }
318
318
  }
319
+
320
+ .plyr__controls {
321
+ opacity: 1 !important;
322
+ }
323
+
324
+
325
+ .plyr__controls {
326
+ .top-controllers {
327
+ //position: unset !important;
328
+ //margin-bottom: auto;
329
+ }
330
+
331
+ .bottom-controller {
332
+ //height: unset !important;
333
+ //position: unset !important;
334
+ }
335
+ }
336
+
337
+ .plyr__controls .settings-controllers {
338
+ //padding: 0 !important;
339
+ //position: unset !important;
340
+ }
341
+
342
+ .lt-player-orientation--portrait .plyr__progress--wrapper {
343
+ //position: unset !important;
344
+ }
345
+
346
+ .lt-player-notification {
347
+ //position: unset !important;
348
+ //width: 100% !important;
349
+ //height: unset !important;
350
+ //display: unset !important;
351
+ //padding: 20px 20px 28px 20px;
352
+ }
353
+
354
+ .lt-player-orientation--portrait .lt-player-notification .lt-player-video-content {
355
+ //padding: 0 !important;
356
+ }
357
+
358
+ .lt-player-orientation--portrait .plyr__controls .bottom-controller {
359
+ //padding: 0 20px 28px 20px !important;
360
+ }
361
+
362
+ .plyr__controls .bottom-controller .volume-control-enable {
363
+ //position: absolute !important;
364
+ }
365
+
366
+ .lt-player-rewind-area {
367
+ //position: absolute;
368
+ //left: 0;
369
+ //width: 50% !important;
370
+ //top: 0;
371
+ }
372
+
373
+ .lt-player-forward-area {
374
+ //position: absolute;
375
+ //right: 0;
376
+ //width: 50% !important;
377
+ //top: 0;
378
+ }
379
+
380
+ .lt-player-notification .lt-player-video-content {
381
+ //position: unset !important;
382
+ }
383
+
384
+ .plyr.plyr--full-ui .plyr--video, .plyr__controls {
385
+ //justify-content: unset !important;
386
+ }
@@ -255,11 +255,9 @@
255
255
  left: 0;
256
256
  background: $default-lt-player-white;
257
257
  border-radius: 0 0 0 30px;
258
- padding: 0 0 32px 0;
259
258
  bottom: 0;
260
259
  opacity: 0;
261
260
 
262
-
263
261
  .line-button {
264
262
  @extend %line-button;
265
263
  }
@@ -1,30 +1,34 @@
1
- .lt-player-landscape--mobile,
2
- .lt-player-landscape--desktop {
3
- &.lt-player--landscape {
4
- &__xxs {
5
- .plyr {
6
- .plyr__caption {
7
- font-size: $lt-player-font-size-base !important;
8
- }
9
- }
1
+ .plyr__caption {
2
+ display: none;
3
+
4
+ span {
5
+ &:empty {
6
+ display: none;
10
7
  }
11
8
  }
12
9
  }
13
10
 
14
- .plyr__caption {
15
- display: flex!important;
16
- justify-content: center!important;
17
- margin: auto!important;
18
- width: 75%;
19
- color: $default-lt-player-white !important;
20
- background-color: $default-lt-player-black !important;
21
- font-size: $lt-player-font-size-lg !important;
22
- line-height: $lt-player-line-height !important;
23
- padding: 8px 12px !important;
24
- font-family: $lt-font-family-base !important;
25
- white-space: unset !important;
26
- }
11
+ .lt-player-custom-captions {
12
+ margin-bottom: 16px;
27
13
 
28
- .plyr__captions span:empty {
29
- display: none!important;
14
+ span {
15
+ display: flex;
16
+ justify-content: center;
17
+ margin: auto;
18
+ width: 75%;
19
+ color: $default-lt-player-black;
20
+ background-color: rgba(216, 216, 70, 0.7);
21
+ font-size: $lt-player-font-size-lg;
22
+ line-height: $lt-player-line-height;
23
+ font-weight: $lt-player-font-weight-md;
24
+ padding: 8px 12px;
25
+ border-radius: 40px;
26
+ font-family: "MuseoSans", sans-serif;
27
+ white-space: unset;
28
+ box-decoration-break: clone;
29
+
30
+ &:empty {
31
+ padding: 0;
32
+ }
33
+ }
30
34
  }
@@ -5,23 +5,18 @@
5
5
  z-index: 9;
6
6
 
7
7
  &--wrapper {
8
- position: absolute;
9
8
  width: 100%;
10
9
  padding: 0 10px;
11
- bottom: 50px;
12
10
  }
13
11
  }
14
12
 
15
13
  &__controls {
16
14
  .bottom-controller {
17
- position: absolute;
18
- bottom: 0;
19
- width: 100%;
20
- height: 36%;
21
15
  display: flex;
22
16
  justify-content: space-between;
23
17
  align-items: flex-end;
24
18
  padding: 15px 10px;
19
+ width: 100%;
25
20
  max-width: 100%;
26
21
 
27
22
  button {
@@ -104,7 +99,7 @@
104
99
  align-items: flex-end;
105
100
  margin-top: 0;
106
101
  margin-bottom: 0;
107
- width: 75px;
102
+ width: 90px;
108
103
  font-size: $lt-player-font-size-sm;
109
104
  font-weight: $lt-player-font-weight-sm;
110
105
  color: $default-lt-player-white !important;
@@ -153,7 +148,7 @@
153
148
  }
154
149
 
155
150
  .volume-control-enable {
156
- position: relative;
151
+ position: absolute;
157
152
  display: flex;
158
153
  height: 200px;
159
154
  justify-content: center;
@@ -267,16 +262,13 @@
267
262
  .plyr {
268
263
  &__progress {
269
264
  &--wrapper {
270
- width: 100%;
271
265
  padding: 0 16px;
272
- position: absolute;
273
- bottom: 56px;
274
266
  }
275
267
  }
276
268
 
277
269
  &__controls {
278
270
  .bottom-controller {
279
- padding: 16px;
271
+ padding: 0 16px 20px;
280
272
 
281
273
  button {
282
274
  @include buttons-xs;
@@ -318,13 +310,12 @@
318
310
  &__progress {
319
311
  &--wrapper {
320
312
  padding: 0 20px;
321
- bottom: 84px;
322
313
  }
323
314
  }
324
315
 
325
316
  &__controls {
326
317
  .bottom-controller {
327
- padding: 20px 20px 28px 20px;
318
+ padding: 0 20px 28px 20px;
328
319
 
329
320
  button {
330
321
  @include buttons-normal;
@@ -368,7 +359,6 @@
368
359
  &__progress {
369
360
  &--wrapper {
370
361
  padding: 0 20px;
371
- bottom: 65px;
372
362
  }
373
363
  }
374
364
 
@@ -414,6 +404,7 @@
414
404
 
415
405
  &__volume_control {
416
406
  display: flex;
407
+ left: 100px;
417
408
  }
418
409
 
419
410
  .mini-player-control {
@@ -448,7 +439,6 @@
448
439
  &__progress {
449
440
  &--wrapper {
450
441
  padding: 0 40px;
451
- bottom: 81px;
452
442
  }
453
443
  }
454
444
 
@@ -2,12 +2,7 @@
2
2
 
3
3
  .lt-player-notification {
4
4
  width: 100%;
5
- height: 100%;
6
- display: flex;
7
-
8
- &.portrait {
9
- position: relative;
10
- }
5
+ padding: 20px 20px 28px 20px;
11
6
 
12
7
  &__notification-button-state {
13
8
  position: absolute;
@@ -32,11 +27,9 @@
32
27
  }
33
28
 
34
29
  .lt-player-video-content {
35
- position: absolute;
36
- bottom: 110px;
37
30
  text-align: left;
38
31
  display: flex;
39
- padding: 0 16px;
32
+ padding: 0;
40
33
  width: 100%;
41
34
  user-select: none;
42
35
  align-items: end;
@@ -98,9 +91,19 @@
98
91
  .lt-player-rewind-area,
99
92
  .lt-player-forward-area {
100
93
  touch-action: inherit !important;
101
- width: 100%;
94
+ width: 50%;
102
95
  height: 100%;
103
96
  z-index: 4;
97
+ position: absolute;
98
+ top: 0;
99
+ }
100
+
101
+ .lt-player-forward-area {
102
+ right: 0;
103
+ }
104
+
105
+ .lt-player-rewind-area {
106
+ left: 0;
104
107
  }
105
108
 
106
109
  .lt-player-rewind,
@@ -225,9 +228,6 @@
225
228
  .lt-player-orientation--portrait {
226
229
  .lt-player-notification {
227
230
  .lt-player-video-content {
228
- padding: 0 20px;
229
- bottom: 136px;
230
-
231
231
  .poster-title {
232
232
  @extend %line-clamp-3;
233
233
  @include line-clamp-3;
@@ -14,7 +14,7 @@
14
14
  .top-controllers {
15
15
  width: 100%;
16
16
  padding: 10px 10px 0;
17
- position: absolute;
17
+ margin-bottom: auto;
18
18
 
19
19
  button {
20
20
  @extend %lt-player-btn;
@@ -128,6 +128,7 @@ export namespace LTPlayer {
128
128
 
129
129
  if (this.playerConfig.getFullscreenMode()) {
130
130
  Object.assign(playerSettings, this.playerConfig.getFullscreenMode());
131
+ this.playerConfig.getPlayerElementContainer().classList.add('fullscreen-disabled');
131
132
  }
132
133
 
133
134
  const element = this.playerConfig.getPlayerElementContainer().querySelector('.embed_player');
@@ -12,7 +12,7 @@ export class LTPlayerUpdate {
12
12
  }
13
13
 
14
14
  updatePlayer(config: defaultType) {
15
- this.updateSource(config.body.videoUrl);
15
+ this.updateVideo(config.body.videoUrl, config.body.posterImage);
16
16
  this.updateTitle(config.body.videoParagraph);
17
17
  this.updateAuthor(config.body.videoTitle);
18
18
  this.updateChapters(config);
@@ -24,11 +24,13 @@ export class LTPlayerUpdate {
24
24
  this.player.playerControl.initChapters(config.body.chapters);
25
25
  }
26
26
 
27
- updateSource(videoUrl: string) {
27
+ updateVideo(videoUrl: string, poster: string) {
28
+ const video = document.querySelector('video');
29
+ video.poster = poster;
28
30
  if (Hls.isSupported()) {
29
31
  this.player.hls.hlsInstance.detachMedia();
30
32
  this.player.hls.hlsInstance.loadSource(videoUrl);
31
- this.player.hls.hlsInstance.attachMedia(document.querySelector('video'));
33
+ this.player.hls.hlsInstance.attachMedia(video);
32
34
  } else {
33
35
  document.querySelector('video').src = videoUrl;
34
36
  }
@@ -6,6 +6,7 @@ export class LTPlayerConfig {
6
6
 
7
7
  private configData: playerConfigType = {
8
8
  version : null,
9
+ alwaysDisplayControls: false,
9
10
  embed: false,
10
11
  preload: false,
11
12
  autoPlay : false,
@@ -94,6 +95,10 @@ export class LTPlayerConfig {
94
95
 
95
96
  }
96
97
 
98
+ isAlwaysDisplayControls() {
99
+ return this.configData.alwaysDisplayControls
100
+ }
101
+
97
102
  getObjectFit() {
98
103
  return this.configData.videoObjectFit
99
104
  }
@@ -15,6 +15,8 @@ export namespace LTPlayerConfigProcessor {
15
15
 
16
16
  mapByVersion(name: string, value : any) {
17
17
  switch (name) {
18
+ case 'alwaysDisplayControls':
19
+ return value;
18
20
  case 'embed':
19
21
  return Processor.processEmbed(value, this.version);
20
22
  case 'preload':
@@ -61,14 +63,14 @@ export namespace LTPlayerConfigProcessor {
61
63
 
62
64
  export class Processor {
63
65
 
64
- static processObserve(data : defaultType, version : number) {
66
+ static processObserve(data: defaultType, version: number) {
65
67
 
66
- let output : defaultType = {
67
- width : false,
68
- height : false
68
+ let output: defaultType = {
69
+ width: false,
70
+ height: false
69
71
  }
70
72
 
71
- if(!data) {
73
+ if (!data) {
72
74
  return;
73
75
  }
74
76
  if (version === 1) {
@@ -79,7 +81,7 @@ export namespace LTPlayerConfigProcessor {
79
81
  return;
80
82
  }
81
83
 
82
- const setPropriety = (value : boolean | string | number) : boolean => {
84
+ const setPropriety = (value: boolean | string | number): boolean => {
83
85
  if (!value) {
84
86
  return false;
85
87
  }
@@ -109,9 +111,9 @@ export namespace LTPlayerConfigProcessor {
109
111
  return output
110
112
  }
111
113
 
112
- static processChapters(data : defaultType, version : number) {
114
+ static processChapters(data: defaultType, version: number) {
113
115
 
114
- if(!data) {
116
+ if (!data) {
115
117
  return;
116
118
  }
117
119
 
@@ -128,19 +130,19 @@ export namespace LTPlayerConfigProcessor {
128
130
  }
129
131
 
130
132
 
131
- static processDefaultConfig(data : defaultType, version : number) {
132
- let outputData : defaultType = {
133
- speed : {
134
- selected : 1,
135
- captions : false,
133
+ static processDefaultConfig(data: defaultType, version: number) {
134
+ let outputData: defaultType = {
135
+ speed: {
136
+ selected: 1,
137
+ captions: false,
136
138
  update: true
137
139
  },
138
- captions : {
139
- active : false
140
+ captions: {
141
+ active: false
140
142
  },
141
- clickToPlay : false,
142
- playsinline : true,
143
- pip : false
143
+ clickToPlay: false,
144
+ playsinline: true,
145
+ pip: false
144
146
  }
145
147
 
146
148
  if (!data) {
@@ -167,9 +169,9 @@ export namespace LTPlayerConfigProcessor {
167
169
 
168
170
  }
169
171
 
170
- static processVimeoConfig(data : defaultType, version : number) {
172
+ static processVimeoConfig(data: defaultType, version: number) {
171
173
 
172
- let outputData : defaultType = {
174
+ let outputData: defaultType = {
173
175
  controls: false,
174
176
  active: false,
175
177
  gesture: 'media',
@@ -191,7 +193,7 @@ export namespace LTPlayerConfigProcessor {
191
193
  return outputData;
192
194
  }
193
195
 
194
- if (Object.keys(data).length === 0){
196
+ if (Object.keys(data).length === 0) {
195
197
  return outputData;
196
198
  }
197
199
 
@@ -206,21 +208,21 @@ export namespace LTPlayerConfigProcessor {
206
208
  return outputData;
207
209
  }
208
210
 
209
- static processShareData(data : defaultType, version : number) {
211
+ static processShareData(data: defaultType, version: number) {
210
212
  if (!data) {
211
213
  return null
212
214
  }
213
215
 
214
216
  type shareDataConfig = {
215
- canonicalUrl : string,
216
- embedUrl : string,
217
- title : string
217
+ canonicalUrl: string,
218
+ embedUrl: string,
219
+ title: string
218
220
  } | null
219
221
 
220
- let outputData : shareDataConfig = {
221
- canonicalUrl : undefined,
222
- embedUrl : undefined,
223
- title : undefined
222
+ let outputData: shareDataConfig = {
223
+ canonicalUrl: undefined,
224
+ embedUrl: undefined,
225
+ title: undefined
224
226
  }
225
227
 
226
228
  if (version === 1) {
@@ -251,7 +253,7 @@ export namespace LTPlayerConfigProcessor {
251
253
  return outputData;
252
254
  }
253
255
 
254
- static processPlayerContainer(data : Element | defaultType, version : number) {
256
+ static processPlayerContainer(data: Element | defaultType, version: number) {
255
257
  if (!data) {
256
258
  return null
257
259
  }
@@ -263,7 +265,7 @@ export namespace LTPlayerConfigProcessor {
263
265
  return data;
264
266
  }
265
267
 
266
- static processVideoUrl(data : string | defaultType, version : number) {
268
+ static processVideoUrl(data: string | defaultType, version: number) {
267
269
 
268
270
  if (!data) {
269
271
  return null
@@ -276,14 +278,14 @@ export namespace LTPlayerConfigProcessor {
276
278
  }
277
279
  }
278
280
 
279
- type configData = {videoUrl : string, videoType : string, embedId : string, embedHash : string, origin : string};
281
+ type configData = { videoUrl: string, videoType: string, embedId: string, embedHash: string, origin: string };
280
282
 
281
- let outputData : configData = {
282
- videoUrl : undefined,
283
- videoType : undefined,
284
- embedHash : undefined,
285
- embedId : undefined,
286
- origin : undefined
283
+ let outputData: configData = {
284
+ videoUrl: undefined,
285
+ videoType: undefined,
286
+ embedHash: undefined,
287
+ embedId: undefined,
288
+ origin: undefined
287
289
  }
288
290
 
289
291
  if (!Helper.isValidHttpUrl(data)) {
@@ -332,7 +334,7 @@ export namespace LTPlayerConfigProcessor {
332
334
  return outputData;
333
335
  }
334
336
 
335
- static processVideoParagraph(data : string | defaultType, version : number) {
337
+ static processVideoParagraph(data: string | defaultType, version: number) {
336
338
 
337
339
  if (!data) {
338
340
  return null
@@ -346,14 +348,14 @@ export namespace LTPlayerConfigProcessor {
346
348
  }
347
349
  }
348
350
 
349
- if (typeof data === 'string' && /[a-zA-Z]/.test(data)){
351
+ if (typeof data === 'string' && /[a-zA-Z]/.test(data)) {
350
352
  outputData = data;
351
353
  }
352
354
 
353
355
  return outputData;
354
356
  }
355
357
 
356
- static processPosterImage(data: string | defaultType, version : number) {
358
+ static processPosterImage(data: string | defaultType, version: number) {
357
359
 
358
360
  if (!data) {
359
361
  return null
@@ -374,7 +376,8 @@ export namespace LTPlayerConfigProcessor {
374
376
  console.error(`Set valid url for poster image config item => posterImage : ${data} `);
375
377
  return undefined;
376
378
  }
377
- static processVideoTitle(data : string | defaultType, version : number) {
379
+
380
+ static processVideoTitle(data: string | defaultType, version: number) {
378
381
 
379
382
  if (!data) {
380
383
  return null
@@ -389,20 +392,21 @@ export namespace LTPlayerConfigProcessor {
389
392
  }
390
393
 
391
394
  if (data) {
392
- if (typeof data === 'string' && /[a-zA-Z]/.test(data)){
395
+ if (typeof data === 'string' && /[a-zA-Z]/.test(data)) {
393
396
  outputData = data;
394
397
  }
395
398
  }
396
399
 
397
400
  return outputData;
398
401
  }
399
- static processAutoPlay(data : boolean | string | object, version : number) {
402
+
403
+ static processAutoPlay(data: boolean | string | object, version: number) {
400
404
 
401
405
  if (!data) {
402
406
  return null
403
407
  }
404
408
 
405
- let outputData : boolean = false;
409
+ let outputData: boolean = false;
406
410
 
407
411
  if (version === 1) {
408
412
  return outputData;
@@ -423,7 +427,8 @@ export namespace LTPlayerConfigProcessor {
423
427
 
424
428
  return outputData;
425
429
  }
426
- static processPreload(data : object | null, version : number) {
430
+
431
+ static processPreload(data: object | null, version: number) {
427
432
 
428
433
  if (!data) {
429
434
  return null
@@ -433,8 +438,8 @@ export namespace LTPlayerConfigProcessor {
433
438
  return
434
439
  }
435
440
 
436
- type outputType = {start : number, stop : number, autoType : boolean, isActive : boolean};
437
- const setTimeRange = (config: defaultType, itemOutput : outputType) => {
441
+ type outputType = { start: number, stop: number, autoType: boolean, isActive: boolean };
442
+ const setTimeRange = (config: defaultType, itemOutput: outputType) => {
438
443
 
439
444
  if (config.start) {
440
445
 
@@ -471,7 +476,7 @@ export namespace LTPlayerConfigProcessor {
471
476
  return itemOutput;
472
477
  }
473
478
 
474
- const setPreloadType = (type: defaultType, itemOutput : outputType) => {
479
+ const setPreloadType = (type: defaultType, itemOutput: outputType) => {
475
480
 
476
481
  itemOutput.autoType = true;
477
482
 
@@ -491,18 +496,17 @@ export namespace LTPlayerConfigProcessor {
491
496
 
492
497
  }
493
498
 
494
- const setActive = (itemOutput : outputType) => {
499
+ const setActive = (itemOutput: outputType) => {
495
500
  itemOutput.isActive = true;
496
501
  return itemOutput
497
502
  }
498
503
 
499
504
 
500
-
501
- let itemOutput : outputType = {
502
- start : 0,
503
- stop : 10,
504
- isActive : false,
505
- autoType : false,
505
+ let itemOutput: outputType = {
506
+ start: 0,
507
+ stop: 10,
508
+ isActive: false,
509
+ autoType: false,
506
510
 
507
511
  };
508
512