@latest-thinking/lt-player 1.0.7 → 1.0.8

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.
Files changed (36) hide show
  1. package/dist/css/lt-player-main.css +1 -1
  2. package/dist/css/lt-player-main.css.map +1 -1
  3. package/dist/js/lt-player-main.js +1 -1
  4. package/dist/js/lt-player-main.js.map +1 -1
  5. package/package.json +2 -1
  6. package/src/assets/sass/abstracts/_mixins.scss +38 -0
  7. package/src/assets/sass/abstracts/_variables.scss +5 -0
  8. package/src/assets/sass/app.scss +22 -1
  9. package/src/assets/sass/components/_modal.scss +39 -24
  10. package/src/assets/sass/core/_player.scss +24 -2
  11. package/src/assets/sass/sections/_additional-info.scss +7 -0
  12. package/src/assets/sass/sections/_poster.scss +251 -177
  13. package/src/assets/sass/sections/_settings.scss +6 -4
  14. package/src/assets/sass/sections/_share.scss +2 -8
  15. package/src/assets/sass/sections/controllers/_botom.scss +1 -0
  16. package/src/components/LTPlayerHls.ts +10 -1
  17. package/src/components/LTPlayerSetup.ts +7 -0
  18. package/src/components/LTPlayerType.ts +6 -1
  19. package/src/components/addInfo/LTPlayerAddInfoDesktop.ts +43 -15
  20. package/src/components/addInfo/LTPlayerAddInfoMobile.ts +60 -57
  21. package/src/components/config/LTPlayerConfigProcessor.ts +1 -1
  22. package/src/components/controls/LTPlayerControlsEvents.ts +94 -59
  23. package/src/components/events/LTPlayerCommon.ts +0 -4
  24. package/src/components/events/LTPlayerDesktop.ts +3 -3
  25. package/src/components/events/LTPlayerMobile.ts +8 -10
  26. package/src/components/poster/LTPlayerPoster.ts +6 -1
  27. package/src/components/poster/LTPlayerPosterEvents.ts +41 -28
  28. package/src/components/share/LTPlayerShareDesktop.ts +14 -3
  29. package/src/index.ts +4 -9
  30. package/src/services/Helper.ts +27 -0
  31. package/src/services/ResizeService.ts +66 -36
  32. package/src/views/additionalInfo.handlebars +11 -1
  33. package/src/views/controls.handlebars +4 -4
  34. package/src/views/poster.handlebars +43 -10
  35. package/src/views/share.handlebars +2 -2
  36. package/src/views/template.handlebars +1 -1
@@ -1,242 +1,316 @@
1
1
  @import "../abstracts/variables";
2
- .lt-player__poster__image-body {
3
- position:absolute;
4
- width: 100%;
5
- height: 100%;
6
- z-index: 2;
7
- opacity: 1;
8
- transition: all 0.2s ease-in-out;
9
- }
10
-
11
- .lt-player__poster__image-body--preload {
12
- opacity: 0;
13
- transition: all 0.2s ease-in-out;
14
- }
15
- .lt-player__poster__img__set-default {
16
- position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
17
- }
18
- .lt-player__poster__background__grey {
19
- background-color: grey
20
- }
21
-
22
- .lt-player__poster__img--set-custom {
23
- object-fit: cover;
24
- width: 100%;
25
- height: 100%;
26
- }
27
-
28
- .lt-player-landscape--desktop {
29
- .plyr {
30
- .lt-player {
31
- &__poster {
32
- &__body {
33
- .content {
34
- &__header {
35
- padding: 32px;
36
- }
37
-
38
- &__body {
39
- padding: 0 32px;
40
- }
41
-
42
- &__footer {
43
- padding: 32px;
44
- }
45
- }
46
- }
47
- }
48
- }
49
- }
50
- }
51
-
52
- .lt-player-landscape--mobile,
53
- .lt-player-landscape--desktop {
54
- &.lt-player--landscape {
55
- &__xxs {
56
- .plyr {
57
- .lt-player {
58
- &__poster {
59
- &__body {
60
- .content {
61
- &__header {
62
- padding: 10px;
63
- }
64
-
65
- &__body {
66
- padding: 0 10px;
67
-
68
- .poster-paragraph {
69
- font-size: 16px;
70
- }
71
- }
72
-
73
- &__footer {
74
- padding: 15px 10px;
75
-
76
- .poster-buttons {
77
- button {
78
- @include buttons-sm;
79
- }
80
- }
81
- }
82
- }
83
- }
84
- }
85
- }
86
- }
87
- }
88
- }
89
- }
90
-
91
- .lt-player-portrate--mobile {
92
- &.lt-player--portrait {
93
- &__xs {
94
- .lt-player {
95
- &__poster {
96
- &__body {
97
- .content {
98
- &__body {
99
- .poster-paragraph {
100
- font-size: 16px;
101
- }
102
- }
103
-
104
- &__footer {
105
- .poster-buttons {
106
- .poster-button-play {
107
- @include buttons-xs;
108
- }
109
-
110
- .poster-button-watch-now {
111
- font-size: $lt-player-font-size-xs;
112
- }
113
- }
114
- }
115
- }
116
- }
117
- }
118
- }
119
- }
120
- }
121
- }
122
2
 
