@latest-thinking/lt-player 1.1.0-u → 1.1.0-x

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-u",
3
+ "version": "1.1.0-x",
4
4
  "description": "LT player.",
5
5
  "main": "dist/js/lt-player-main.js",
6
6
  "module": "dist/js/lt-player-main.js",
@@ -2,7 +2,7 @@
2
2
  position: absolute;
3
3
  top: $top;
4
4
  left: $top;
5
- transform: translate(-#{$top}, -#{$top});
5
+ translate: -#{$top} -#{$top};
6
6
  }
7
7
 
8
8
  @mixin flex-position($flex, $content, $align) {
@@ -35,6 +35,10 @@ body {
35
35
  .lt-player {
36
36
  display: flex;
37
37
  width: 100%;
38
+
39
+ .plyr--video {
40
+ background: transparent;
41
+ }
38
42
  }
39
43
 
40
44
  .lt-player-orientation {
@@ -47,6 +51,14 @@ body {
47
51
  }
48
52
  }
49
53
 
54
+ .lt-player:has(.plyr--fullscreen-fallback) {
55
+ container-type: normal;
56
+
57
+ .plyr--video {
58
+ background: black;
59
+ }
60
+ }
61
+
50
62
  .invisible {
51
63
  visibility: hidden;
52
64
  }
@@ -15,43 +15,44 @@
15
15
  }
16
16
 
17
17
  .loader {
18
+ --_loader-dimensions: 80px;
19
+
18
20
  @include center-position(50%, 50%);
19
21
  display: none;
20
- width: 80px;
21
- height: 80px;
22
+ width: var(--_loader-dimensions);
23
+ height: var(--_loader-dimensions);
22
24
 
23
25
  &__backdrop {
24
26
  position: absolute;
25
27
  inset: 0;
26
28
  display: none;
27
29
  z-index: 2;
28
- background-color: rgb(0,0,0,0.2);
30
+ background-color: rgb(0, 0, 0, 0.2);
29
31
  }
30
- }
31
32
 
32
- .loader div {
33
- box-sizing: border-box;
34
- display: block;
35
- position: absolute;
36
- width: 64px;
37
- height: 64px;
38
- margin: 8px;
39
- border: 8px solid $default-lt-player-white;
40
- border-radius: 50%;
41
- animation: rotate 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
42
- border-color: $default-lt-player-white transparent transparent transparent;
43
- }
33
+ div {
34
+ position: absolute;
35
+ display: block;
36
+ width: calc((var(--_loader-dimensions) / 10) * 8);
37
+ height: calc((var(--_loader-dimensions) / 10) * 8);
38
+ margin: 8px;
39
+ border: 8px solid $default-lt-player-white;
40
+ border-radius: 50%;
41
+ animation: rotate 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
42
+ border-color: $default-lt-player-white transparent transparent transparent;
44
43
 
45
- .loader div:nth-child(1) {
46
- animation-delay: -0.45s;
47
- }
44
+ &:nth-child(1) {
45
+ animation-delay: -0.45s;
46
+ }
48
47
 
49
- .loader div:nth-child(2) {
50
- animation-delay: -0.3s;
51
- }
48
+ &:nth-child(2) {
49
+ animation-delay: -0.3s;
50
+ }
52
51
 
53
- .loader div:nth-child(3) {
54
- animation-delay: -0.15s;
52
+ &:nth-child(3) {
53
+ animation-delay: -0.15s;
54
+ }
55
+ }
55
56
  }
56
57
 
57
58
  @keyframes rotate {
@@ -68,3 +69,119 @@
68
69
  top: 35%;
69
70
  }
70
71
  }
