@latest-thinking/lt-player 1.0.5-e → 1.0.5-g

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.0.5-e",
3
+ "version": "1.0.5-g",
4
4
  "description": "LT player.",
5
5
  "main": "dist/js/lt-player-main.js",
6
6
  "module": "dist/js/lt-player-main.js",
@@ -50,7 +50,7 @@
50
50
  justify-content: flex-end;
51
51
  gap: 1rem;
52
52
  background: transparent;
53
- padding-bottom: 1rem;
53
+ padding-bottom: 0;
54
54
 
55
55
  button {
56
56
  @extend %lt-player-btn;
@@ -23,8 +23,9 @@
23
23
 
24
24
  &__left-buttons {
25
25
  margin-right: auto;
26
- display: grid;
26
+ display: flex;
27
27
  grid-template-columns: 1fr 1fr;
28
+ flex: 1;
28
29
  }
29
30
 
30
31
  &__center-buttons {
@@ -33,9 +34,9 @@
33
34
 
34
35
  &__right-buttons {
35
36
  margin-left: auto;
36
- display: grid;
37
- grid-template-columns: 1fr 1fr;
38
- direction: rtl;
37
+ display: flex;
38
+ flex: 1;
39
+ justify-content: end;
39
40
  }
40
41
 
41
42
  &__previous-chapter-view-wrapper,
@@ -216,13 +217,13 @@
216
217
 
217
218
  .plyr {
218
219
  &__progress {
219
- top: -75px;
220
220
  z-index: 9;
221
221
 
222
222
  &--wrapper {
223
- position: relative;
224
223
  width: 100%;
225
224
  padding: 0 2rem;
225
+ position: absolute;
226
+ bottom: 6rem;
226
227
  }
227
228
  }
228
229
 
@@ -289,7 +290,6 @@
289
290
  &__current {
290
291
  display: flex;
291
292
  justify-content: space-between;
292
- margin-bottom: 2rem;
293
293
  margin-left: -0.5rem;
294
294
  margin-right: -0.5rem;
295
295
 
@@ -320,52 +320,52 @@
320
320
  min-width: 80px;
321
321
  width: 20%;
322
322
 
323
- .volume_control__background__area__range {
324
- color: $default-lt-button-color !important;
325
- min-width: 8rem;
326
- -webkit-appearance: none;
327
- appearance: none;
328
- background: transparent;
329
- cursor: pointer;
330
- }
331
-
332
- .volume_control__background__area__range::-webkit-slider-runnable-track {
333
- @extend %input-range--webkit-slider-runnable-track;
334
- }
335
-
336
- .volume_control__background__area__range::-moz-range-track {
337
- @extend %input-range--moz-range-track;
338
- }
339
-
340
- .volume_control__background__area__range::-ms-track {
341
- @extend %input-range--ms-track;
342
- }
343
-
344
- .volume_control__background__area__range::-webkit-slider-thumb {
345
- @extend %input-range--webkit-slider-thumb;
346
- border-color: $default-lt-player-black;
347
- background: $default-lt-player-white;
348
- }
349
-
350
- .volume_control__background__area__range::-moz-range-thumb {
351
- @extend %input-range--moz-range-thumb;
352
- border-color: $default-lt-player-black;
353
- background: $default-lt-player-white;
354
- }
355
-
356
- .volume_control__background__area__range::-ms-thumb {
357
- @extend %input-range--ms-thumb;
358
- margin-top: 3px;
359
- border: 7px solid black;
360
- height: 20px;
361
- width: 20px;
362
- background: $default-lt-player-white;
363
- cursor: pointer;
364
- }
365
-
366
- .volume_control__background__area__range::-moz-range-progress {
367
- @extend %input-range--moz-range-progress;
368
- }
323
+ .volume_control__background__area__range {
324
+ color: $default-lt-button-color !important;
325
+ min-width: 8rem;
326
+ -webkit-appearance: none;
327
+ appearance: none;
328
+ background: transparent;
329
+ cursor: pointer;
330
+ }
331
+
332
+ .volume_control__background__area__range::-webkit-slider-runnable-track {
333
+ @extend %input-range--webkit-slider-runnable-track;
334
+ }
335
+
336
+ .volume_control__background__area__range::-moz-range-track {
337
+ @extend %input-range--moz-range-track;
338
+ }
339
+
340
+ .volume_control__background__area__range::-ms-track {
341
+ @extend %input-range--ms-track;
342
+ }
343
+
344
+ .volume_control__background__area__range::-webkit-slider-thumb {
345
+ @extend %input-range--webkit-slider-thumb;
346
+ border-color: $default-lt-player-black;
347
+ background: $default-lt-player-white;
348
+ }
349
+
350
+ .volume_control__background__area__range::-moz-range-thumb {
351
+ @extend %input-range--moz-range-thumb;
352
+ border-color: $default-lt-player-black;
353
+ background: $default-lt-player-white;
354
+ }
355
+
356
+ .volume_control__background__area__range::-ms-thumb {
357
+ @extend %input-range--ms-thumb;
358
+ margin-top: 3px;
359
+ border: 7px solid black;
360
+ height: 20px;
361
+ width: 20px;
362
+ background: $default-lt-player-white;
363
+ cursor: pointer;
364
+ }
365
+
366
+ .volume_control__background__area__range::-moz-range-progress {
367
+ @extend %input-range--moz-range-progress;
368
+ }
369
369
  }
370
370
 
371
371
  .volume_control__volume-button-close {
@@ -37,11 +37,14 @@
37
37
  width: 100%;
38
38
  height: 100%;
39
39
  display: flex;
40
- position: relative;
40
+
41
+ &.portrait {
42
+ position: relative;
43
+ }
41
44
 
42
45
  &__notification-button-state {
43
46
  position: absolute;
44
- top: 40%;
47
+ top: 50%;
45
48
  left: 50%;
46
49
  transform: translate(-50%, -50%);
47
50
 
@@ -63,16 +66,16 @@
63
66
 
64
67
  .lt-player-video-content {
65
68
  position: absolute;
66
- bottom: 5rem;
69
+ bottom: 9rem;
67
70
  text-align: left;
68
71
  display: flex;
69
72
  padding: 0 1.5rem;
70
73
  width: 100%;
71
- justify-content: space-between;
74
+ user-select: none;
75
+ align-items: end;
72
76
 
73
77
  .content__body {
74
78
  z-index: 2;
75
- margin-top: auto;
76
79
  width: 100%;
77
80
  }
78
81
 
@@ -87,9 +90,6 @@
87
90
  }
88
91
 
89
92
  .poster-paragraph {
90
-
91
- margin-bottom: 3rem;
92
-
93
93
  &__content {
94
94
  display: -webkit-box;
95
95
  -webkit-line-clamp: 2;
@@ -123,30 +123,29 @@
123
123
  color: white;
124
124
  cursor: pointer;
125
125
  position: absolute;
126
- bottom: 6rem;
126
+ bottom: 9rem;
127
127
  right: 6rem;
128
128
  z-index: 8;
129
129
  }
130
130
 
131
-
132
- .lt-player-rewind-area {
131
+ .lt-player-rewind-area,
132
+ .lt-player-forward-area {
133
133
  touch-action: inherit!important;
134
134
  width: 100%;
135
135
  height: 100%;
136
- z-index: 3;
136
+ z-index: 4;
137
137
  }
138
138
 
139
- .lt-player-rewind {
139
+ .lt-player-rewind,
140
+ .lt-player-forward {
140
141
  width: 50%;
141
- height: 130%;
142
- top: -10rem;
143
- display:flex;
144
- flex-direction: row;
142
+ top: 10%;
143
+ display: flex;
145
144
  position: absolute;
146
145
  text-align: center;
147
- border-radius:0 100% 100% 0;
148
- left: 0;
149
-
146
+ border-radius: 100% 0 0 100%;
147
+ height: unset;
148
+ bottom: 10%;
150
149
 
151
150
  &__icon-wrapper {
152
151
  display: flex;
@@ -164,83 +163,48 @@
164
163
 
165
164
  &__icon {
166
165
  display: flex;
167
- justify-content:flex-start;
168
- align-items:center;
169
-
166
+ justify-content: flex-start;
167
+ align-items: center;
170
168
  color: rgba(255,255,255, 1);
171
169
  user-select: none;
172
-
173
- &__portrait {
174
- margin: auto auto 18rem 3rem;
175
- }
176
-
177
- &__landscape {
178
- margin: auto auto 13rem 4rem;
179
- }
180
170
  }
181
171
 
182
172
  span {
183
173
  font-size: 12px;
184
174
  user-select: none;
185
175
  }
186
-
187
176
  }
188
177
 
189
- .lt-player-forward-area {
190
- touch-action: inherit!important;
191
- width: 100%;
192
- height: 100%;
193
- z-index: 4;
194
- }
195
-
196
- .lt-player-forward {
197
- width: 50%;
198
- height: 130%;
199
- top: -10rem;
200
- display:flex;
201
- flex-direction: row;
202
- position: absolute;
203
- text-align: center;
204
- border-radius:100% 0 0 100%;
205
- right: 0;
178
+ .lt-player-rewind {
179
+ left: 0;
206
180
 
207
- &__icon-wrapper {
208
- display: flex;
209
- padding: 0 .5rem;
181
+ &__icon {
182
+ flex-direction: row-reverse;
210
183
 
211
- &.rotate {
212
- rotate: 180deg;
184
+ &__portrait {
185
+ margin: auto auto auto 3rem;
213
186
  }
214
187
 
215
- img {
216
- max-width: 20px;
188
+ &__landscape {
189
+ margin: auto auto auto 4rem;
217
190
  }
218
191
  }
192
+ }
219
193
 
220
- &__icon {
221
- display: flex;
222
- justify-content:flex-start;
223
- align-items:center;
224
-
225
- color: rgba(255,255,255, 1);
194
+ .lt-player-forward {
195
+ right: 0;
226
196
 
197
+ &__icon {
227
198
  &__portrait {
228
- margin: auto 3rem 18rem auto;
199
+ margin: auto 3rem auto auto;
229
200
  }
230
201
 
231
202
  &__landscape {
232
- margin: auto 4rem 13rem auto;
203
+ margin: auto 4rem auto auto;
233
204
  }
234
-
235
205
  }
236
-
237
- span{
238
- font-size:12px;
239
- }
240
-
241
206
  }
242
207
 
243
-
244
208
  .lt-player-notify {
245
209
  transition: background 0.8s;
246
210
  //background: rgba(200,200,200,.4) radial-gradient(circle, transparent 1%, rgba(200,200,200,.4) 1%) center/15000%;
@@ -43,10 +43,10 @@
43
43
  &__controls-enable,
44
44
  &__controls-enable-settings {
45
45
  .top-controllers {
46
- z-index: 10;
47
46
  width: 100%;
48
- height: 29%;
49
47
  padding: 1.5rem 1.5rem 0 1.5rem;
48
+ position: absolute;
49
+
50
50
  button {
51
51
  @extend %lt-player-btn;
52
52
  @include dark-btn;
@@ -66,11 +66,16 @@
66
66
  display: flex;
67
67
  justify-content: space-between;
68
68
 
69
- &__left {
69
+ &__left,
70
+ &__right {
70
71
  display: flex;
71
72
  flex-direction: column;
73
+ flex: 0 0 12%;
74
+ z-index: 5;
75
+ }
76
+
77
+ &__left {
72
78
  align-items: flex-start;
73
- flex: 0 0 20%
74
79
  }
75
80
 
76
81
  &__center {
@@ -78,10 +83,7 @@
78
83
  }
79
84
 
80
85
  &__right {
81
- display: flex;
82
- flex-direction: column;
83
86
  align-items: end;
84
- flex: 0 0 20%
85
87
  }
86
88
 
87
89
  &__center {
@@ -159,4 +161,4 @@
159
161
  // }
160
162
  //
161
163
  //}
162
- }
164
+ }
@@ -85,6 +85,7 @@ export class LTPlayerSetup {
85
85
  if (checkVersion(playerConfig.version)) {
86
86
  return new Promise((resolve, reject) => {
87
87
  playerConfig.body.playerType = 2;
88
+
88
89
  resolve(this.setType(playerConfig, playerContainer));
89
90
  reject(null);
90
91
  });
@@ -39,7 +39,6 @@ export namespace LTPlayer {
39
39
  this.additionalInfoService = additionalInfoService;
40
40
  this.miniPlayer = new LTPlayerMini();
41
41
  this.setPlayerConfig(configData.body, configData.version);
42
- this.initSetupPlayerPoster(configData.body);
43
42
  this.initPlayer();
44
43
  this.setEvents();
45
44
 
@@ -50,14 +49,6 @@ export namespace LTPlayer {
50
49
  setEvents() {
51
50
  this.eventInstance = new LTPlayerEventsManager(this);
52
51
  }
53
-
54
- private initSetupPlayerPoster(configData: defaultType) {
55
- const playerContainer = configData.playerContainer;
56
- playerContainer.classList.add('d-none')
57
- const logo: string = this.iconService.getLogo();
58
- playerContainer.insertAdjacentHTML("afterend", this.templateService.getOnloadPoster({logo: logo})) ;
59
- }
60
-
61
52
  setDesktopEvents() {
62
53
  this.desktopEvents = new LTPlayerEvents.Desktop();
63
54
  }
@@ -130,18 +121,20 @@ export namespace LTPlayer {
130
121
 
131
122
  const player = new Plyr(element, playerSettings)
132
123
 
124
+ this.windowService.init(this);
125
+
126
+ this.plyr = player;
127
+
128
+ this.posterManager.init(this);
129
+
133
130
  const chapters = this.playerConfig.getChapters();
134
131
 
135
132
  if (chapters) {
136
133
  this.playerControl.initChapters(this.playerConfig.getChapters());
137
134
  }
138
135
 
139
- this.plyr = player;
140
-
141
136
  this.devMethodePlayer = new LTPlayerDevMethode.Player(this);
142
137
 
143
- this.posterManager.init(this);
144
-
145
138
  if (this.playerConfig.getShareData()) {
146
139
  this.share.init(this);
147
140
  }
@@ -217,7 +210,6 @@ export namespace LTPlayer {
217
210
 
218
211
  this.miniPlayer = new LTPlayerMini();
219
212
  this.setPlayerConfig(configData.body, configData.version);
220
- this.initPoster(configData.body);
221
213
  this.initPlayer();
222
214
  this.setEvents();
223
215
 
@@ -256,18 +248,20 @@ export namespace LTPlayer {
256
248
 
257
249
  const player = new Plyr(element, playerSettings);
258
250
 
251
+ this.windowService.init(this);
252
+
253
+ this.plyr = player;
254
+
255
+ this.posterManager.init(this);
256
+
259
257
  const chapters = this.playerConfig.getChapters();
260
258
 
261
259
  if (chapters) {
262
260
  this.playerControl.initChapters(this.playerConfig.getChapters());
263
261
  }
264
262
 
265
- this.plyr = player;
266
-
267
263
  this.devMethodePlayer = new LTPlayerDevMethode.Player(this);
268
264
 
269
- this.posterManager.init(this);
270
-
271
265
  if (this.playerConfig.getShareData()) {
272
266
  this.share.init(this);
273
267
  }
@@ -286,13 +280,6 @@ export namespace LTPlayer {
286
280
  playerContainer.innerHTML = this.templateService.getTemplateByType(config);
287
281
  }
288
282
 
289
- initPoster(configData: defaultType) {
290
- const playerContainer = configData.playerContainer;
291
- playerContainer.classList.add('d-none')
292
- const logo: string = this.iconService.getLogo();
293
- playerContainer.insertAdjacentHTML("afterend", this.templateService.getOnloadPoster({logo: logo})) ;
294
- }
295
-
296
283
  private setPlayerConfig(configData: playerConfigType, version: string | number) {
297
284
  this.playerConfig = new LTPlayerConfig(version);
298
285
  this.playerConfig.mapConfigData(configData);
@@ -200,7 +200,7 @@ export namespace LTPlayerControlsEvents {
200
200
 
201
201
 
202
202
  controls.addEventListener('mouseleave', function () {
203
- // controls.classList.remove('plyr__controls-enable')
203
+ controls.classList.remove('plyr__controls-enable')
204
204
  })
205
205
  }
206
206
 
@@ -112,7 +112,7 @@ export class LTPlayerCommon {
112
112
  //set share button
113
113
  this.player.share.events.desktop.init(this.player);
114
114
 
115
- this.player.windowService.init(this.player);
115
+ // this.player.windowService.init(this.player);
116
116
  //set poster
117
117
  this.player.posterManager.mobileEvents.onload(this.player);
118
118
 
@@ -5,6 +5,7 @@ import {plyr} from "../../global/types/ModuleTypes";
5
5
  import {LTPlayerEventsManager} from "../LTPlayerEventsManager";
6
6
  import {LTPlayerCommon} from "./LTPlayerCommon";
7
7
  import {EventsInterfaces} from "../../global/interfaces/EventsInterfaces";
8
+ import {LoaderService} from "../../services/LoaderService";
8
9
 
9
10
  export class LTPlayerDesktop extends LTPlayerCommon implements EventsInterfaces {
10
11
  setup(eventManager: LTPlayerEventsManager) {
@@ -23,6 +24,33 @@ export class LTPlayerDesktop extends LTPlayerCommon implements EventsInterfaces
23
24
  this.plyrTimeUpdate();
24
25
  this.plyrOnPlay();
25
26
  this.plyrOnPause();
27
+ this.plyrOnSeek();
28
+ this.plyrOnPlaying();
29
+ }
30
+
31
+ plyrOnSeek():void {
32
+ let eventManager = this;
33
+ let instance: LTPlayer.PortraitType | LTPlayer.LandscapeType = this.player;
34
+ let plyr: Plyr = this.plyr;
35
+
36
+ plyr.on('seeked', function LTPlayerSeek(){
37
+ if (plyr.isEmbed) {
38
+ let playerContainer = instance.plyr.elements.container;
39
+ playerContainer.querySelector(`.lt-player__poster`).insertAdjacentHTML('afterend', LoaderService.getSpinner());
40
+ }
41
+ })
42
+ }
43
+
44
+ plyrOnPlaying(): void {
45
+ let eventManager = this;
46
+ let instance: LTPlayer.PortraitType | LTPlayer.LandscapeType = this.player;
47
+ let plyr: Plyr = this.plyr;
48
+
49
+ plyr.on('playing', function LTPlayerSeek(){
50
+ plyr.embed.play().then (function LTPlayerEmbedPlay() {
51
+ LoaderService.removeSpinner(plyr.elements.container)
52
+ })
53
+ })
26
54
  }
27
55
 
28
56
 
@@ -148,6 +176,7 @@ export class LTPlayerDesktop extends LTPlayerCommon implements EventsInterfaces
148
176
  if (instance.playerConfig.getPreload().isActive) {
149
177
  common.preloadPoster.timeUpdate(instance, 'event');
150
178
  }
179
+ LoaderService.removeSpinner(plyr.elements.container)
151
180
  instance.playerControl.desktopEvents.playPauseIcon(instance, 'timeupdate');
152
181
  })
153
182
  }
@@ -155,7 +184,6 @@ export class LTPlayerDesktop extends LTPlayerCommon implements EventsInterfaces
155
184
  plyrOnPlay() {
156
185
  let instance: LTPlayer.PortraitType | LTPlayer.LandscapeType = this.player;
157
186
  let plyr: Plyr = this.plyr;
158
-
159
187
  plyr.on('play', function LTPlayerDesktopTimeUpdate(event) {
160
188
  instance.playerControl.desktopEvents.playPauseIcon(instance, 'timeupdate');
161
189
  })
@@ -4,6 +4,7 @@ import {EventsInterfaces} from "../../global/interfaces/EventsInterfaces";
4
4
  import {LTPlayer} from "../LTPlayerType";
5
5
  import Plyr from "plyr";
6
6
  import {plyr} from "../../global/types/ModuleTypes";
7
+ import {LoaderService} from "../../services/LoaderService";
7
8
 
8
9
  export class LTPlayerMobile extends LTPlayerCommon implements EventsInterfaces {
9
10
 
@@ -23,6 +24,33 @@ export class LTPlayerMobile extends LTPlayerCommon implements EventsInterfaces {
23
24
  this.plyrTimeUpdate();
24
25
  this.plyrOnPlay();
25
26
  this.plyrOnPause();
27
+ this.plyrOnSeek();
28
+ this.plyrOnPlaying();
29
+ }
30
+
31
+ plyrOnSeek():void {
32
+ let eventManager = this;
33
+ let instance: LTPlayer.PortraitType | LTPlayer.LandscapeType = this.player;
34
+ let plyr: Plyr = this.plyr;
35
+
36
+ plyr.on('seeked', function LTPlayerSeek(){
37
+ if (plyr.isEmbed) {
38
+ let playerContainer = instance.plyr.elements.container;
39
+ playerContainer.querySelector(`.lt-player__poster`).insertAdjacentHTML('afterend', LoaderService.getSpinner());
40
+ }
41
+ })
42
+ }
43
+
44
+ plyrOnPlaying(): void {
45
+ let eventManager = this;
46
+ let instance: LTPlayer.PortraitType | LTPlayer.LandscapeType = this.player;
47
+ let plyr: Plyr = this.plyr;
48
+
49
+ plyr.on('playing', function LTPlayerSeek(){
50
+ plyr.embed.play().then (function LTPlayerEmbedPlay() {
51
+ LoaderService.removeSpinner(plyr.elements.container)
52
+ })
53
+ })
26
54
  }
27
55
 
28
56
  plyrOnReady(): void {
@@ -128,6 +156,7 @@ export class LTPlayerMobile extends LTPlayerCommon implements EventsInterfaces {
128
156
  if (instance.playerConfig.getPreload().isActive) {
129
157
  eventManager.preloadPoster.timeUpdate(instance, 'event');
130
158
  }
159
+ LoaderService.removeSpinner(plyr.elements.container)
131
160
 
132
161
  eventManager.timeUpdate(event);
133
162
  instance.playerControl.desktopEvents.playPauseIcon(instance, 'timeupdate');