123
3
  .plyr {
124
- &__poster {
125
- background-size: cover !important;
126
- }
127
-
128
- .no-poster-image {
129
- background: black !important;
130
- }
131
-
132
4
  .lt-player {
133
-
134
5
  &__preload-hide {
135
- opacity: 0!important;
6
+ opacity: 0 !important;
136
7
  }
137
8
 
138
9
  &__poster {
139
- background: var(--plyr-video-controls-background,linear-gradient(transparent,rgba(0,0,0,.75)));
140
10
  position: absolute;
141
- color: $default-lt-player-white!important;
142
- top: 0;
143
- bottom: 0;
144
- left: 0;
145
- right: 0;
11
+ inset: 0;
12
+ color: $default-lt-player-white !important;
146
13
  z-index: $z_index_first;
147
14
 
148
- &__body {
15
+ &__image-body {
16
+ position:absolute;
149
17
  width: 100%;
150
18
  height: 100%;
151
- display: grid;
152
- position: absolute;
153
- z-index: 3;
19
+ z-index: 2;
20
+ opacity: 1;
21
+ transition: all 0.2s ease-in-out;
154
22
 
155
- .content {
156
- display: flex;
23
+ &--preload {
24
+ opacity: 0;
25
+ transition: all 0.2s ease-in-out;
26
+ }
27
+ }
28
+
29
+ &__img {
30
+ &--set-custom {
31
+ object-fit: cover;
157
32
  width: 100%;
158
- flex-direction: column;
159
- justify-content: space-between;
33
+ height: 100%;
34
+ }
35
+
36
+ &__set-default {
160
37
  position: absolute;
161
- bottom: 0;
38
+ top: 50%;
39
+ left: 50%;
40
+ transform: translate(-50%, -50%);
41
+ z-index: 10;
42
+ }
43
+ }
162
44
 
163
- &__header {
164
- padding: 24px;
45
+ &--background {
46
+ position: absolute;
47
+ inset: 0;
48
+ background-color: $default-lt-span-color;
49
+ z-index: -1;
50
+ }
165
51
 
166
- .poster-logo-header {
167
- display: flex;
168
- align-items: center;
52
+ &__body {
53
+ position: absolute;
54
+ width: 100%;
55
+ height: 100%;
56
+ z-index: 3;
169
57
 
170
- .poster-footer-text {
171
- font-size: $lt-player-font-size-base;
172
- margin: auto 0;
173
- font-weight: $lt-player-font-weight-sm;
174
- }
58
+ &:hover {
59
+ .poster-paragraph {
60
+ text-decoration: underline;
61
+ }
175
62
 
176
- .logo {
177
- display: flex;
63
+ .content__footer {
64
+ .poster-buttons {
65
+ .poster-button-play,
66
+ .poster-button-watch-now {
67
+ color: $default-lt-button-color;
68
+ background-color: darken($default_color_player, 10%);
178
69
  }
179
70
  }
180
71
  }
72
+ }
181
73
 
182
- &__body {
183
- margin-top: auto;
184
- padding: 0 24px;
74
+ .content {
75
+ position: relative;
76
+ display: flex;
77
+ flex-direction: column;
78
+ height: 100%;
79
+ z-index: 2;
80
+ cursor: pointer;
81
+
82
+ &__header {
83
+ padding: 25px 25px 0;
185
84
 
186
85
  .poster-title {
187
86
  @extend %line-clamp-3;
188
87
  @include line-clamp-3;
189
- color: $default-lt-player-white !important;
88
+ color: $default-lt-player-white;
190
89
  font-size: $lt-player-font-size-base;
191
90
  font-weight: $lt-player-font-weight-xs;
192
- margin: 0 0 8px;
91
+ margin: 0;
193
92
  }
93
+ }
94
+
95
+ &__body {
96
+ padding: 0 25px;
194
97
 
195
98
  .poster-paragraph {
196
99
  @extend %line-clamp-3;
197
100
  @include line-clamp-4;
198
101
  font-weight: $lt-player-font-weight-lg;
199
- font-size: $lt-player-font-size-xxl;
200
- margin: 0;
201
- color: $default-lt-player-white !important;
202
- display: block;
102
+ font-size: $lt-player-font-size-base;
103
+ line-height: $lt-player-line-height-default;
104
+ margin: 8px 0;
105
+ color: $default-lt-player-white;
106
+ width: 70%;
203
107
  }
204
108
  }
205
109
 
206
110
  &__footer {
207
- padding: 24px;
111
+ margin-top: auto;
112
+ padding: 0 25px 25px;
208
113
 
209
114
  .poster-buttons {
210
115
  display: flex;
211
- gap: 8px;
116
+ gap: 5px;
212
117
 
213
118
  .poster-button-play {
214
119
  @extend %lt-player-btn;
215
120
  @include yellow-btn;
216
- padding: 12px 12px;
121
+ @include buttons-xxs;
122
+ font-size: $lt-player-font-size-xs;
217
123
  }
218
124
 
219
125
  .poster-button-watch-now {
220
126
  @extend %lt-player-btn;
221
127
  @include yellow-btn;
222
- padding: 8px 16px;
128
+ @include buttons-xs;
129
+ padding: 0 16px;
130
+ font-size: $lt-player-font-size-xs;
131
+ font-weight: $lt-player-font-weight-xl;
223
132
  }
224
133
 
225
134
  .poster-lt-player-share {
226
135
  @extend %lt-player-btn;
227
- background-color: $default-lt-button-other;
136
+ @include gray-btn;
137
+ @include buttons-xxs;
228
138
  margin-left: auto;
229
- padding: 12px 12px;
230
139
  }
231
140
  }
232
141
  }
233
142
  }
143
+ }
144
+ }
145
+ }
146
+ }
147
+
148
+ .lt-player-orientation--portrait {
149
+ .plyr {
150
+ .lt-player {
151
+ &__poster {
152
+ &__img {
153
+ &--set-custom {
154
+ // Delete this after review
155
+ object-position: 90% 50%;
156
+ }
157
+ }
158
+
159
+ &__body {
160
+ .content {
161
+ &__header {
162
+ .poster-title {
163
+ font-size: $lt-player-font-size-base;
164
+ font-weight: $lt-player-font-weight-md;
165
+ }
166
+ }
167
+
168
+ &__body {
169
+ margin-top: auto;
170
+
171
+ .poster-paragraph {
172
+ font-size: $lt-player-font-size-xxl;
173
+ line-height: $lt-player-line-height-default;
174
+ margin-top: 12px;
175
+ margin-bottom: 20px;
176
+ width: 100%;
177
+ text-decoration: underline;
178
+ }
179
+ }
180
+
181
+ &__footer {
182
+ margin-top: unset;
183
+
184
+ .poster-buttons {
185
+ .poster-button-play,
186
+ .poster-button-watch-now,
187
+ .poster-lt-player-share {
188
+ @include buttons-normal;
189
+ font-size: $lt-player-font-size-lg;
190
+ font-weight: $lt-player-font-weight-lg;
191
+ }
192
+
193
+ .poster-button-watch-now {
194
+ padding: 6px 16px;
195
+ }
196
+ }
197
+ }
198
+ }
199
+ }
200
+ }
201
+ }
202
+ }
203
+ }
204
+
205
+ @container landscape (width > 375px) {
206
+ .lt-player-orientation--landscape {
207
+ .lt-player {
208
+ &__poster {
209
+ &__body {
210
+ .content {
211
+ &__body {
212
+ .poster-paragraph {
213
+ width: 50%;
214
+ }
215
+ }
216
+ }
217
+ }
218
+ }
219
+ }
220
+ }
221
+ }
222
+
223
+ @container landscape (width > 479px) {
224
+ .lt-player-orientation--landscape {
225
+ .lt-player {
226
+ &__poster {
227
+ &__body {
228
+ .content {
229
+ &__header {
230
+ padding: 25px 50px 0;
231
+
232
+ .poster-title {
233
+ font-weight: $lt-player-font-weight-xl;
234
+ }
235
+ }
236
+
237
+ &__body {
238
+ padding: 0 50px;
239
+
240
+ .poster-paragraph {
241
+ font-size: $lt-player-font-size-xl;
242
+ margin: 25px 0 8px;
243
+ width: 60%;
244
+ }
245
+ }
234
246
 
235
- .custom-poster-text {
236
- left: 5.62%;
237
- right: 5.62%;
238
- top: 73.5%;
239
- bottom: 22.71%;
247
+ &__footer {
248
+ padding: 0 50px 25px;
249
+ }
250
+ }
251
+ }
252
+ }
253
+ }
254
+ }
255
+ }
256
+
257
+ @container landscape (width > 639px) {
258
+ .lt-player-orientation--landscape {
259
+ .lt-player {
260
+ &__poster {
261
+ &__body {
262
+ .content {
263
+ &__header {
264
+ padding: 50px 50px 0;
265
+ }
266
+
267
+ &__body {
268
+ .poster-paragraph {
269
+ font-size: $lg-player-font-size-xxl3;
270
+ margin: 25px 0 8px;
271
+ width: 60%;
272
+ }
273
+ }
274
+
275
+ &__footer {
276
+ padding: 50px;
277
+
278
+ .poster-buttons {
279
+ .poster-button-play {
280
+ @include buttons-normal;
281
+ }
282
+
283
+ .poster-button-watch-now {
284
+ @include buttons-normal;
285
+ padding: 0 16px;
286
+ font-size: $lt-player-font-size-base;
287
+ }
288
+
289
+ .poster-lt-player-share {
290
+ @include buttons-normal;
291
+ }
292
+ }
293
+ }
294
+ }
295
+ }
296
+ }
297
+ }
298
+ }
299
+ }
300
+
301
+ @container landscape (width > 759px) {
302
+ .lt-player-orientation--landscape {
303
+ .lt-player {
304
+ &__poster {
305
+ &__body {
306
+ .content {
307
+ &__body {
308
+ .poster-paragraph {
309
+ font-size: $lt-player-font-size-xxxl3;
310
+ width: 60%;
311
+ }
312
+ }
313
+ }
240
314
  }
241
315
  }
242
316
  }
@@ -24,7 +24,6 @@
24
24
  }
25
25
 
26
26
  .settings-controllers-enable {
27
- transition:.3s;
28
27
  position: absolute;
29
28
  width: 100%;
30
29
  z-index: 30;
@@ -257,8 +256,9 @@
257
256
  background: $default-lt-player-white;
258
257
  border-radius: 0 0 0 30px;
259
258
  padding: 0 0 32px 0;
260
- bottom: -200%;
261
- transition:.3s;
259
+ bottom: 0;
260
+ opacity: 0;
261
+
262
262
 
263
263
  .line-button {
264
264
  @extend %line-button;
@@ -273,7 +273,6 @@
273
273
  }
274
274
 
275
275
  .settings-controllers-enable {
276
- transition:.3s;
277
276
  position: absolute;
278
277
  width: 100%;
279
278
  z-index: 30;
@@ -281,9 +280,11 @@
281
280
  background: $default-lt-player-white;
282
281
  border-radius: 0 0 0 30px;
283
282
  bottom: 0;
283
+ opacity: 1;
284
284
  display: flex;
285
285
  flex-direction: column;
286
286
  padding: 0 0 24px 0;
287
+ border: 1px solid $default-lt-span-color;
287
288
 
288
289
  &__speed-range {
289
290
  padding: 24px 24px 0 24px;
@@ -513,6 +514,7 @@
513
514
  transition: none;
514
515
  width: 100%;
515
516
  border-radius: 0;
517
+ border: none;
516
518
 
517
519
  &__subtitles {
518
520
  padding: 16px 24px 24px;
@@ -108,9 +108,9 @@
108
108
  a {
109
109
  padding: 0;
110
110
 
111
- &:first-child {
111
+ &:hover {
112
112
  .share-icon__icon {
113
- background: $default_color_player;
113
+ background-color: $default_color_player;
114
114
  }
115
115
  }
116
116
 
@@ -234,12 +234,6 @@
234
234
  a {
235
235
  padding: 0;
236
236
 
237
- &:first-child {
238
- .share-icon__icon {
239
- background: $default_color_player;
240
- }
241
- }
242
-
243
237
  .share-icon__icon {
244
238
  @extend %center-elements;
245
239
  width: 32px;
@@ -96,6 +96,7 @@
96
96
  bottom: 0;
97
97
  height: 40%;
98
98
  background: var(--plyr-video-controls-background,linear-gradient(transparent,rgba(0,0,0,.75)));
99
+ border-radius: 0 0 0 30px;
99
100
  }
100
101
 
101
102
  &__volume_control {
@@ -14,7 +14,16 @@ export class LTPlayerHls {
14
14
  this.instance = instance;
15
15
  this.config = instance.playerConfig;
16
16
  this.playerSettings = playerSettings;
17
- this.hlsInstance = new Hls();
17
+ this.hlsInstance = new Hls({
18
+ "enableWorker": true,
19
+ "lowLatencyMode": true,
20
+ "backBufferLength": 20,
21
+ "abrEwmaFastVoD": 1,
22
+ "autoStartLoad": true,
23
+ "abrBandWidthUpFactor": 0.95,
24
+ "maxMaxBufferLength": 15,
25
+ "abrEwmaDefaultEstimate": 50
26
+ });
18
27
  }
19
28
 
20
29
  init() {
@@ -180,6 +180,13 @@ export class LTPlayerSetup {
180
180
  const processVideo = () => {
181
181
  let videoTag = document.createElement('video');
182
182
  videoTag.src = url;
183
+
184
+ if (url.includes('.m3u8')) {
185
+ return new Promise((resolve) => {
186
+ resolve('portrait')
187
+ })
188
+ }
189
+
183
190
  return new Promise((resolve) => {
184
191
  videoTag.addEventListener( "loadedmetadata", function (e) {
185
192
  if (this.videoWidth > this.videoHeight) {
@@ -1,6 +1,6 @@
1
1
  import {LTPlayerController} from "../global/controllers/LTPlayerController";
2
2
  import {TypeInterface} from "../global/interfaces/TypeInterface";
3
- import {defaultType, playerConfigType} from "../global/types/ModuleTypes";
3
+ import {defaultType, playerConfigType, plyr} from "../global/types/ModuleTypes";
4
4
  import {LTPlayerMini} from "./controls/LTPlayerMini";
5
5
  import {LTPlayerConfig} from "./config/LTPlayerConfig";
6
6
  import Plyr from "plyr";
@@ -18,6 +18,8 @@ export namespace LTPlayer {
18
18
  */
19
19
  export class PortraitType extends LTPlayerController implements TypeInterface {
20
20
 
21
+ pausedPlayer: Plyr;
22
+
21
23
  /**
22
24
  * Create a new Player instance root element
23
25
  * @returns never
@@ -195,6 +197,9 @@ export namespace LTPlayer {
195
197
 
196
198
 
197
199
  export class LandscapeType extends LTPlayerController implements TypeInterface {
200
+
201
+ pausedPlayer: Plyr;
202
+
198
203
  /**
199
204
  * Create a new Video Player root element
200
205
  * @returns never