72
+
73
+ .lt-player-orientation--landscape {
74
+ .loader {
75
+ --_loader-dimensions: 40px;
76
+ }
77
+
78
+ &.lt-state-loader-active {
79
+ &.lt-state-captions-enabled {
80
+ .loader {
81
+ --_top-positon: 40%;
82
+ top: var(--_top-positon);
83
+ translate: -50% calc(var(--_top-positon) * -1);
84
+ }
85
+ }
86
+
87
+ &:not(&.lt-state-captions-enabled) {
88
+ .loader {
89
+ --_top-positon: 30%;
90
+ top: var(--_top-positon);
91
+ translate: -50% calc(var(--_top-positon) * -1);
92
+ }
93
+ }
94
+ }
95
+ }
96
+
97
+ @container landscape (width > 479px) {
98
+ .lt-player-orientation--landscape {
99
+ .loader {
100
+ --_loader-dimensions: 80px;
101
+ }
102
+
103
+ &.lt-state-loader-active {
104
+ &.lt-state-captions-enabled {
105
+ .loader {
106
+ --_top-positon: 35%;
107
+ top: var(--_top-positon);
108
+ translate: -50% calc(var(--_top-positon) * -1);
109
+ }
110
+ }
111
+
112
+ &:not(&.lt-state-captions-enabled) {
113
+ .loader {
114
+ --_top-positon: 35%;
115
+ top: var(--_top-positon);
116
+ translate: -50% calc(var(--_top-positon) * -1);
117
+ }
118
+ }
119
+ }
120
+ }
121
+ }
122
+
123
+ @container landscape (width > 639px) {
124
+ .lt-player-orientation--landscape {
125
+ &.lt-state-loader-active {
126
+ &.lt-state-captions-enabled {
127
+ .loader {
128
+ --_top-positon: 20%;
129
+ top: var(--_top-positon);
130
+ translate: -50% calc(var(--_top-positon) * -1);
131
+ }
132
+ }
133
+
134
+ &:not(&.lt-state-captions-enabled) {
135
+ .loader {
136
+ --_top-positon: 35%;
137
+ top: var(--_top-positon);
138
+ translate: -50% calc(var(--_top-positon) * -1);
139
+ }
140
+ }
141
+ }
142
+ }
143
+ }
144
+
145
+ @container landscape (width > 759px) {
146
+ .lt-player-orientation--landscape {
147
+ &.lt-state-loader-active {
148
+ &.lt-state-captions-enabled {
149
+ .loader {
150
+ --_top-positon: 25%;
151
+ top: var(--_top-positon);
152
+ translate: -50% calc(var(--_top-positon) * -1);
153
+ }
154
+ }
155
+
156
+ &:not(&.lt-state-captions-enabled) {
157
+ .loader {
158
+ --_top-positon: 35%;
159
+ top: var(--_top-positon);
160
+ translate: -50% calc(var(--_top-positon) * -1);
161
+ }
162
+ }
163
+ }
164
+ }
165
+ }
166
+
167
+ @container landscape (width > 912px) {
168
+ .lt-player-orientation--landscape {
169
+ &.lt-state-loader-active {
170
+ &.lt-state-captions-enabled {
171
+ .loader {
172
+ --_top-positon: 30%;
173
+ top: var(--_top-positon);
174
+ translate: -50% calc(var(--_top-positon) * -1);
175
+ }
176
+ }
177
+
178
+ &:not(&.lt-state-captions-enabled) {
179
+ .loader {
180
+ --_top-positon: 40%;
181
+ top: var(--_top-positon);
182
+ translate: -50% calc(var(--_top-positon) * -1);
183
+ }
184
+ }
185
+ }
186
+ }
187
+ }
@@ -18,10 +18,6 @@
18
18
  visibility: hidden;
19
19
  }
20
20
 
21
- .plyr--video {
22
- background: transparent !important;
23
- }
24
-
25
21
  .plyr__video-wrapper {
26
22
  background: transparent !important;
27
23
  }
@@ -66,4 +62,10 @@
66
62
  display: none;
67
63
  }
68
64
  }
65
+ }
66
+
67
+ .lt-player-orientation--landscape {
68
+ .lt-player-wrapper {
69
+ object-fit: contain;
70
+ }
69
71
  }
@@ -1,40 +1,40 @@
1
1
  @import "../abstracts/variables";
2
2
 
