@latest-thinking/lt-player 1.0.6 → 1.0.7
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/dist/css/lt-player-main.css +1 -1
- package/dist/css/lt-player-main.css.map +1 -1
- package/dist/js/lt-player-main.js +1 -1
- package/dist/js/lt-player-main.js.map +1 -1
- package/package.json +1 -1
- package/src/assets/sass/abstracts/_mixins.scss +11 -0
- package/src/assets/sass/abstracts/_variables.scss +3 -0
- package/src/assets/sass/app.scss +13 -1
- package/src/assets/sass/components/_modal.scss +1 -1
- package/src/assets/sass/sections/_settings.scss +255 -82
- package/src/assets/sass/sections/_share.scss +132 -21
- package/src/assets/sass/sections/controllers/_botom.scss +296 -303
- package/src/assets/sass/sections/controllers/_notification-rewind-forward.scss +36 -66
- package/src/assets/sass/sections/controllers/_top.scss +94 -113
- package/src/components/LTPlayerSetup.ts +0 -1
- package/src/components/LTPlayerType.ts +12 -12
- package/src/components/addInfo/LTPlayerAddInfoDesktop.ts +99 -0
- package/src/components/addInfo/LTPlayerAddInfoManager.ts +6 -6
- package/src/components/addInfo/LTPlayerAddInfoMobile.ts +110 -0
- package/src/components/config/LTPlayerConfig.ts +25 -11
- package/src/components/controls/LTPlayerControlsEvents.ts +46 -36
- package/src/components/controls/settings/LTPlayerDesktopSettingsControllers.ts +0 -1
- package/src/components/controls/settings/LTPlayerMobileSettingsControllers.ts +166 -30
- package/src/components/events/LTPlayer.ts +8 -0
- package/src/components/events/LTPlayerCommon.ts +28 -32
- package/src/components/events/LTPlayerDesktop.ts +4 -0
- package/src/components/events/LTPlayerMobile.ts +4 -2
- package/src/components/share/LTPlayerShareDesktop.ts +120 -0
- package/src/components/share/LTPlayerShareEvents.ts +30 -132
- package/src/components/share/{LTPlayerShare.ts → LTPlayerShareManager.ts} +26 -8
- package/src/components/share/LTPlayerShareMobile.ts +154 -0
- package/src/components/video/LTPlayerVideo.ts +49 -0
- package/src/global/controllers/LTPlayerController.ts +6 -3
- package/src/index.ts +6 -0
- package/src/services/ResizeService.ts +7 -7
- package/src/views/additionalInfo.handlebars +4 -8
- package/src/views/controls.handlebars +41 -37
- package/src/views/settings.handlebars +11 -14
- package/src/views/share.handlebars +36 -33
- package/src/components/addInfo/LTPlayerAdditionalInfoEvents.ts +0 -247
|
@@ -1,36 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
&.lt-player--portrait {
|
|
3
|
-
&__xs {
|
|
4
|
-
.lt-player-notification {
|
|
5
|
-
.lt-player-video-content {
|
|
6
|
-
padding: 0 16px;
|
|
7
|
-
|
|
8
|
-
.poster-title {
|
|
9
|
-
@extend %line-clamp-3;
|
|
10
|
-
@include line-clamp-3;
|
|
11
|
-
font-size: $lt-player-font-size-xs;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.poster-paragraph {
|
|
15
|
-
&__content {
|
|
16
|
-
font-size: 14px;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
&__sm {
|
|
24
|
-
.lt-player-notification {
|
|
25
|
-
.lt-player-video-content {
|
|
26
|
-
.poster-title {
|
|
27
|
-
font-size: $lt-player-font-size-base;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
1
|
+
@import "../../abstracts/variables";
|
|
34
2
|
|
|
35
3
|
.lt-player-notification {
|
|
36
4
|
width: 100%;
|
|
@@ -65,10 +33,10 @@
|
|
|
65
33
|
|
|
66
34
|
.lt-player-video-content {
|
|
67
35
|
position: absolute;
|
|
68
|
-
bottom:
|
|
36
|
+
bottom: 110px;
|
|
69
37
|
text-align: left;
|
|
70
38
|
display: flex;
|
|
71
|
-
padding: 0
|
|
39
|
+
padding: 0 16px;
|
|
72
40
|
width: 100%;
|
|
73
41
|
user-select: none;
|
|
74
42
|
align-items: end;
|
|
@@ -82,7 +50,7 @@
|
|
|
82
50
|
@extend %line-clamp-3;
|
|
83
51
|
@include line-clamp-4;
|
|
84
52
|
color: $default-lt-player-white !important;
|
|
85
|
-
font-size: $lt-player-font-size-
|
|
53
|
+
font-size: $lt-player-font-size-sm;
|
|
86
54
|
font-weight: $lt-player-font-weight-lg;
|
|
87
55
|
line-height: $lt-player-line-height;
|
|
88
56
|
margin: 0;
|
|
@@ -96,7 +64,7 @@
|
|
|
96
64
|
word-wrap: break-word;
|
|
97
65
|
text-overflow: ellipsis;
|
|
98
66
|
overflow: hidden;
|
|
99
|
-
font-size: $lt-player-font-size-
|
|
67
|
+
font-size: $lt-player-font-size-sm;
|
|
100
68
|
font-weight: $lt-player-font-weight-sm;
|
|
101
69
|
color: $default-lt-player-white !important;
|
|
102
70
|
margin-bottom: 0;
|
|
@@ -129,7 +97,7 @@
|
|
|
129
97
|
|
|
130
98
|
.lt-player-rewind-area,
|
|
131
99
|
.lt-player-forward-area {
|
|
132
|
-
touch-action: inherit!important;
|
|
100
|
+
touch-action: inherit !important;
|
|
133
101
|
width: 100%;
|
|
134
102
|
height: 100%;
|
|
135
103
|
z-index: 4;
|
|
@@ -142,13 +110,11 @@
|
|
|
142
110
|
display: flex;
|
|
143
111
|
position: absolute;
|
|
144
112
|
text-align: center;
|
|
145
|
-
border-radius: 100% 0 0 100%;
|
|
146
113
|
height: unset;
|
|
147
114
|
bottom: 10%;
|
|
148
115
|
|
|
149
116
|
&__icon-wrapper {
|
|
150
117
|
display: flex;
|
|
151
|
-
padding: 0 8px;
|
|
152
118
|
user-select: none;
|
|
153
119
|
|
|
154
120
|
&.rotate {
|
|
@@ -169,8 +135,10 @@
|
|
|
169
135
|
}
|
|
170
136
|
|
|
171
137
|
span {
|
|
172
|
-
font-size: $lt-player-font-size-
|
|
138
|
+
font-size: $lt-player-font-size-base;
|
|
139
|
+
font-weight: $lt-player-font-weight-sm;
|
|
173
140
|
user-select: none;
|
|
141
|
+
padding: 0 8px;
|
|
174
142
|
}
|
|
175
143
|
}
|
|
176
144
|
|
|
@@ -181,11 +149,11 @@
|
|
|
181
149
|
flex-direction: row-reverse;
|
|
182
150
|
|
|
183
151
|
&__portrait {
|
|
184
|
-
margin: auto auto auto
|
|
152
|
+
margin: auto auto auto 45px;
|
|
185
153
|
}
|
|
186
154
|
|
|
187
155
|
&__landscape {
|
|
188
|
-
margin: auto auto auto
|
|
156
|
+
margin: auto 60px auto auto;
|
|
189
157
|
}
|
|
190
158
|
}
|
|
191
159
|
}
|
|
@@ -195,11 +163,11 @@
|
|
|
195
163
|
|
|
196
164
|
&__icon {
|
|
197
165
|
&__portrait {
|
|
198
|
-
margin: auto
|
|
166
|
+
margin: auto 45px auto auto;
|
|
199
167
|
}
|
|
200
168
|
|
|
201
169
|
&__landscape {
|
|
202
|
-
margin: auto
|
|
170
|
+
margin: auto auto auto 60px;
|
|
203
171
|
}
|
|
204
172
|
}
|
|
205
173
|
}
|
|
@@ -211,25 +179,10 @@
|
|
|
211
179
|
//opacity: 1;
|
|
212
180
|
}
|
|
213
181
|
|
|
214
|
-
|
|
215
|
-
.animate-in{
|
|
182
|
+
.animate-in {
|
|
216
183
|
opacity: 1;
|
|
217
|
-
display:flex;
|
|
184
|
+
display: flex;
|
|
218
185
|
animation: ripple 1s forwards;
|
|
219
|
-
|
|
220
|
-
i{
|
|
221
|
-
display:block;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
.lt-player-forward__icon i {
|
|
225
|
-
padding-bottom:2px;
|
|
226
|
-
margin-left: 30px;
|
|
227
|
-
animation: fadeInLeft 2s;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
.lt-player-rewind__icon i{
|
|
231
|
-
animation: fadeInRight 2s;
|
|
232
|
-
}
|
|
233
186
|
}
|
|
234
187
|
}
|
|
235
188
|
|
|
@@ -268,8 +221,25 @@
|
|
|
268
221
|
}
|
|
269
222
|
}
|
|
270
223
|
|
|
224
|
+
@container portrait (width > 319px) {
|
|
225
|
+
.lt-player-orientation--portrait {
|
|
226
|
+
.lt-player-notification {
|
|
227
|
+
.lt-player-video-content {
|
|
228
|
+
padding: 0 20px;
|
|
229
|
+
bottom: 136px;
|
|
230
|
+
|
|
231
|
+
.poster-title {
|
|
232
|
+
@extend %line-clamp-3;
|
|
233
|
+
@include line-clamp-3;
|
|
234
|
+
font-size: $lt-player-font-size-xxl;
|
|
235
|
+
}
|
|
271
236
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
237
|
+
.poster-paragraph {
|
|
238
|
+
&__content {
|
|
239
|
+
font-size: $lt-player-font-size-base;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
@@ -1,59 +1,5 @@
|
|
|
1
1
|
@import "../../abstracts/variables";
|
|
2
2
|
|
|
3
|
-
.lt-player-landscape--desktop {
|
|
4
|
-
.plyr {
|
|
5
|
-
&__controls,
|
|
6
|
-
&__controls-enable,
|
|
7
|
-
&__controls-enable-settings {
|
|
8
|
-
.top-controllers {
|
|
9
|
-
padding: 40px 40px 0;
|
|
10
|
-
|
|
11
|
-
&__background {
|
|
12
|
-
display: none;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.lt-player-landscape--mobile,
|
|
20
|
-
.lt-player-landscape--desktop {
|
|
21
|
-
&.lt-player--landscape {
|
|
22
|
-
&__xxs {
|
|
23
|
-
.plyr {
|
|
24
|
-
&__controls {
|
|
25
|
-
.top-controllers {
|
|
26
|
-
padding: 10px;
|
|
27
|
-
|
|
28
|
-
button {
|
|
29
|
-
@include buttons-xs;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.lt-player-portrate--mobile,
|
|
39
|
-
.lt-player-portrate--desktop {
|
|
40
|
-
&.lt-player--portrait {
|
|
41
|
-
&__xs {
|
|
42
|
-
.plyr {
|
|
43
|
-
&__controls {
|
|
44
|
-
.top-controllers {
|
|
45
|
-
padding: 16px;
|
|
46
|
-
|
|
47
|
-
button {
|
|
48
|
-
@include buttons-xs;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
3
|
.plyr {
|
|
58
4
|
.plyr__controls-enable-settings {
|
|
59
5
|
opacity: 1;
|
|
@@ -67,12 +13,13 @@
|
|
|
67
13
|
&__controls-enable-settings {
|
|
68
14
|
.top-controllers {
|
|
69
15
|
width: 100%;
|
|
70
|
-
padding:
|
|
16
|
+
padding: 10px 10px 0;
|
|
71
17
|
position: absolute;
|
|
72
18
|
|
|
73
19
|
button {
|
|
74
20
|
@extend %lt-player-btn;
|
|
75
21
|
@include dark-btn;
|
|
22
|
+
@include buttons-xs;
|
|
76
23
|
}
|
|
77
24
|
|
|
78
25
|
&__background {
|
|
@@ -102,21 +49,18 @@
|
|
|
102
49
|
align-items: flex-start;
|
|
103
50
|
}
|
|
104
51
|
|
|
105
|
-
&__center {
|
|
106
|
-
flex: 1;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
52
|
&__right {
|
|
110
53
|
align-items: end;
|
|
111
54
|
}
|
|
112
55
|
|
|
113
56
|
&__center {
|
|
57
|
+
flex: 1;
|
|
114
58
|
width: 100%;
|
|
115
59
|
word-break: break-word;
|
|
116
60
|
|
|
117
61
|
.chapter {
|
|
118
|
-
font-size: $lt-player-font-size-
|
|
119
|
-
font-weight: $lt-player-font-weight-
|
|
62
|
+
font-size: $lt-player-font-size-base;
|
|
63
|
+
font-weight: $lt-player-font-weight-base;
|
|
120
64
|
position: relative;
|
|
121
65
|
z-index: 90;
|
|
122
66
|
margin: 0;
|
|
@@ -125,64 +69,101 @@
|
|
|
125
69
|
}
|
|
126
70
|
|
|
127
71
|
&__right {
|
|
128
|
-
|
|
129
72
|
.mini-player-control {
|
|
130
|
-
margin-top:
|
|
73
|
+
margin-top: 20px;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.lt-player-orientation--portrait {
|
|
82
|
+
.plyr {
|
|
83
|
+
&__controls {
|
|
84
|
+
.top-controllers {
|
|
85
|
+
padding: 16px;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// @Container Query
|
|
92
|
+
|
|
93
|
+
@container portrait (width > 319px) {
|
|
94
|
+
.lt-player-orientation--portrait {
|
|
95
|
+
.plyr {
|
|
96
|
+
&__controls {
|
|
97
|
+
.top-controllers {
|
|
98
|
+
padding: 20px 20px 0;
|
|
99
|
+
|
|
100
|
+
&__body {
|
|
101
|
+
&__center {
|
|
102
|
+
.chapter {
|
|
103
|
+
margin-top: 6px;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
button {
|
|
109
|
+
@include buttons-normal;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@container landscape (width > 479px) {
|
|
118
|
+
.lt-player-orientation--landscape {
|
|
119
|
+
.plyr {
|
|
120
|
+
&__controls {
|
|
121
|
+
.top-controllers {
|
|
122
|
+
padding: 20px 20px 0;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
@container landscape (width > 639px) {
|
|
130
|
+
.lt-player-orientation--landscape {
|
|
131
|
+
.plyr {
|
|
132
|
+
&__controls {
|
|
133
|
+
.top-controllers {
|
|
134
|
+
padding: 20px 40px 0;
|
|
135
|
+
|
|
136
|
+
&__body {
|
|
137
|
+
&__center {
|
|
138
|
+
.chapter {
|
|
139
|
+
font-size: $lt-player-font-size-lg;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
131
142
|
}
|
|
132
143
|
}
|
|
133
144
|
}
|
|
134
145
|
}
|
|
135
146
|
}
|
|
147
|
+
}
|
|
136
148
|
|
|
149
|
+
@container landscape (width > 912px) {
|
|
150
|
+
.lt-player-orientation--landscape {
|
|
151
|
+
.plyr {
|
|
152
|
+
&__controls {
|
|
153
|
+
.top-controllers {
|
|
154
|
+
button {
|
|
155
|
+
@include buttons-normal;
|
|
156
|
+
}
|
|
137
157
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
// top: 1rem;
|
|
150
|
-
// left: 0;
|
|
151
|
-
// right: 0;
|
|
152
|
-
// text-align: center;
|
|
153
|
-
// }
|
|
154
|
-
// }
|
|
155
|
-
// }
|
|
156
|
-
//
|
|
157
|
-
//
|
|
158
|
-
// &__body {
|
|
159
|
-
// &__right{
|
|
160
|
-
// .fullscreen-custom-control {
|
|
161
|
-
// position: absolute;
|
|
162
|
-
// top: 1rem;
|
|
163
|
-
// right: 1rem;
|
|
164
|
-
// bottom: auto;
|
|
165
|
-
// }
|
|
166
|
-
//
|
|
167
|
-
// .mini-player-control {
|
|
168
|
-
// position: absolute;
|
|
169
|
-
// top: 4rem;
|
|
170
|
-
// right: 1rem;
|
|
171
|
-
// bottom: auto;
|
|
172
|
-
// }
|
|
173
|
-
// }
|
|
174
|
-
// }
|
|
175
|
-
//}
|
|
176
|
-
|
|
177
|
-
//.fade-animation-controllers {
|
|
178
|
-
// //display: flex!important;
|
|
179
|
-
// .top-controllers {
|
|
180
|
-
// background: linear-gradient(transparent,rgba(0,0,0,.75))!important;
|
|
181
|
-
// background: var(--plyr-video-controls-background,linear-gradient(transparent,rgba(0,0,0,.75)))!important;
|
|
182
|
-
// opacity: 1 !important;
|
|
183
|
-
// transition-property: opacity, left, top, height;
|
|
184
|
-
// transition-duration: 1s, 3s;
|
|
185
|
-
// }
|
|
186
|
-
//
|
|
187
|
-
//}
|
|
158
|
+
&__body {
|
|
159
|
+
&__center {
|
|
160
|
+
.chapter {
|
|
161
|
+
font-size: $lt-player-font-size-xxl2;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
188
169
|
}
|
|
@@ -105,7 +105,7 @@ export namespace LTPlayer {
|
|
|
105
105
|
this.innerPlayerTemplate(this.playerConfig);
|
|
106
106
|
|
|
107
107
|
this.playerConfig.getPlayerElementContainer().classList.add(`lt-player-portrate--${this.playerConfig.getDevice()}`);
|
|
108
|
-
|
|
108
|
+
this.playerConfig.getPlayerElementContainer().classList.add('lt-player-orientation--portrait');
|
|
109
109
|
|
|
110
110
|
let playerSettings = {};
|
|
111
111
|
|
|
@@ -113,7 +113,6 @@ export namespace LTPlayer {
|
|
|
113
113
|
|
|
114
114
|
Object.assign(playerSettings, {controls});
|
|
115
115
|
|
|
116
|
-
|
|
117
116
|
if (this.playerConfig.getVideoType() === 'embedded') {
|
|
118
117
|
Object.assign(playerSettings, this.playerConfig.getEmbedOrigin())
|
|
119
118
|
}
|
|
@@ -128,14 +127,14 @@ export namespace LTPlayer {
|
|
|
128
127
|
|
|
129
128
|
const element = this.playerConfig.getPlayerElementContainer().querySelector('.embed_player');
|
|
130
129
|
|
|
131
|
-
|
|
130
|
+
this.plyr = new Plyr(element, playerSettings);
|
|
132
131
|
|
|
133
|
-
this.playerConfig.setObjectFit(
|
|
132
|
+
this.playerConfig.setObjectFit(this.plyr, 'portrait').then(() => {
|
|
133
|
+
this.videoService.init(this);
|
|
134
|
+
});
|
|
134
135
|
|
|
135
136
|
this.windowService.init(this);
|
|
136
137
|
|
|
137
|
-
this.plyr = player;
|
|
138
|
-
|
|
139
138
|
this.posterManager.init(this);
|
|
140
139
|
|
|
141
140
|
const chapters = this.playerConfig.getChapters();
|
|
@@ -151,7 +150,7 @@ export namespace LTPlayer {
|
|
|
151
150
|
}
|
|
152
151
|
|
|
153
152
|
if (this.playerConfig.getDevice() !== 'mobile') {
|
|
154
|
-
this.miniPlayer.init(
|
|
153
|
+
this.miniPlayer.init(this.plyr, this.templateService, this.iconService, this.playerConfig.getPlayerType(), this);
|
|
155
154
|
}
|
|
156
155
|
}
|
|
157
156
|
|
|
@@ -243,6 +242,7 @@ export namespace LTPlayer {
|
|
|
243
242
|
this.innerPlayerTemplate(this.playerConfig);
|
|
244
243
|
|
|
245
244
|
this.playerConfig.getPlayerElementContainer().classList.add(`lt-player-landscape--${this.playerConfig.getDevice()}`);
|
|
245
|
+
this.playerConfig.getPlayerElementContainer().classList.add('lt-player-orientation--landscape');
|
|
246
246
|
|
|
247
247
|
let playerSettings = {};
|
|
248
248
|
|
|
@@ -264,14 +264,14 @@ export namespace LTPlayer {
|
|
|
264
264
|
|
|
265
265
|
const element = this.playerConfig.getPlayerElementContainer().querySelector('.embed_player');
|
|
266
266
|
|
|
267
|
-
|
|
267
|
+
this.plyr = new Plyr(element, playerSettings);
|
|
268
268
|
|
|
269
|
-
this.playerConfig.setObjectFit(
|
|
269
|
+
this.playerConfig.setObjectFit(this.plyr, 'landscape').then(() => {
|
|
270
|
+
this.videoService.init(this);
|
|
271
|
+
});
|
|
270
272
|
|
|
271
273
|
this.windowService.init(this);
|
|
272
274
|
|
|
273
|
-
this.plyr = player;
|
|
274
|
-
|
|
275
275
|
this.posterManager.init(this);
|
|
276
276
|
|
|
277
277
|
const chapters = this.playerConfig.getChapters();
|
|
@@ -287,7 +287,7 @@ export namespace LTPlayer {
|
|
|
287
287
|
}
|
|
288
288
|
|
|
289
289
|
if (this.playerConfig.getDevice() !== 'mobile') {
|
|
290
|
-
this.miniPlayer.init(
|
|
290
|
+
this.miniPlayer.init(this.plyr, this.templateService, this.iconService, this.playerConfig.getPlayerType(), this);
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
293
|
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import {LTPLayerAddInfo} from "./LTPlayerAddInfoManager";
|
|
2
|
+
import {additionalInformation} from "../../global/types/ModuleTypes";
|
|
3
|
+
|
|
4
|
+
export class LTPlayerAddInfoDesktop {
|
|
5
|
+
set(controller: LTPLayerAddInfo.Controller) {
|
|
6
|
+
|
|
7
|
+
const playerContainer = controller.plyr.elements.container;
|
|
8
|
+
const playerControlsContainer = controller.plyr.elements.controls;
|
|
9
|
+
let additionalInfoBodyOut: Element = playerContainer.nextElementSibling;
|
|
10
|
+
let additionalInfoBodyIn: Element = playerControlsContainer.querySelector('.lt-player__additional-info');
|
|
11
|
+
let instance = controller;
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
const getInfoButtons = (selector: Element): NodeList => {
|
|
15
|
+
|
|
16
|
+
if (!selector) {
|
|
17
|
+
return null
|
|
18
|
+
}
|
|
19
|
+
return selector.querySelectorAll('button');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
let buttons: NodeList = null;
|
|
23
|
+
|
|
24
|
+
const infoButtonsOut: NodeList = getInfoButtons(additionalInfoBodyOut);
|
|
25
|
+
const infoButtonsIn: NodeList = getInfoButtons(additionalInfoBodyIn);
|
|
26
|
+
|
|
27
|
+
if (!infoButtonsOut) {
|
|
28
|
+
buttons = infoButtonsIn;
|
|
29
|
+
} else {
|
|
30
|
+
buttons = infoButtonsOut;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (buttons.length === 0) {
|
|
34
|
+
return
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const createInformationModal = (info: additionalInformation, key: string) => {
|
|
38
|
+
|
|
39
|
+
let modalTemplate = null;
|
|
40
|
+
|
|
41
|
+
if (typeof info === 'object') {
|
|
42
|
+
modalTemplate = controller.templateService.getAdditionalInfo({
|
|
43
|
+
desktop : true,
|
|
44
|
+
modal : true,
|
|
45
|
+
id : `${key}-${controller.playerInstance.playerConfig.getPlayerId()}`,
|
|
46
|
+
object_data : true,
|
|
47
|
+
[key] : info
|
|
48
|
+
})
|
|
49
|
+
} else {
|
|
50
|
+
modalTemplate = controller.templateService.getAdditionalInfo({
|
|
51
|
+
desktop : true,
|
|
52
|
+
modal : true,
|
|
53
|
+
id : `${key}-${controller.playerInstance.playerConfig.getPlayerId()}`,
|
|
54
|
+
data : info
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
document.querySelector('body').insertAdjacentHTML("afterend", modalTemplate);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
buttons.forEach((button: HTMLElement) => {
|
|
62
|
+
|
|
63
|
+
button.addEventListener('click', function (event) {
|
|
64
|
+
|
|
65
|
+
event.preventDefault();
|
|
66
|
+
|
|
67
|
+
let targetModal = button.dataset.ltTarget;
|
|
68
|
+
let data = instance.additionalData;
|
|
69
|
+
|
|
70
|
+
if (data[targetModal] !== undefined) {
|
|
71
|
+
createInformationModal(data[targetModal], targetModal)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
let modal = document.querySelector(`.lt-modal-${targetModal}-${instance.playerInstance.playerConfig.getPlayerId()}`);
|
|
75
|
+
|
|
76
|
+
if (modal) {
|
|
77
|
+
modal.classList.add('player-lt__show-modal');
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
window.Player.players.forEach( item => {item.plyr.pause()})
|
|
81
|
+
})
|
|
82
|
+
})
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
windowDesktopEvents(event: MouseEvent) {
|
|
86
|
+
const modals = document.querySelectorAll('.player-lt__modal');
|
|
87
|
+
if (modals.length !== 0) {
|
|
88
|
+
modals.forEach(modal => {
|
|
89
|
+
if (modal.classList.contains('player-lt__show-modal')) {
|
|
90
|
+
let target = event.target as HTMLElement;
|
|
91
|
+
if (target.classList.contains('player-lt__show-modal') || target.classList.contains('player-lt__close-button')) {
|
|
92
|
+
modal.classList.remove('player-lt__show-modal');
|
|
93
|
+
document.querySelectorAll(".player-lt__modal").forEach(el => el.remove());
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
})
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -3,7 +3,8 @@ import {TemplateService} from "../../services/TemplateService";
|
|
|
3
3
|
import {IconsService} from "../../services/IconsService";
|
|
4
4
|
import Plyr, {PlyrEvent} from "plyr";
|
|
5
5
|
import {LTPlayer} from "../LTPlayerType";
|
|
6
|
-
import {
|
|
6
|
+
import {LTPlayerAddInfoDesktop} from "./LTPlayerAddInfoDesktop";
|
|
7
|
+
import {LTPlayerAddInfoMobile} from "./LTPlayerAddInfoMobile";
|
|
7
8
|
|
|
8
9
|
export class LTPlayerAddInfoManager {
|
|
9
10
|
container: HTMLElement
|
|
@@ -16,9 +17,8 @@ export class LTPlayerAddInfoManager {
|
|
|
16
17
|
players: Array<any>;
|
|
17
18
|
device: string
|
|
18
19
|
addInfoType: LTPLayerAddInfo.Landscape | LTPLayerAddInfo.Portrate
|
|
19
|
-
desktopEvents:
|
|
20
|
-
mobileEvents:
|
|
21
|
-
|
|
20
|
+
desktopEvents: LTPlayerAddInfoDesktop;
|
|
21
|
+
mobileEvents: LTPlayerAddInfoMobile
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
constructor() {
|
|
@@ -28,11 +28,11 @@ export class LTPlayerAddInfoManager {
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
setDesktopEvents() {
|
|
31
|
-
this.desktopEvents = new
|
|
31
|
+
this.desktopEvents = new LTPlayerAddInfoDesktop();
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
setMobileEvents() {
|
|
35
|
-
this.mobileEvents = new
|
|
35
|
+
this.mobileEvents = new LTPlayerAddInfoMobile();
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
|