@latest-thinking/lt-player 1.0.4-m → 1.0.4-n
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/sections/_control.scss +3 -0
- package/src/assets/sass/sections/_settings.scss +1 -1
- package/src/assets/sass/sections/_subtitles.scss +4 -0
- package/src/assets/sass/sections/controllers/_botom.scss +9 -2
- package/src/assets/sass/sections/controllers/_notification-rewind-forward.scss +27 -7
- package/src/components/addInfo/LTPlayerAdditionalInfoEvents.ts +3 -2
- package/src/components/controls/LTPlayerChapters.ts +8 -4
- package/src/components/controls/LTPlayerControlsEvents.ts +81 -45
- package/src/components/controls/settings/LTPlayerDesktopSettingsControllers.ts +2 -4
- package/src/components/events/LTPlayer.ts +7 -0
- package/src/components/poster/LTPlayerPosterPreloadEvents.ts +17 -6
- package/src/services/IconsService.ts +15 -0
- package/src/services/LTPlayerRotateDeviceService.ts +0 -1
- package/src/views/controls.handlebars +10 -12
- package/src/views/settings.handlebars +3 -3
package/package.json
CHANGED
|
@@ -251,10 +251,14 @@
|
|
|
251
251
|
white-space: nowrap;
|
|
252
252
|
font-size: 12px;
|
|
253
253
|
transition: none;
|
|
254
|
+
outline: none;
|
|
254
255
|
background-color: $default-lt-player-blue;
|
|
255
256
|
|
|
256
257
|
&:focus,
|
|
257
|
-
&:active
|
|
258
|
+
&:active,
|
|
259
|
+
&:hover,
|
|
260
|
+
&:focus-visible {
|
|
261
|
+
outline: $default-lt-player-blue;
|
|
258
262
|
background-color: $default-lt-player-blue;
|
|
259
263
|
}
|
|
260
264
|
}
|
|
@@ -269,9 +273,12 @@
|
|
|
269
273
|
}
|
|
270
274
|
|
|
271
275
|
&__play-button_body {
|
|
272
|
-
bottom: -8px;
|
|
273
276
|
position: relative;
|
|
274
277
|
|
|
278
|
+
&__portrait {
|
|
279
|
+
bottom: -8px;
|
|
280
|
+
}
|
|
281
|
+
|
|
275
282
|
.play-button {
|
|
276
283
|
@extend %lt-player-btn;
|
|
277
284
|
@include yellow-btn;
|
|
@@ -91,6 +91,7 @@
|
|
|
91
91
|
|
|
92
92
|
|
|
93
93
|
.lt-player-rewind-area {
|
|
94
|
+
touch-action: inherit!important;
|
|
94
95
|
width: 100%;
|
|
95
96
|
height: 100%;
|
|
96
97
|
z-index: 3;
|
|
@@ -98,14 +99,15 @@
|
|
|
98
99
|
|
|
99
100
|
.lt-player-rewind {
|
|
100
101
|
width: 50%;
|
|
101
|
-
height:
|
|
102
|
+
height: 130%;
|
|
103
|
+
top: -10rem;
|
|
102
104
|
display:flex;
|
|
103
105
|
flex-direction: row;
|
|
104
106
|
position: absolute;
|
|
105
107
|
text-align: center;
|
|
106
108
|
border-radius:0 100% 100% 0;
|
|
107
109
|
left: 0;
|
|
108
|
-
|
|
110
|
+
|
|
109
111
|
|
|
110
112
|
&__icon-wrapper {
|
|
111
113
|
display: flex;
|
|
@@ -125,9 +127,17 @@
|
|
|
125
127
|
display: flex;
|
|
126
128
|
justify-content:flex-start;
|
|
127
129
|
align-items:center;
|
|
128
|
-
|
|
130
|
+
|
|
129
131
|
color: rgba(255,255,255, 1);
|
|
130
132
|
user-select: none;
|
|
133
|
+
|
|
134
|
+
&__portrait {
|
|
135
|
+
margin: auto auto 18rem 3rem;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&__landscape {
|
|
139
|
+
margin: auto auto 13rem 4rem;
|
|
140
|
+
}
|
|
131
141
|
}
|
|
132
142
|
|
|
133
143
|
span {
|
|
@@ -138,6 +148,7 @@
|
|
|
138
148
|
}
|
|
139
149
|
|
|
140
150
|
.lt-player-forward-area {
|
|
151
|
+
touch-action: inherit!important;
|
|
141
152
|
width: 100%;
|
|
142
153
|
height: 100%;
|
|
143
154
|
z-index: 4;
|
|
@@ -145,14 +156,14 @@
|
|
|
145
156
|
|
|
146
157
|
.lt-player-forward {
|
|
147
158
|
width: 50%;
|
|
148
|
-
height:
|
|
159
|
+
height: 130%;
|
|
160
|
+
top: -10rem;
|
|
149
161
|
display:flex;
|
|
150
162
|
flex-direction: row;
|
|
151
163
|
position: absolute;
|
|
152
164
|
text-align: center;
|
|
153
165
|
border-radius:100% 0 0 100%;
|
|
154
166
|
right: 0;
|
|
155
|
-
top: 0;
|
|
156
167
|
|
|
157
168
|
&__icon-wrapper {
|
|
158
169
|
display: flex;
|
|
@@ -171,8 +182,17 @@
|
|
|
171
182
|
display: flex;
|
|
172
183
|
justify-content:flex-start;
|
|
173
184
|
align-items:center;
|
|
174
|
-
|
|
185
|
+
|
|
175
186
|
color: rgba(255,255,255, 1);
|
|
187
|
+
|
|
188
|
+
&__portrait {
|
|
189
|
+
margin: auto 3rem 18rem auto;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
&__landscape {
|
|
193
|
+
margin: auto 4rem 13rem auto;
|
|
194
|
+
}
|
|
195
|
+
|
|
176
196
|
}
|
|
177
197
|
|
|
178
198
|
span{
|
|
@@ -183,7 +203,7 @@
|
|
|
183
203
|
|
|
184
204
|
|
|
185
205
|
.lt-player-notify {
|
|
186
|
-
transition: background 0.
|
|
206
|
+
transition: background 0.8s;
|
|
187
207
|
//background: rgba(200,200,200,.4) radial-gradient(circle, transparent 1%, rgba(200,200,200,.4) 1%) center/15000%;
|
|
188
208
|
opacity: 0;
|
|
189
209
|
//opacity: 1;
|
|
@@ -155,6 +155,8 @@ export namespace LTPlayerAdditionalInfo {
|
|
|
155
155
|
window.Player.players.forEach( item => {item.plyr.pause()});
|
|
156
156
|
|
|
157
157
|
__this.dragCloseModal(controller);
|
|
158
|
+
|
|
159
|
+
controller.playerInstance.playerControl.mobileEvents.showControls(controller.playerInstance)
|
|
158
160
|
})
|
|
159
161
|
}
|
|
160
162
|
})
|
|
@@ -173,8 +175,7 @@ export namespace LTPlayerAdditionalInfo {
|
|
|
173
175
|
if (playerControlsContainer.classList.contains('player-lt__modal__mobile-show-modal')) {
|
|
174
176
|
|
|
175
177
|
modal.style.removeProperty('bottom')
|
|
176
|
-
playerControlsContainer.classList.remove('plyr__controls-enable-addInfo')
|
|
177
|
-
|
|
178
|
+
playerControlsContainer.classList.remove('plyr__controls-enable-addInfo');
|
|
178
179
|
|
|
179
180
|
setTimeout(() => {
|
|
180
181
|
const modalBody = playerControlsContainer.querySelector('.player-lt__modal__mobile');
|
|
@@ -93,7 +93,7 @@ export class LTPlayerChapters {
|
|
|
93
93
|
return;
|
|
94
94
|
}
|
|
95
95
|
if (leftButton.dataset.ltPlayerChaptertimestamp) {
|
|
96
|
-
player.currentTime = parseFloat(leftButton.dataset.ltPlayerChaptertimestamp);
|
|
96
|
+
player.currentTime = parseFloat(leftButton.dataset.ltPlayerChaptertimestamp) + 0.1;
|
|
97
97
|
}
|
|
98
98
|
})
|
|
99
99
|
|
|
@@ -116,7 +116,7 @@ export class LTPlayerChapters {
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
if (rightButton.dataset.ltPlayerChaptertimestamp) {
|
|
119
|
-
player.currentTime = parseFloat(rightButton.dataset.ltPlayerChaptertimestamp);
|
|
119
|
+
player.currentTime = parseFloat(rightButton.dataset.ltPlayerChaptertimestamp) + 0.1;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
})
|
|
@@ -140,8 +140,10 @@ export class LTPlayerChapters {
|
|
|
140
140
|
return;
|
|
141
141
|
}
|
|
142
142
|
if (leftButton.dataset.ltPlayerChaptertimestamp) {
|
|
143
|
-
player.currentTime = parseFloat(leftButton.dataset.ltPlayerChaptertimestamp);
|
|
143
|
+
player.currentTime = parseFloat(leftButton.dataset.ltPlayerChaptertimestamp) + 0.1;
|
|
144
144
|
}
|
|
145
|
+
|
|
146
|
+
instance.playerControl.mobileEvents.showControls(instance);
|
|
145
147
|
})
|
|
146
148
|
}
|
|
147
149
|
}
|
|
@@ -167,8 +169,10 @@ export class LTPlayerChapters {
|
|
|
167
169
|
}
|
|
168
170
|
|
|
169
171
|
if (rightButton.dataset.ltPlayerChaptertimestamp) {
|
|
170
|
-
player.currentTime = parseFloat(rightButton.dataset.ltPlayerChaptertimestamp);
|
|
172
|
+
player.currentTime = parseFloat(rightButton.dataset.ltPlayerChaptertimestamp) + 0.1;
|
|
171
173
|
}
|
|
174
|
+
|
|
175
|
+
instance.playerControl.mobileEvents.showControls(instance);
|
|
172
176
|
})
|
|
173
177
|
}
|
|
174
178
|
}
|
|
@@ -29,29 +29,23 @@ export namespace LTPlayerControlsEvents {
|
|
|
29
29
|
|
|
30
30
|
playPause(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType) {
|
|
31
31
|
|
|
32
|
-
const
|
|
33
|
-
const pauseInfoIcon = instance.plyr.elements.controls.querySelector('.player-state__pause-icon');
|
|
32
|
+
const icons = instance.iconService.getIconsByComponent('playPause') as {play : string, pause: string};
|
|
34
33
|
const playerStateInfo = instance.plyr.elements.controls.querySelector('.player-state');
|
|
34
|
+
const iconSelector: HTMLImageElement = playerStateInfo.querySelector('.player-state__icon');
|
|
35
35
|
|
|
36
36
|
const removeStateButtons = () => {
|
|
37
37
|
setTimeout(() => {
|
|
38
38
|
playerStateInfo.classList.remove('active');
|
|
39
|
-
|
|
40
|
-
playInfoIcon.classList.add('d-none');
|
|
41
|
-
pauseInfoIcon.classList.add('d-none');
|
|
42
|
-
}, 500)
|
|
43
|
-
}, 500)
|
|
44
|
-
|
|
39
|
+
}, 200)
|
|
45
40
|
}
|
|
46
41
|
|
|
47
|
-
|
|
48
42
|
if (instance.plyr.playing) {
|
|
49
|
-
|
|
43
|
+
iconSelector.src = icons.pause;
|
|
50
44
|
playerStateInfo.classList.add('active');
|
|
51
45
|
instance.plyr.togglePlay(false);
|
|
52
46
|
removeStateButtons();
|
|
53
47
|
} else {
|
|
54
|
-
|
|
48
|
+
iconSelector.src = icons.play;
|
|
55
49
|
playerStateInfo.classList.add('active');
|
|
56
50
|
instance.plyr.togglePlay(true);
|
|
57
51
|
removeStateButtons();
|
|
@@ -94,7 +88,6 @@ export namespace LTPlayerControlsEvents {
|
|
|
94
88
|
constructor() {
|
|
95
89
|
this.common = new Common();
|
|
96
90
|
}
|
|
97
|
-
|
|
98
91
|
subtitles(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType) {
|
|
99
92
|
|
|
100
93
|
const playerContainer = instance.plyr.elements.container;
|
|
@@ -166,9 +159,23 @@ export namespace LTPlayerControlsEvents {
|
|
|
166
159
|
}
|
|
167
160
|
|
|
168
161
|
playPauseIcon(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType, type: string) {
|
|
162
|
+
let common = this.common;
|
|
169
163
|
switch (type) {
|
|
170
164
|
case 'timeupdate':
|
|
171
165
|
this.common.playPauseIconTimeUpdate(instance);
|
|
166
|
+
break
|
|
167
|
+
case 'ready':
|
|
168
|
+
const playButton = instance.plyr.elements.controls.querySelector('.play-button');
|
|
169
|
+
if (playButton) {
|
|
170
|
+
playButton.addEventListener('click', function LTPlayerPlayButton() {
|
|
171
|
+
if (instance.plyr.playing) {
|
|
172
|
+
instance.plyr.togglePlay(false);
|
|
173
|
+
} else {
|
|
174
|
+
instance.plyr.togglePlay(true);
|
|
175
|
+
}
|
|
176
|
+
common.playPauseIconTimeUpdate(instance);
|
|
177
|
+
})
|
|
178
|
+
}
|
|
172
179
|
}
|
|
173
180
|
}
|
|
174
181
|
|
|
@@ -180,22 +187,34 @@ export namespace LTPlayerControlsEvents {
|
|
|
180
187
|
if (selectors.forwardArea) {
|
|
181
188
|
selectors.forwardArea.addEventListener('dblclick', function LTPlayerForwardDbClick(event) {
|
|
182
189
|
event.preventDefault();
|
|
190
|
+
|
|
191
|
+
const playerState = selectors.playerControlsContainer.querySelector('.lt-player-notification__notification-button-state');
|
|
192
|
+
|
|
193
|
+
if (playerState && !playerState.classList.contains('d-none')) {
|
|
194
|
+
playerState.classList.add('d-none');
|
|
195
|
+
}
|
|
196
|
+
|
|
183
197
|
common.backwardRewind.animateNotificationIn(selectors.forwardAnimation);
|
|
184
198
|
common.backwardRewind.updateCurrentTime(instance, 10);
|
|
185
199
|
setTimeout(() => {
|
|
186
|
-
common.backwardRewind.animateNotificationOut(selectors.forwardAnimation)
|
|
200
|
+
common.backwardRewind.animateNotificationOut(selectors.forwardAnimation);
|
|
201
|
+
playerState.classList.remove('d-none');
|
|
187
202
|
}, 500)
|
|
188
203
|
})
|
|
189
204
|
|
|
190
205
|
selectors.forwardArea.addEventListener('click', function LTPlayerForwardClick(event) {
|
|
191
206
|
event.preventDefault();
|
|
192
|
-
const volumeControlArea = selectors.playerControlsContainer.querySelector('.bottom-controller__volume_control');
|
|
193
207
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
208
|
+
setTimeout(() => {
|
|
209
|
+
const volumeControlArea = selectors.playerControlsContainer.querySelector('.bottom-controller__volume_control');
|
|
210
|
+
|
|
211
|
+
if (volumeControlArea) {
|
|
212
|
+
if (!volumeControlArea.classList.contains('volume-control-enable')) {
|
|
213
|
+
common.backwardRewind.playPause(instance);
|
|
214
|
+
}
|
|
197
215
|
}
|
|
198
|
-
}
|
|
216
|
+
}, 100)
|
|
217
|
+
|
|
199
218
|
|
|
200
219
|
})
|
|
201
220
|
}
|
|
@@ -204,22 +223,35 @@ export namespace LTPlayerControlsEvents {
|
|
|
204
223
|
|
|
205
224
|
selectors.rewindArea.addEventListener('dblclick', function LTPlayerRewindDbClick(event) {
|
|
206
225
|
event.preventDefault();
|
|
226
|
+
|
|
227
|
+
const playerState = selectors.playerControlsContainer.querySelector('.lt-player-notification__notification-button-state');
|
|
228
|
+
|
|
229
|
+
if (playerState && !playerState.classList.contains('d-none')) {
|
|
230
|
+
playerState.classList.add('d-none');
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
|
|
207
234
|
common.backwardRewind.animateNotificationIn(selectors.rewindAnimation);
|
|
208
235
|
common.backwardRewind.updateCurrentTime(instance, -10);
|
|
209
236
|
setTimeout(() => {
|
|
210
|
-
common.backwardRewind.animateNotificationOut(selectors.rewindAnimation)
|
|
237
|
+
common.backwardRewind.animateNotificationOut(selectors.rewindAnimation);
|
|
238
|
+
playerState.classList.remove('d-none');
|
|
211
239
|
}, 500)
|
|
212
240
|
})
|
|
213
241
|
|
|
214
242
|
selectors.rewindArea.addEventListener('click', function LTPlayerRewindClick(event) {
|
|
215
243
|
event.preventDefault();
|
|
216
|
-
const volumeControlArea = selectors.playerControlsContainer.querySelector('.bottom-controller__volume_control');
|
|
217
244
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
245
|
+
setTimeout(() => {
|
|
246
|
+
const volumeControlArea = selectors.playerControlsContainer.querySelector('.bottom-controller__volume_control');
|
|
247
|
+
|
|
248
|
+
if (volumeControlArea) {
|
|
249
|
+
if (!volumeControlArea.classList.contains('volume-control-enable')) {
|
|
250
|
+
common.backwardRewind.playPause(instance);
|
|
251
|
+
}
|
|
221
252
|
}
|
|
222
|
-
}
|
|
253
|
+
}, 100)
|
|
254
|
+
|
|
223
255
|
})
|
|
224
256
|
|
|
225
257
|
}
|
|
@@ -434,22 +466,31 @@ export namespace LTPlayerControlsEvents {
|
|
|
434
466
|
clearTimeout(this.controlsTimeOut);
|
|
435
467
|
}
|
|
436
468
|
|
|
437
|
-
this.hideControls(instance);
|
|
469
|
+
this.hideControls(instance, false);
|
|
438
470
|
}
|
|
439
471
|
|
|
440
|
-
hideControls(instance: LTPlayer.PortraitType | LTPlayer.LandscapeType) {
|
|
472
|
+
hideControls(instance: LTPlayer.PortraitType | LTPlayer.LandscapeType, now: boolean) {
|
|
441
473
|
const playerContainer = instance.plyr.elements.container;
|
|
442
474
|
const playerControlsContainer = instance.plyr.elements.controls;
|
|
443
475
|
let playerControlsBackground = playerContainer.querySelector('.plyr__controls__mobile-background');
|
|
444
476
|
|
|
445
477
|
if (!playerControlsContainer.classList.contains('plyr__controls-enable-addInfo')) {
|
|
446
|
-
|
|
478
|
+
|
|
479
|
+
if (now) {
|
|
447
480
|
playerControlsContainer.classList.remove('plyr__controls-enable');
|
|
448
481
|
playerContainer.classList.add('plyr--hide-controls');
|
|
449
482
|
if (!playerControlsContainer.classList.contains('player-lt__modal__mobile-show-modal')) {
|
|
450
483
|
playerControlsBackground.classList.remove('d-none');
|
|
451
484
|
}
|
|
452
|
-
}
|
|
485
|
+
} else {
|
|
486
|
+
this.controlsTimeOut = setTimeout(() => {
|
|
487
|
+
playerControlsContainer.classList.remove('plyr__controls-enable');
|
|
488
|
+
playerContainer.classList.add('plyr--hide-controls');
|
|
489
|
+
if (!playerControlsContainer.classList.contains('player-lt__modal__mobile-show-modal')) {
|
|
490
|
+
playerControlsBackground.classList.remove('d-none');
|
|
491
|
+
}
|
|
492
|
+
}, 4000);
|
|
493
|
+
}
|
|
453
494
|
}
|
|
454
495
|
}
|
|
455
496
|
|
|
@@ -467,17 +508,17 @@ export namespace LTPlayerControlsEvents {
|
|
|
467
508
|
}
|
|
468
509
|
}
|
|
469
510
|
playPauseIcon(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType, type: string) {
|
|
470
|
-
|
|
471
511
|
let common = this.common;
|
|
512
|
+
let instanceMobile = this;
|
|
472
513
|
|
|
473
514
|
switch (type) {
|
|
474
515
|
case 'timeupdate':
|
|
475
516
|
common.playPauseIconTimeUpdate(instance);
|
|
476
517
|
break
|
|
477
518
|
case 'ready':
|
|
478
|
-
const playButton = instance.plyr.elements.
|
|
519
|
+
const playButton = instance.plyr.elements.controls.querySelector('.play-button');
|
|
479
520
|
let mobileEvent: HammerManager = instance.eventInstance.mobileEvents.setMobileEvent(playButton);
|
|
480
|
-
if (mobileEvent
|
|
521
|
+
if (mobileEvent) {
|
|
481
522
|
mobileEvent.on('singletap', function LTPlayerMobilePLayPauseIcon() {
|
|
482
523
|
if (instance.plyr.playing) {
|
|
483
524
|
instance.plyr.togglePlay(false);
|
|
@@ -485,7 +526,7 @@ export namespace LTPlayerControlsEvents {
|
|
|
485
526
|
instance.plyr.togglePlay(true);
|
|
486
527
|
}
|
|
487
528
|
common.playPauseIconTimeUpdate(instance);
|
|
488
|
-
|
|
529
|
+
instanceMobile.showControls(instance);
|
|
489
530
|
});
|
|
490
531
|
}
|
|
491
532
|
}
|
|
@@ -495,24 +536,17 @@ export namespace LTPlayerControlsEvents {
|
|
|
495
536
|
|
|
496
537
|
let common = this.common;
|
|
497
538
|
const selectors = common.backwardRewind.getSelectors(instance);
|
|
498
|
-
const volumeControlArea = selectors.playerControlsContainer.querySelector('.bottom-controller__volume_control');
|
|
499
539
|
|
|
500
540
|
const singleTapAction = () => {
|
|
501
|
-
|
|
502
|
-
if (volumeControlArea) {
|
|
503
|
-
if (!volumeControlArea.classList.contains('volume-control-enable')) {
|
|
504
|
-
common.backwardRewind.playPause(instance);
|
|
505
|
-
instance.playerControl.mobileEvents.showControls(instance);
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
}
|
|
541
|
+
instance.playerControl.mobileEvents.hideControls(instance, true);
|
|
509
542
|
}
|
|
510
543
|
|
|
511
544
|
if (selectors.forwardArea) {
|
|
512
545
|
|
|
513
546
|
let mobileEvent: HammerManager = instance.eventInstance.mobileEvents.setMobileEvent(selectors.forwardArea);
|
|
514
547
|
|
|
515
|
-
mobileEvent.on('doubletap', function LTPlayerMobileForwardDbClick() {
|
|
548
|
+
mobileEvent.on('doubletap', function LTPlayerMobileForwardDbClick(event) {
|
|
549
|
+
|
|
516
550
|
common.backwardRewind.animateNotificationIn(selectors.forwardAnimation);
|
|
517
551
|
common.backwardRewind.updateCurrentTime(instance, 10);
|
|
518
552
|
setTimeout(() => {
|
|
@@ -521,7 +555,7 @@ export namespace LTPlayerControlsEvents {
|
|
|
521
555
|
instance.playerControl.mobileEvents.showControls(instance);
|
|
522
556
|
})
|
|
523
557
|
|
|
524
|
-
mobileEvent.on('singletap', function LTPlayerMobileForwardDbClick() {
|
|
558
|
+
mobileEvent.on('singletap', function LTPlayerMobileForwardDbClick(event) {
|
|
525
559
|
singleTapAction();
|
|
526
560
|
})
|
|
527
561
|
}
|
|
@@ -530,7 +564,8 @@ export namespace LTPlayerControlsEvents {
|
|
|
530
564
|
|
|
531
565
|
let mobileEvent: HammerManager = instance.eventInstance.mobileEvents.setMobileEvent(selectors.rewindArea);
|
|
532
566
|
|
|
533
|
-
mobileEvent.on('doubletap', function LTPlayerMobileRewindDbClick() {
|
|
567
|
+
mobileEvent.on('doubletap', function LTPlayerMobileRewindDbClick(event) {
|
|
568
|
+
|
|
534
569
|
common.backwardRewind.animateNotificationIn(selectors.rewindAnimation);
|
|
535
570
|
common.backwardRewind.updateCurrentTime(instance, -10);
|
|
536
571
|
setTimeout(() => {
|
|
@@ -539,7 +574,8 @@ export namespace LTPlayerControlsEvents {
|
|
|
539
574
|
instance.playerControl.mobileEvents.showControls(instance);
|
|
540
575
|
})
|
|
541
576
|
|
|
542
|
-
mobileEvent.on('singletap', function LTPlayerMobileRewindClick() {
|
|
577
|
+
mobileEvent.on('singletap', function LTPlayerMobileRewindClick(event) {
|
|
578
|
+
|
|
543
579
|
singleTapAction();
|
|
544
580
|
})
|
|
545
581
|
|
|
@@ -65,13 +65,11 @@ export class LTPlayerDesktopSettingsControllers implements SettingsControlsInter
|
|
|
65
65
|
let values:any = [1,1.25,1.50,2];
|
|
66
66
|
|
|
67
67
|
myRange.oninput = function() {
|
|
68
|
-
|
|
69
|
-
player.speed = parseInt(values[rangeInput.value]);
|
|
70
|
-
|
|
68
|
+
player.speed = parseFloat(values[rangeInput.value]);
|
|
71
69
|
myValue.innerHTML = values[rangeInput.value] + 'x';
|
|
72
70
|
};
|
|
73
71
|
|
|
74
|
-
player.speed =
|
|
72
|
+
player.speed = parseFloat(String(values[0]));
|
|
75
73
|
myValue.innerHTML = values[0] + 'x';
|
|
76
74
|
}
|
|
77
75
|
initSaveButton() {
|
|
@@ -56,6 +56,7 @@ export namespace LTPlayerEvents {
|
|
|
56
56
|
const volumeBackground = volumeControl.querySelector('.volume_control__background');
|
|
57
57
|
const volumeBackgroundArea = volumeControl.querySelector('.volume_control__background__area');
|
|
58
58
|
const volumeArea = volumeControl.querySelector('.volume_control__background__area__range');
|
|
59
|
+
const controlsBackground = player.elements.container.querySelector('.plyr__controls__mobile-background');
|
|
59
60
|
|
|
60
61
|
|
|
61
62
|
if (volumeButton) {
|
|
@@ -79,6 +80,12 @@ export namespace LTPlayerEvents {
|
|
|
79
80
|
volumeControl.classList.remove('volume-control-enable');
|
|
80
81
|
}
|
|
81
82
|
|
|
83
|
+
if (controlsBackground) {
|
|
84
|
+
if (!controlsBackground.classList.contains('d-none')) {
|
|
85
|
+
controlsBackground.classList.add('d-none');
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
82
89
|
}
|
|
83
90
|
const enablePoster = () => {
|
|
84
91
|
|
|
@@ -16,6 +16,7 @@ export class LTPlayerPosterPreloadEvents {
|
|
|
16
16
|
playerContainer.querySelector(`.lt-player__poster`).insertAdjacentHTML('afterend', LoaderService.getSpinner());
|
|
17
17
|
const preloadData = instance.playerConfig.getPreload();
|
|
18
18
|
const playAutoPreload = () => {
|
|
19
|
+
console.log('preload play')
|
|
19
20
|
if (preloadData.start !== 0) {
|
|
20
21
|
instance.plyr.embed.setCurrentTime(preloadData.start).then(() => {
|
|
21
22
|
instance.plyr.embed.setMuted(true).then(function () {
|
|
@@ -30,13 +31,20 @@ export class LTPlayerPosterPreloadEvents {
|
|
|
30
31
|
LoaderService.removeSpinner(playerContainer)
|
|
31
32
|
} else {
|
|
32
33
|
instance.plyr.volume = 0;
|
|
33
|
-
instance.plyr.embed
|
|
34
|
+
if (instance.plyr.embed) {
|
|
35
|
+
instance.plyr.embed.play().then(function () {
|
|
36
|
+
LoaderService.removeSpinner(playerContainer)
|
|
37
|
+
});
|
|
38
|
+
} else {
|
|
39
|
+
instance.plyr.play()
|
|
34
40
|
LoaderService.removeSpinner(playerContainer)
|
|
35
|
-
}
|
|
41
|
+
}
|
|
42
|
+
|
|
36
43
|
}
|
|
37
44
|
}
|
|
38
45
|
|
|
39
46
|
const pausePreload = () => {
|
|
47
|
+
console.log('preload play')
|
|
40
48
|
if (preloadData.start !== 0) {
|
|
41
49
|
instance.plyr.embed.setCurrentTime(preloadData.start).then( () => {
|
|
42
50
|
instance.plyr.embed.pause().then(function() {
|
|
@@ -45,12 +53,15 @@ export class LTPlayerPosterPreloadEvents {
|
|
|
45
53
|
});
|
|
46
54
|
});
|
|
47
55
|
} else {
|
|
48
|
-
instance.plyr.
|
|
49
|
-
|
|
56
|
+
if (instance.plyr.embed) {
|
|
57
|
+
instance.plyr.embed.pause().then(function () {
|
|
58
|
+
LoaderService.removeSpinner(playerContainer)
|
|
59
|
+
});
|
|
60
|
+
} else {
|
|
61
|
+
instance.plyr.pause()
|
|
50
62
|
LoaderService.removeSpinner(playerContainer)
|
|
51
|
-
}
|
|
63
|
+
}
|
|
52
64
|
}
|
|
53
|
-
|
|
54
65
|
LoaderService.removeSpinner(playerContainer)
|
|
55
66
|
}
|
|
56
67
|
|
|
@@ -33,6 +33,11 @@ export class IconsService {
|
|
|
33
33
|
'university',
|
|
34
34
|
]
|
|
35
35
|
|
|
36
|
+
playPause = [
|
|
37
|
+
'play',
|
|
38
|
+
'pause'
|
|
39
|
+
]
|
|
40
|
+
|
|
36
41
|
constructor() {
|
|
37
42
|
this.path = require.context('../assets/icons', false);
|
|
38
43
|
}
|
|
@@ -86,6 +91,16 @@ export class IconsService {
|
|
|
86
91
|
}
|
|
87
92
|
})
|
|
88
93
|
})
|
|
94
|
+
break
|
|
95
|
+
case 'playPause':
|
|
96
|
+
this.path.keys().forEach(item => {
|
|
97
|
+
this.playPause.forEach(mapElement => {
|
|
98
|
+
let name = item.replace(/(\.(?:jpg|png|svg))$/i, "").replace('./', '');
|
|
99
|
+
if (name === mapElement) {
|
|
100
|
+
Object.assign(response, {[name] : this.path(item)})
|
|
101
|
+
}
|
|
102
|
+
})
|
|
103
|
+
})
|
|
89
104
|
}
|
|
90
105
|
|
|
91
106
|
|