3
- .lt-player-mobile-settings-modal {
4
- .settings-controllers {
5
- position: fixed;
6
- width: 100%;
7
- z-index: 10;
8
- left: 0;
9
- background: $default-lt-player-white;
10
- padding: 0 0 32px 0;
11
- bottom: 0;
12
- transition:.3s;
13
-
14
- .line-button {
15
- @extend %line-button;
16
- }
3
+ body[modal-open-body] {
4
+ position: fixed;
5
+ width: 100%;
6
+ overflow-x: hidden;
7
+ }
17
8
 
18
- .settings-text {
19
- font-size: $lt-player-font-size-base;
20
- font-weight: $lt-player-font-weight-sm;
21
- color: $default-lt-button-color !important;
22
- margin: 0;
23
- }
9
+ .settings-dialog {
10
+ background: $default-lt-player-white;
11
+ padding: 0;
12
+ width: 100%;
13
+ max-width: 375px;
14
+ border: none;
15
+ z-index: 10;
16
+
17
+ &::backdrop {
18
+ background-color: rgba($default-lt-button-color, .75);
24
19
  }
25
20
 
26
- .settings-controllers-enable {
27
- position: absolute;
28
- width: 100%;
29
- z-index: 30;
30
- left: 0;
31
- background: $default-lt-player-white;
32
- border-radius: 0 0 0 30px;
33
- bottom: 0;
21
+ .settings-controllers {
34
22
  display: flex;
35
23
  flex-direction: column;
36
- padding: 0 0 24px 0;
24
+ }
25
+
26
+ .line-button {
27
+ @extend %line-button;
28
+ }
29
+
30
+ .settings-text {
31
+ font-size: $lt-player-font-size-base;
32
+ font-weight: $lt-player-font-weight-sm;
33
+ color: $default-lt-button-color !important;
34
+ margin: 0;
35
+ }
37
36
 
37
+ .settings-controllers-enable {
38
38
  &__speed-range {
39
39
  padding: 24px 24px 0 24px;
40
40
  align-items: center;
@@ -42,30 +42,12 @@
42
42
  display: flex;
43
43
  position: relative;
44
44
 
45
- .mobile {
46
- display: flex;
47
- width: 80%!important;
48
- }
49
-
50
45
  .speed-range-input-body {
51
46
  color: $default-lt-player-black;
52
47
  width: 65%;
53
48
  margin-left: auto;
54
49
  position: relative;
55
50
 
56
- button {
57
- color: #27282A;
58
- background-color: #D8D846;
59
- width: 16%;
60
- margin: 0 2px;
61
- }
62
-
63
- .button_active {
64
- background-color: #27282A;
65
- color: grey;
66
- }
67
-
68
-
69
51
  output {
70
52
  font-size: $lt-player-font-size-base;
71
53
  font-weight: $lt-player-font-weight-lg;
@@ -207,7 +189,7 @@
207
189
  }
208
190
 
209
191
  &__button-save {
210
- padding: 16px 24px 0 24px;
192
+ padding: 16px 20px 20px 20px;
211
193
  color: black;
212
194
  display: flex;
213
195
  justify-content: left;
@@ -42,6 +42,8 @@
42
42
 
43
43
  .lt-player-orientation--landscape {
44
44
  .lt-player-custom-captions {
45
+ line-height: $lt-player-line-height-default;
46
+
45
47
  span {
46
48
  font-size: $lt-player-font-size-sm;
47
49
  border-radius: 0;
@@ -66,6 +68,8 @@
66
68
  @container landscape (width > 639px) {
67
69
  .lt-player-orientation--landscape {
68
70
  .lt-player-custom-captions {
71
+ line-height: $lt-player-line-height;
72
+
69
73
  span {
70
74
  font-size: $lt-player-font-size-lg;
71
75
  }
@@ -64,5 +64,13 @@ export class LTPlayerStatusFeedback {
64
64
  this.removeClass("lt-state-controls-visible")
65
65
  }
66
66
 
67
+ setCaptionsEnabled() {
68
+ this.addClass("lt-state-captions-enabled")
69
+ }
70
+
71
+ clearCaptionsEnabled() {
72
+ this.removeClass("lt-state-captions-enabled")
73
+ }
74
+
67
75
  }
68
76
 
@@ -239,6 +239,10 @@ export namespace LTPlayer {
239
239
 
240
240
  this.setEvents();
241
241
 
242
+ if (this.playerConfig.getCaptionsEnabled() === true) {
243
+ this.statusFeedbackService.setCaptionsEnabled()
244
+ }
245
+
242
246
  return true;
243
247
  }
244
248
 
@@ -42,6 +42,7 @@ export class LTPlayerCaptionsManager {
42
42
  this.player.playerConfig.setCaptionsEnabled(true)
43
43
  this.player.plyr.currentTrack = 0;
44
44
  this.player.plyr.toggleCaptions(true)
45
+ this.player.statusFeedbackService.setCaptionsEnabled()
45
46
  }
46
47
 
47
48
  disableCaptions() {
@@ -49,6 +50,7 @@ export class LTPlayerCaptionsManager {
49
50
  this.player.plyr.currentTrack = -1;
50
51
  this.player.plyr.toggleCaptions(false)
51
52
  this.clearSubtitles()
53
+ this.player.statusFeedbackService.clearCaptionsEnabled()
52
54
  }
53
55
 
54
56
  clearSubtitles(): void {
@@ -94,6 +94,14 @@ export class LTPlayerMobileSettingsControllers implements SettingsControlsInterf
94
94
  );
95
95
  const playerElementContainer = this.settingsInstance.playerInstance.playerConfig.getPlayerElementContainer()
96
96
  playerElementContainer.insertAdjacentHTML('beforeend', settingsDialog)
97
+
98
+ const modal = this.getModal()
99
+ modal.addEventListener('click', (e) => {
100
+ if (e.target === modal) {
101
+ this.hideModal()
102
+ }
103
+ });
104
+
97
105
  }
98
106
 
99
107
  initCaptionsEvent() {
@@ -56,34 +56,35 @@ export namespace LTPlayerEvents {
56
56
  }
57
57
 
58
58
  const volumeControl = controls.querySelector('.bottom-controller__volume_control');
59
- const volumeButton = volumeControl.querySelector('.button-open');
60
- const volumeBackground = volumeControl.querySelector('.volume_control__background');
61
- const volumeBackgroundArea = volumeControl.querySelector('.volume_control__background__area');
62
- const volumeArea = volumeControl.querySelector('.volume_control__background__area__range');
63
- const controlsBackground = player.elements.container.querySelector('.plyr__controls__mobile-background');
59
+ if (volumeControl) {
60
+ const volumeButton = volumeControl.querySelector('.button-open');
61
+ const volumeBackground = volumeControl.querySelector('.volume_control__background');
62
+ const volumeBackgroundArea = volumeControl.querySelector('.volume_control__background__area');
63
+ const volumeArea = volumeControl.querySelector('.volume_control__background__area__range');
64
64
 
65
65
 
66
- if (volumeButton) {
67
- volumeButton.classList.remove('d-none');
68
- }
66
+ if (volumeButton) {
67
+ volumeButton.classList.remove('d-none');
68
+ }
69
69
 
70
- if (volumeBackground) {
71
- volumeBackground.classList.add('d-none')
72
- }
70
+ if (volumeBackground) {
71
+ volumeBackground.classList.add('d-none')
72
+ }
73
73
 
74
- if (volumeBackgroundArea) {
75
- volumeBackgroundArea.classList.add('d-none')
76
- }
74
+ if (volumeBackgroundArea) {
75
+ volumeBackgroundArea.classList.add('d-none')
76
+ }
77
77
 
78
- if (volumeArea) {
79
- volumeArea.classList.remove('volume-area-open')
80
- }
78
+ if (volumeArea) {
79
+ volumeArea.classList.remove('volume-area-open')
80
+ }
81
81
 
82
- if (volumeControl) {
83
- volumeControl.classList.remove('volume-area-open');
84
- volumeControl.classList.remove('volume-control-enable');
82
+ if (volumeControl) {
83
+ volumeControl.classList.remove('volume-area-open');
84
+ volumeControl.classList.remove('volume-control-enable');
85
+ }
85
86
  }
86
-
87
+ const controlsBackground = player.elements.container.querySelector('.plyr__controls__mobile-background');
87
88
  if (controlsBackground) {
88
89
  if (!controlsBackground.classList.contains('d-none')) {
89
90
  controlsBackground.classList.add('d-none');
@@ -182,6 +183,8 @@ export namespace LTPlayerEvents {
182
183
  if (!instance.plyr.elements.container.classList.contains('plyr__poster-enabled')) {
183
184
  instance.plyr.elements.container.classList.add('plyr__poster-enabled');
184
185
  }
186
+
187
+ instance.statusFeedbackService.clearLoading()
185
188
  }
186
189
 
187
190
  }
@@ -21,6 +21,10 @@ export class LTPlayerCommon {
21
21
 
22
22
  this.plyr.on('play', function LTPlayerPlay(event) {
23
23
 
24
+ if (!instance.plyr.elements.controls.classList.contains('plyr__controls-enable')) {
25
+ instance.plyr.elements.controls.classList.add('plyr__controls-enable');
26
+ }
27
+
24
28
  instance.desktopEvents.playPause(event);
25
29
 
26
30
  if (instance.additionalInfoService) {
@@ -35,6 +35,10 @@ export class LTPlayerDesktop extends LTPlayerCommon implements EventsInterfaces
35
35
  let plyr: Plyr = this.plyr;
36
36
 
37
37
  plyr.on('seeked', function LTPlayerSeek(){
38
+ if (plyr.stopped === true) {
39
+ eventManager.endVideo()
40
+ }
41
+
38
42
  if (plyr.isEmbed) {
39
43
  if (plyr.paused) {
40
44
  return;
@@ -35,6 +35,10 @@ export class LTPlayerMobile extends LTPlayerCommon implements EventsInterfaces {
35
35
  let plyr: Plyr = this.plyr;
36
36
 
37
37
  plyr.on('seeked', function LTPlayerSeek(){
38
+ if (plyr.stopped === true) {
39
+ eventManager.endVideo()
40
+ }
41
+
38
42
  if (plyr.isEmbed) {
39
43
  if (plyr.paused) {
40
44
  return;
@@ -114,6 +114,8 @@ export class TemplateService {
114
114
  break
115
115
  }
116
116
 
117
+ Object.assign(configData, {chaptersEnabled: (!!configData['chapters']) })
118
+
117
119
  let render = Mustache.render(controlsTemplate,configData);
118
120
 
119
121
  delete configData.mobile;
@@ -117,12 +117,14 @@
117
117
  </div>
118
118
  {{/desktop}}
119
119
  <div class="bottom-controller__center-buttons">
120
+ {{#chaptersEnabled}}
120
121
  <div class="bottom-controller__previous-chapter-view-wrapper">
121
122
  <p class="bottom-controller__previous-chapter-view"></p>
122
123
  <button type="button" class="plyr__control skip-backward" data-lt-player-chapterTimeStamp="">
123
124
  <img class="filter" src="{{icons.skip-backward}}" alt="">
124
125
  </button>
125
126
  </div>
127
+ {{/chaptersEnabled}}
126
128
  {{#desktop}}
127
129
  <button type="button" class="plyr__control skip-backward-seconds" data-lt-player-chapterTimeStamp="">
128
130
  <img class="filter" src="{{icons.fast-backward}}" alt="">
@@ -139,12 +141,14 @@
139
141
  <img class="filter" src="{{icons.fast-forward}}" alt="">
140
142
  </button>
141
143
  {{/desktop}}
144
+ {{#chaptersEnabled}}
142
145
  <div class="bottom-controller__next-chapter-view-wrapper">
143
146
  <button type="button" class="plyr__control skip-forward" data-lt-player-chapterTimeStamp="">
144
147
  <img class="filter" src="{{icons.skip-forward}}" alt="">
145
148
  </button>
146
149
  <p class="bottom-controller__next-chapter-view"></p>
147
150
  </div>
151
+ {{/chaptersEnabled}}
148
152
  </div>
149
153
  <div class="bottom-controller__right-buttons">
150
154
  {{#desktop}}
@@ -320,18 +324,22 @@
320
324
  </div>
321
325
  {{/desktop}}
322
326
  <div class="bottom-controller__center-buttons">
327
+ {{#chaptersEnabled}}
323
328
  <button type="button" class="plyr__control skip-backward" data-lt-player-chapterTimeStamp="">
324
329
  <img class="filter" src="{{icons.skip-backward}}" alt="">
325
330
  </button>
331
+ {{/chaptersEnabled}}
326
332
  <div class="bottom-controller__play-button_body bottom-controller__play-button_body__portrait">
327
333
  <button type="button" class="plyr__control play-button">
328
334
  <img class="bottom-controller__play-icon d-none" src="{{icons.play}}" alt="">
329
335
  <img class="bottom-controller__pause-icon" src="{{icons.pause}}" alt="">
330
336
  </button>
331
337
  </div>
338
+ {{#chaptersEnabled}}
332
339
  <button type="button" class="plyr__control skip-forward" data-lt-player-chapterTimeStamp="">
333
340
  <img class="filter" src="{{icons.skip-forward}}" alt="">
334
341
  </button>
342
+ {{/chaptersEnabled}}
335
343
  </div>
336
344
  {{#mobile}}
337
345
  <div class="bottom-controller__right-buttons">
@@ -1,4 +1,5 @@
1
- <dialog class="settings-controllers settings">
1
+ <dialog class="settings-dialog">
2
+ <div class="settings-controllers settings">
2
3
  <span class="line-button settings-controllers-header"></span>
3
4
  <div class="settings-controllers-enable__subtitles settings">
4
5
  <p class="settings-text settings">Subtitles</p>
@@ -17,4 +18,5 @@
17
18
  <div class="settings-controllers-enable__button-save settings">
18
19
  <button class="button-save settings">Save</button>
19
20
  </div>
21
+ </div>
20
22
  </dialog>