@latest-thinking/lt-player 1.0.4-l → 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 +11 -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 +28 -8
- package/src/components/LTPlayerManager.ts +12 -5
- package/src/components/LTPlayerSetup.ts +5 -5
- package/src/components/addInfo/LTPlayerAdditionalInfoEvents.ts +6 -2
- package/src/components/controls/LTPlayerChapters.ts +8 -4
- package/src/components/controls/LTPlayerControlsEvents.ts +115 -59
- package/src/components/controls/settings/LTPlayerDesktopSettingsControllers.ts +2 -4
- package/src/components/controls/settings/LTPlayerMobileSettingsControllers.ts +2 -0
- 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 +8 -1
- package/src/views/controls.handlebars +16 -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;
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
|
|
45
45
|
.player-state {
|
|
46
46
|
opacity: 0;
|
|
47
|
-
transition: all 0.
|
|
47
|
+
transition: all 0.8s ease-in-out;
|
|
48
48
|
pointer-events: none;
|
|
49
49
|
@extend %lt-player-btn;
|
|
50
50
|
@include dark-btn;
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
|
|
55
55
|
.active {
|
|
56
56
|
opacity: 1;
|
|
57
|
-
transition: all 0.
|
|
57
|
+
transition: all 0.2s ease-in-out;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
|
|
@@ -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{
|
|
@@ -114,11 +114,18 @@ export class LTPlayerManager {
|
|
|
114
114
|
|
|
115
115
|
const setup = new LTPlayerSetup();
|
|
116
116
|
|
|
117
|
-
return new Promise(resolve => {
|
|
118
|
-
setup.init(playerConfig)
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
117
|
+
return new Promise((resolve, reject) => {
|
|
118
|
+
let setupPLayer = setup.init(playerConfig);
|
|
119
|
+
|
|
120
|
+
if (setupPLayer) {
|
|
121
|
+
setupPLayer.then( result => {
|
|
122
|
+
this.players.push(result);
|
|
123
|
+
resolve(result);
|
|
124
|
+
})
|
|
125
|
+
} else {
|
|
126
|
+
reject('Player is not setup')
|
|
127
|
+
}
|
|
128
|
+
|
|
122
129
|
})
|
|
123
130
|
|
|
124
131
|
|
|
@@ -65,16 +65,16 @@ export class LTPlayerSetup {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
if (!playerConfig.body.playerType) {
|
|
68
|
-
return new Promise(resolve => {
|
|
68
|
+
return new Promise((resolve, reject) => {
|
|
69
69
|
playerConfig.body.playerType = this.getVideoTypeByUrl(playerConfig.body.videoUrl).then(response => {
|
|
70
70
|
playerConfig.body.playerType = response;
|
|
71
|
-
resolve(this.setType(playerConfig, playerContainer))
|
|
71
|
+
resolve(this.setType(playerConfig, playerContainer));
|
|
72
72
|
});
|
|
73
73
|
})
|
|
74
74
|
} else {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
return new Promise((resolve, reject) => {
|
|
76
|
+
resolve(this.setType(playerConfig, playerContainer));
|
|
77
|
+
reject(null);
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
}
|
|
@@ -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');
|
|
@@ -186,6 +187,9 @@ export namespace LTPlayerAdditionalInfo {
|
|
|
186
187
|
if (background) {
|
|
187
188
|
background.classList.add('d-none');
|
|
188
189
|
}
|
|
190
|
+
|
|
191
|
+
controller.playerInstance.playerControl.mobileEvents.showControls(controller.playerInstance);
|
|
192
|
+
|
|
189
193
|
}, 150)
|
|
190
194
|
|
|
191
195
|
}
|
|
@@ -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
|
-
}, 300)
|
|
43
|
-
}, 300)
|
|
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
|
}
|
|
@@ -375,27 +407,29 @@ export namespace LTPlayerControlsEvents {
|
|
|
375
407
|
}
|
|
376
408
|
seekBar(instance: LTPlayer.PortraitType | LTPlayer.LandscapeType) {
|
|
377
409
|
const playerControlsContainer = instance.plyr.elements.controls;
|
|
378
|
-
const seekBar = playerControlsContainer.querySelector('.plyr__progress__seek');
|
|
410
|
+
const seekBar: HTMLInputElement = playerControlsContainer.querySelector('.plyr__progress__seek');
|
|
379
411
|
const rangeTouch = require('rangetouch');
|
|
380
412
|
rangeTouch.setup(seekBar);
|
|
413
|
+
const __this = this;
|
|
414
|
+
seekBar.addEventListener('change', () => {
|
|
415
|
+
__this.showControls(instance);
|
|
416
|
+
})
|
|
417
|
+
|
|
381
418
|
}
|
|
382
419
|
|
|
383
420
|
controlsTimeShow(instance: LTPlayer.PortraitType | LTPlayer.LandscapeType) {
|
|
384
421
|
const playerContainer = instance.plyr.elements.container;
|
|
385
|
-
const
|
|
422
|
+
const playerControlsBackground = playerContainer.querySelector('.plyr__controls__mobile-background');
|
|
386
423
|
const __this = this;
|
|
424
|
+
if (playerControlsBackground) {
|
|
425
|
+
let mobileEvent: HammerManager = instance.eventInstance.mobileEvents.setMobileEvent(playerControlsBackground);
|
|
387
426
|
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
if (mobileEvent) {
|
|
391
|
-
mobileEvent.on('singletap', function LTPlayerMobileFullScreen() {
|
|
392
|
-
|
|
393
|
-
if (!playerContainer.classList.contains('plyr__controls-enable')) {
|
|
427
|
+
if (mobileEvent) {
|
|
428
|
+
mobileEvent.on('singletap', function LTPlayerMobileBack() {
|
|
394
429
|
__this.showControls(instance);
|
|
395
|
-
}
|
|
396
|
-
}
|
|
430
|
+
})
|
|
431
|
+
}
|
|
397
432
|
}
|
|
398
|
-
|
|
399
433
|
}
|
|
400
434
|
|
|
401
435
|
removePlyrControlsClass(instance: LTPlayer.PortraitType | LTPlayer.LandscapeType) {
|
|
@@ -410,11 +444,19 @@ export namespace LTPlayerControlsEvents {
|
|
|
410
444
|
|
|
411
445
|
|
|
412
446
|
showControls(instance: LTPlayer.PortraitType | LTPlayer.LandscapeType) {
|
|
413
|
-
|
|
414
447
|
const playerContainer = instance.plyr.elements.container;
|
|
415
448
|
const playerControlsContainer = instance.plyr.elements.controls;
|
|
449
|
+
let playerControlsBackground = playerContainer.querySelector('.plyr__controls__mobile-background');
|
|
416
450
|
|
|
417
|
-
playerContainer.classList.
|
|
451
|
+
if (playerContainer.classList.contains('plyr--hide-controls')) {
|
|
452
|
+
playerContainer.classList.remove('plyr--hide-controls');
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
if (playerControlsBackground) {
|
|
456
|
+
if (!playerControlsBackground.classList.contains('d-none')) {
|
|
457
|
+
playerControlsBackground.classList.add('d-none');
|
|
458
|
+
}
|
|
459
|
+
}
|
|
418
460
|
|
|
419
461
|
if (!playerControlsContainer.classList.contains('plyr__controls-enable')) {
|
|
420
462
|
playerControlsContainer.classList.add('plyr__controls-enable');
|
|
@@ -424,17 +466,32 @@ export namespace LTPlayerControlsEvents {
|
|
|
424
466
|
clearTimeout(this.controlsTimeOut);
|
|
425
467
|
}
|
|
426
468
|
|
|
427
|
-
this.hideControls(instance);
|
|
469
|
+
this.hideControls(instance, false);
|
|
428
470
|
}
|
|
429
471
|
|
|
430
|
-
hideControls(instance: LTPlayer.PortraitType | LTPlayer.LandscapeType) {
|
|
472
|
+
hideControls(instance: LTPlayer.PortraitType | LTPlayer.LandscapeType, now: boolean) {
|
|
431
473
|
const playerContainer = instance.plyr.elements.container;
|
|
432
474
|
const playerControlsContainer = instance.plyr.elements.controls;
|
|
433
|
-
|
|
434
|
-
playerControlsContainer.classList.remove('plyr__controls-enable');
|
|
435
|
-
playerContainer.classList.add('plyr--hide-controls');
|
|
436
|
-
}, 4000);
|
|
475
|
+
let playerControlsBackground = playerContainer.querySelector('.plyr__controls__mobile-background');
|
|
437
476
|
|
|
477
|
+
if (!playerControlsContainer.classList.contains('plyr__controls-enable-addInfo')) {
|
|
478
|
+
|
|
479
|
+
if (now) {
|
|
480
|
+
playerControlsContainer.classList.remove('plyr__controls-enable');
|
|
481
|
+
playerContainer.classList.add('plyr--hide-controls');
|
|
482
|
+
if (!playerControlsContainer.classList.contains('player-lt__modal__mobile-show-modal')) {
|
|
483
|
+
playerControlsBackground.classList.remove('d-none');
|
|
484
|
+
}
|
|
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
|
+
}
|
|
494
|
+
}
|
|
438
495
|
}
|
|
439
496
|
|
|
440
497
|
fullScreenButtons(instance: LTPlayer.PortraitType | LTPlayer.LandscapeType) {
|
|
@@ -451,17 +508,17 @@ export namespace LTPlayerControlsEvents {
|
|
|
451
508
|
}
|
|
452
509
|
}
|
|
453
510
|
playPauseIcon(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType, type: string) {
|
|
454
|
-
|
|
455
511
|
let common = this.common;
|
|
512
|
+
let instanceMobile = this;
|
|
456
513
|
|
|
457
514
|
switch (type) {
|
|
458
515
|
case 'timeupdate':
|
|
459
516
|
common.playPauseIconTimeUpdate(instance);
|
|
460
517
|
break
|
|
461
518
|
case 'ready':
|
|
462
|
-
const playButton = instance.plyr.elements.
|
|
519
|
+
const playButton = instance.plyr.elements.controls.querySelector('.play-button');
|
|
463
520
|
let mobileEvent: HammerManager = instance.eventInstance.mobileEvents.setMobileEvent(playButton);
|
|
464
|
-
if (mobileEvent
|
|
521
|
+
if (mobileEvent) {
|
|
465
522
|
mobileEvent.on('singletap', function LTPlayerMobilePLayPauseIcon() {
|
|
466
523
|
if (instance.plyr.playing) {
|
|
467
524
|
instance.plyr.togglePlay(false);
|
|
@@ -469,6 +526,7 @@ export namespace LTPlayerControlsEvents {
|
|
|
469
526
|
instance.plyr.togglePlay(true);
|
|
470
527
|
}
|
|
471
528
|
common.playPauseIconTimeUpdate(instance);
|
|
529
|
+
instanceMobile.showControls(instance);
|
|
472
530
|
});
|
|
473
531
|
}
|
|
474
532
|
}
|
|
@@ -478,32 +536,26 @@ export namespace LTPlayerControlsEvents {
|
|
|
478
536
|
|
|
479
537
|
let common = this.common;
|
|
480
538
|
const selectors = common.backwardRewind.getSelectors(instance);
|
|
481
|
-
const volumeControlArea = selectors.playerControlsContainer.querySelector('.bottom-controller__volume_control');
|
|
482
539
|
|
|
483
540
|
const singleTapAction = () => {
|
|
484
|
-
|
|
485
|
-
if (volumeControlArea) {
|
|
486
|
-
if (!volumeControlArea.classList.contains('volume-control-enable')) {
|
|
487
|
-
common.backwardRewind.playPause(instance);
|
|
488
|
-
instance.playerControl.mobileEvents.showControls(instance);
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
}
|
|
541
|
+
instance.playerControl.mobileEvents.hideControls(instance, true);
|
|
492
542
|
}
|
|
493
543
|
|
|
494
544
|
if (selectors.forwardArea) {
|
|
495
545
|
|
|
496
546
|
let mobileEvent: HammerManager = instance.eventInstance.mobileEvents.setMobileEvent(selectors.forwardArea);
|
|
497
547
|
|
|
498
|
-
mobileEvent.on('doubletap', function LTPlayerMobileForwardDbClick() {
|
|
548
|
+
mobileEvent.on('doubletap', function LTPlayerMobileForwardDbClick(event) {
|
|
549
|
+
|
|
499
550
|
common.backwardRewind.animateNotificationIn(selectors.forwardAnimation);
|
|
500
551
|
common.backwardRewind.updateCurrentTime(instance, 10);
|
|
501
552
|
setTimeout(() => {
|
|
502
553
|
common.backwardRewind.animateNotificationOut(selectors.forwardAnimation)
|
|
503
554
|
}, 500)
|
|
555
|
+
instance.playerControl.mobileEvents.showControls(instance);
|
|
504
556
|
})
|
|
505
557
|
|
|
506
|
-
mobileEvent.on('singletap', function LTPlayerMobileForwardDbClick() {
|
|
558
|
+
mobileEvent.on('singletap', function LTPlayerMobileForwardDbClick(event) {
|
|
507
559
|
singleTapAction();
|
|
508
560
|
})
|
|
509
561
|
}
|
|
@@ -512,15 +564,18 @@ export namespace LTPlayerControlsEvents {
|
|
|
512
564
|
|
|
513
565
|
let mobileEvent: HammerManager = instance.eventInstance.mobileEvents.setMobileEvent(selectors.rewindArea);
|
|
514
566
|
|
|
515
|
-
mobileEvent.on('doubletap', function LTPlayerMobileRewindDbClick() {
|
|
567
|
+
mobileEvent.on('doubletap', function LTPlayerMobileRewindDbClick(event) {
|
|
568
|
+
|
|
516
569
|
common.backwardRewind.animateNotificationIn(selectors.rewindAnimation);
|
|
517
570
|
common.backwardRewind.updateCurrentTime(instance, -10);
|
|
518
571
|
setTimeout(() => {
|
|
519
572
|
common.backwardRewind.animateNotificationOut(selectors.rewindAnimation)
|
|
520
573
|
}, 500)
|
|
574
|
+
instance.playerControl.mobileEvents.showControls(instance);
|
|
521
575
|
})
|
|
522
576
|
|
|
523
|
-
mobileEvent.on('singletap', function LTPlayerMobileRewindClick() {
|
|
577
|
+
mobileEvent.on('singletap', function LTPlayerMobileRewindClick(event) {
|
|
578
|
+
|
|
524
579
|
singleTapAction();
|
|
525
580
|
})
|
|
526
581
|
|
|
@@ -586,6 +641,7 @@ export namespace LTPlayerControlsEvents {
|
|
|
586
641
|
mobileEvent.on('singletap', function LTPlayerMobileRewindClick() {
|
|
587
642
|
let volumeState = setVolume();
|
|
588
643
|
setVolumeIcon(volumeState);
|
|
644
|
+
instance.playerControl.mobileEvents.showControls(instance);
|
|
589
645
|
})
|
|
590
646
|
|
|
591
647
|
}
|
|
@@ -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() {
|