@latest-thinking/lt-player 1.1.0-v → 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-v",
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
  }
@@ -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 {
@@ -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;