@latest-thinking/lt-player 1.1.0-o → 1.1.0-p
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/ README.md +80 -51
- 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/examples/portrait-with-subtitles.html +4 -2
- package/package.json +1 -1
- package/src/assets/sass/sections/_poster.scss +0 -67
- package/src/assets/sass/sections/controllers/_botom.scss +10 -1
- package/src/assets/sass/sections/controllers/_notification-rewind-forward.scss +5 -1
- package/src/components/LTPlayerUpdate.ts +12 -0
- package/src/components/config/LTPlayerConfig.ts +13 -3
- package/src/components/config/LTPlayerConfigProcessor.ts +1 -2
- package/src/components/controls/LTPlayerControls.ts +2 -0
- package/src/components/controls/LTPlayerControlsEvents.ts +174 -57
|
@@ -15,7 +15,9 @@
|
|
|
15
15
|
data-lt-player-config='{
|
|
16
16
|
"version": 2,
|
|
17
17
|
"body": {
|
|
18
|
-
"
|
|
18
|
+
"pinText" : true,
|
|
19
|
+
"pinSeekBar" : false,
|
|
20
|
+
"pinControls" : false,
|
|
19
21
|
"embed": false,
|
|
20
22
|
"playerType": "portrait",
|
|
21
23
|
"chapters": [
|
|
@@ -42,11 +44,11 @@
|
|
|
42
44
|
"srclang": "en"
|
|
43
45
|
}
|
|
44
46
|
},
|
|
45
|
-
"removeFromInterfaceToggle": ["text", "progressBar", "controls"],
|
|
46
47
|
"videoTitle": "Maja Adena",
|
|
47
48
|
"posterImage": "https://web.lt.dev.welink.sh/sites/default/files/2023-09/Video%201.00_00_00_00.Standbild001.jpg",
|
|
48
49
|
"videoParagraph": "What Are Some Unintended Consequences of Pension Reform?",
|
|
49
50
|
"videoUrl": "https://player.vimeo.com/external/837554695.m3u8?s=0c690ee7961cdfabf925774a536d2376e155d7fe",
|
|
51
|
+
"tracks": "https://web.lt.dev.welink.sh/sites/default/files/video-short/subtitles/Pahl-Kerstin-Maria-MAIN-20230320.vtt",
|
|
50
52
|
"fullscreenDisabled": true,
|
|
51
53
|
"share": [],
|
|
52
54
|
"additionalInfo": {
|
package/package.json
CHANGED
|
@@ -317,70 +317,3 @@
|
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
319
|
|
|
320
|
-
.plyr__controls {
|
|
321
|
-
opacity: 1 !important;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
.plyr__controls {
|
|
326
|
-
.top-controllers {
|
|
327
|
-
//position: unset !important;
|
|
328
|
-
//margin-bottom: auto;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
.bottom-controller {
|
|
332
|
-
//height: unset !important;
|
|
333
|
-
//position: unset !important;
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
.plyr__controls .settings-controllers {
|
|
338
|
-
//padding: 0 !important;
|
|
339
|
-
//position: unset !important;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
.lt-player-orientation--portrait .plyr__progress--wrapper {
|
|
343
|
-
//position: unset !important;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
.lt-player-notification {
|
|
347
|
-
//position: unset !important;
|
|
348
|
-
//width: 100% !important;
|
|
349
|
-
//height: unset !important;
|
|
350
|
-
//display: unset !important;
|
|
351
|
-
//padding: 20px 20px 28px 20px;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
.lt-player-orientation--portrait .lt-player-notification .lt-player-video-content {
|
|
355
|
-
//padding: 0 !important;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
.lt-player-orientation--portrait .plyr__controls .bottom-controller {
|
|
359
|
-
//padding: 0 20px 28px 20px !important;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
.plyr__controls .bottom-controller .volume-control-enable {
|
|
363
|
-
//position: absolute !important;
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
.lt-player-rewind-area {
|
|
367
|
-
//position: absolute;
|
|
368
|
-
//left: 0;
|
|
369
|
-
//width: 50% !important;
|
|
370
|
-
//top: 0;
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
.lt-player-forward-area {
|
|
374
|
-
//position: absolute;
|
|
375
|
-
//right: 0;
|
|
376
|
-
//width: 50% !important;
|
|
377
|
-
//top: 0;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
.lt-player-notification .lt-player-video-content {
|
|
381
|
-
//position: unset !important;
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
.plyr.plyr--full-ui .plyr--video, .plyr__controls {
|
|
385
|
-
//justify-content: unset !important;
|
|
386
|
-
}
|
|
@@ -7,12 +7,17 @@
|
|
|
7
7
|
&--wrapper {
|
|
8
8
|
width: 100%;
|
|
9
9
|
padding: 0 10px;
|
|
10
|
+
display: none;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&--wrapper-enable {
|
|
14
|
+
display: block;
|
|
10
15
|
}
|
|
11
16
|
}
|
|
12
17
|
|
|
13
18
|
&__controls {
|
|
14
19
|
.bottom-controller {
|
|
15
|
-
display:
|
|
20
|
+
display: none;
|
|
16
21
|
justify-content: space-between;
|
|
17
22
|
align-items: flex-end;
|
|
18
23
|
padding: 15px 10px;
|
|
@@ -226,6 +231,10 @@
|
|
|
226
231
|
}
|
|
227
232
|
}
|
|
228
233
|
}
|
|
234
|
+
|
|
235
|
+
.bottom-controller-enable {
|
|
236
|
+
display: flex;
|
|
237
|
+
}
|
|
229
238
|
}
|
|
230
239
|
|
|
231
240
|
.fade-animation-controllers {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
.lt-player-video-content {
|
|
30
30
|
text-align: left;
|
|
31
|
-
display:
|
|
31
|
+
display: none;
|
|
32
32
|
padding: 0;
|
|
33
33
|
width: 100%;
|
|
34
34
|
user-select: none;
|
|
@@ -72,6 +72,10 @@
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
.lt-player-video-content-enable {
|
|
76
|
+
display: flex;
|
|
77
|
+
}
|
|
78
|
+
|
|
75
79
|
.poster-paragraph__button {
|
|
76
80
|
background: none;
|
|
77
81
|
box-shadow: none;
|
|
@@ -12,9 +12,16 @@ export class LTPlayerUpdate {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
updatePlayer(config: defaultType) {
|
|
15
|
+
console.log(config)
|
|
15
16
|
this.updateVideo(config.body.videoUrl, config.body.posterImage);
|
|
16
17
|
this.updateTitle(config.body.videoParagraph);
|
|
17
18
|
this.updateAuthor(config.body.videoTitle);
|
|
19
|
+
if (config.body.defaultConfig) {
|
|
20
|
+
//you should check for subtitles, if there arent any, set the src of the track element to "" else take it from this config. I dont know what works and what doesnt.
|
|
21
|
+
//Have fun, good luck.
|
|
22
|
+
//Otherwise, im not really sure what happens
|
|
23
|
+
this.updateSubtitles(config.body.defaultConfig.captions.url);
|
|
24
|
+
}
|
|
18
25
|
this.updateChapters(config);
|
|
19
26
|
this.player.additionalInfoService.setConfig(config.body.additionalInfo);
|
|
20
27
|
return;
|
|
@@ -52,4 +59,9 @@ export class LTPlayerUpdate {
|
|
|
52
59
|
authorParagraph.textContent = '';
|
|
53
60
|
authorParagraph.textContent = author;
|
|
54
61
|
}
|
|
62
|
+
|
|
63
|
+
updateSubtitles(src: string) {
|
|
64
|
+
const track = document.querySelector('track');
|
|
65
|
+
console.log(track);
|
|
66
|
+
}
|
|
55
67
|
}
|
|
@@ -6,7 +6,9 @@ export class LTPlayerConfig {
|
|
|
6
6
|
|
|
7
7
|
private configData: playerConfigType = {
|
|
8
8
|
version : null,
|
|
9
|
-
|
|
9
|
+
pinText: false,
|
|
10
|
+
pinSeekBar: false,
|
|
11
|
+
pinControls: false,
|
|
10
12
|
embed: false,
|
|
11
13
|
preload: false,
|
|
12
14
|
autoPlay : false,
|
|
@@ -95,8 +97,16 @@ export class LTPlayerConfig {
|
|
|
95
97
|
|
|
96
98
|
}
|
|
97
99
|
|
|
98
|
-
|
|
99
|
-
return this.configData.
|
|
100
|
+
isPinTextControls() {
|
|
101
|
+
return this.configData.pinText
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
isPinSeekBarControls() {
|
|
105
|
+
return this.configData.pinSeekBar
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
isPinBottomControls() {
|
|
109
|
+
return this.configData.pinControls
|
|
100
110
|
}
|
|
101
111
|
|
|
102
112
|
getObjectFit() {
|
|
@@ -15,8 +15,6 @@ export namespace LTPlayerConfigProcessor {
|
|
|
15
15
|
|
|
16
16
|
mapByVersion(name: string, value : any) {
|
|
17
17
|
switch (name) {
|
|
18
|
-
case 'alwaysDisplayControls':
|
|
19
|
-
return value;
|
|
20
18
|
case 'embed':
|
|
21
19
|
return Processor.processEmbed(value, this.version);
|
|
22
20
|
case 'preload':
|
|
@@ -57,6 +55,7 @@ export namespace LTPlayerConfigProcessor {
|
|
|
57
55
|
}
|
|
58
56
|
case 'observe':
|
|
59
57
|
return Processor.processObserve(value, this.version);
|
|
58
|
+
default: return value;
|
|
60
59
|
}
|
|
61
60
|
}
|
|
62
61
|
}
|
|
@@ -14,6 +14,7 @@ export class LTPlayerControls {
|
|
|
14
14
|
chaptersService : LTPlayerChapters
|
|
15
15
|
desktopEvents: LTPlayerControlsEvents.Desktop;
|
|
16
16
|
mobileEvents: LTPlayerControlsEvents.Mobile;
|
|
17
|
+
commonEvents: LTPlayerControlsEvents.Common;
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* Generate Player LTPlayerControls to pass in Plyr
|
|
@@ -22,6 +23,7 @@ export class LTPlayerControls {
|
|
|
22
23
|
constructor(templateService: TemplateService) {
|
|
23
24
|
this.settingsControlsManager = new LTPlayerSettingsControlsManager();
|
|
24
25
|
this.templateService = templateService;
|
|
26
|
+
this.commonEvents = new LTPlayerControlsEvents.Common();
|
|
25
27
|
this.setDesktopEvents();
|
|
26
28
|
this.setMobileEvents();
|
|
27
29
|
|
|
@@ -2,7 +2,7 @@ import {LTPlayer} from "../LTPlayerType";
|
|
|
2
2
|
import {plyr} from "../../global/types/ModuleTypes";
|
|
3
3
|
import * as events from "events";
|
|
4
4
|
|
|
5
|
-
export namespace LTPlayerControlsEvents
|
|
5
|
+
export namespace LTPlayerControlsEvents {
|
|
6
6
|
|
|
7
7
|
export class Common {
|
|
8
8
|
|
|
@@ -10,31 +10,31 @@ export namespace LTPlayerControlsEvents {
|
|
|
10
10
|
|
|
11
11
|
getSelectors(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType) {
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
13
|
+
let selectors = {
|
|
14
|
+
playerContainer: instance.plyr.elements.container,
|
|
15
|
+
playerControlsContainer: instance.plyr.elements.controls,
|
|
16
|
+
forwardArea: instance.plyr.elements.controls.querySelector('.lt-player-forward-area'),
|
|
17
|
+
rewindArea: instance.plyr.elements.controls.querySelector('.lt-player-rewind-area'),
|
|
18
|
+
forwardAnimation: instance.plyr.elements.controls.querySelector('.lt-player-forward'),
|
|
19
|
+
rewindAnimation: instance.plyr.elements.controls.querySelector('.lt-player-rewind'),
|
|
20
|
+
forwardAreaBackground: null as Element,
|
|
21
|
+
rewindAreaBackground: null as Element,
|
|
22
|
+
forwardAnimationBackground: null as Element,
|
|
23
|
+
rewindAnimationBackground: null as Element,
|
|
24
|
+
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (instance.playerConfig.getDevice() === 'mobile') {
|
|
28
|
+
selectors.forwardAreaBackground = instance.plyr.elements.container.querySelector('.plyr__controls__mobile-background').querySelector('.lt-player-forward-area')
|
|
29
|
+
selectors.rewindAreaBackground = instance.plyr.elements.container.querySelector('.plyr__controls__mobile-background').querySelector('.lt-player-rewind-area')
|
|
30
|
+
selectors.forwardAnimationBackground = instance.plyr.elements.container.querySelector('.plyr__controls__mobile-background').querySelector('.lt-player-forward')
|
|
31
|
+
selectors.rewindAnimationBackground = instance.plyr.elements.container.querySelector('.plyr__controls__mobile-background').querySelector('.lt-player-rewind')
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return selectors
|
|
35
35
|
},
|
|
36
36
|
|
|
37
|
-
updateCurrentTime(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType
|
|
37
|
+
updateCurrentTime(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType, time: number) {
|
|
38
38
|
if (Math.sign(time)) {
|
|
39
39
|
instance.plyr.currentTime += time;
|
|
40
40
|
} else {
|
|
@@ -44,7 +44,7 @@ export namespace LTPlayerControlsEvents {
|
|
|
44
44
|
|
|
45
45
|
playPause(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType) {
|
|
46
46
|
|
|
47
|
-
const icons = instance.iconService.getIconsByComponent('playPause') as {play
|
|
47
|
+
const icons = instance.iconService.getIconsByComponent('playPause') as { play: string, pause: string };
|
|
48
48
|
const playerStateInfo = instance.plyr.elements.controls.querySelector('.player-state');
|
|
49
49
|
const iconSelector: HTMLImageElement = playerStateInfo.querySelector('.player-state__icon');
|
|
50
50
|
|
|
@@ -80,7 +80,6 @@ export namespace LTPlayerControlsEvents {
|
|
|
80
80
|
const controlsSelector = instance.plyr.elements.controls;
|
|
81
81
|
const videoTitle = controlsSelector.querySelector('.poster-paragraph__content');
|
|
82
82
|
const readButton = controlsSelector.querySelector('.poster-paragraph__button');
|
|
83
|
-
return;
|
|
84
83
|
|
|
85
84
|
if (!videoTitle) {
|
|
86
85
|
return;
|
|
@@ -200,42 +199,129 @@ export namespace LTPlayerControlsEvents {
|
|
|
200
199
|
captions.classList.add('d-none');
|
|
201
200
|
}
|
|
202
201
|
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
showHideControls = {
|
|
205
|
+
showHideText(visible: boolean, controls: HTMLElement) {
|
|
206
|
+
const textControlsElement = controls.querySelector('.lt-player-video-content');
|
|
207
|
+
|
|
208
|
+
if (textControlsElement) {
|
|
209
|
+
if (visible) {
|
|
210
|
+
if (!textControlsElement.classList.contains('lt-player-video-content-enable')) {
|
|
211
|
+
textControlsElement.classList.add('lt-player-video-content-enable')
|
|
212
|
+
}
|
|
213
|
+
} else {
|
|
214
|
+
textControlsElement.classList.remove('lt-player-video-content-enable')
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
|
|
219
|
+
showHideSeekBar(visible: boolean, controls: HTMLElement) {
|
|
220
|
+
const seekBarControlsElement = controls.querySelector('.plyr__progress--wrapper');
|
|
221
|
+
|
|
222
|
+
if (seekBarControlsElement) {
|
|
223
|
+
if (visible) {
|
|
224
|
+
if (!seekBarControlsElement.classList.contains('plyr__progress--wrapper-enable')) {
|
|
225
|
+
seekBarControlsElement.classList.add('plyr__progress--wrapper-enable')
|
|
226
|
+
}
|
|
227
|
+
} else {
|
|
228
|
+
seekBarControlsElement.classList.remove('plyr__progress--wrapper-enable')
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
},
|
|
203
232
|
|
|
233
|
+
showHideBottomControls(visible: boolean, controls: HTMLElement) {
|
|
234
|
+
const bottomControlsElement = controls.querySelector('.bottom-controller');
|
|
235
|
+
|
|
236
|
+
if (bottomControlsElement) {
|
|
237
|
+
if (visible) {
|
|
238
|
+
if (!bottomControlsElement.classList.contains('bottom-controller-enable')) {
|
|
239
|
+
bottomControlsElement.classList.add('bottom-controller-enable')
|
|
240
|
+
}
|
|
241
|
+
} else {
|
|
242
|
+
bottomControlsElement.classList.remove('bottom-controller-enable')
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
},
|
|
204
246
|
|
|
247
|
+
showHideOnPause(visible: boolean, controls: HTMLElement) {
|
|
248
|
+
this.showHideBottomControls(visible, controls);
|
|
249
|
+
this.showHideSeekBar(visible, controls);
|
|
250
|
+
this.showHideBottomControls(visible, controls);
|
|
251
|
+
}
|
|
205
252
|
}
|
|
206
253
|
}
|
|
207
254
|
|
|
208
255
|
export class Desktop {
|
|
209
256
|
|
|
210
257
|
common: Common
|
|
258
|
+
|
|
211
259
|
constructor() {
|
|
212
260
|
this.common = new Common();
|
|
213
261
|
}
|
|
262
|
+
|
|
214
263
|
titleLineBreak(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType) {
|
|
215
|
-
|
|
264
|
+
return;
|
|
265
|
+
/*Remove title break*/
|
|
266
|
+
// this.common.checkTitleBreakWord(instance);
|
|
267
|
+
/**/
|
|
216
268
|
}
|
|
217
269
|
|
|
218
270
|
|
|
219
271
|
showHide(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType) {
|
|
220
272
|
const controls = instance.plyr.elements.controls;
|
|
221
|
-
const
|
|
273
|
+
const commonInstance = this.common;
|
|
274
|
+
controls.classList.add('plyr__controls-enable');
|
|
222
275
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
276
|
+
|
|
277
|
+
commonInstance.showHideControls.showHideText(true, controls);
|
|
278
|
+
commonInstance.showHideControls.showHideSeekBar(true, controls);
|
|
279
|
+
commonInstance.showHideControls.showHideBottomControls(true, controls);
|
|
227
280
|
|
|
228
281
|
controls.addEventListener('mouseover', function () {
|
|
229
|
-
|
|
230
|
-
|
|
282
|
+
|
|
283
|
+
if (instance.plyr.paused) {
|
|
284
|
+
commonInstance.showHideControls.showHideOnPause(true, controls);
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
if (!instance.playerConfig.isPinTextControls()) {
|
|
289
|
+
commonInstance.showHideControls.showHideText(true, controls);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
if (!instance.playerConfig.isPinSeekBarControls()) {
|
|
293
|
+
commonInstance.showHideControls.showHideSeekBar(true, controls);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
if (!instance.playerConfig.isPinBottomControls()) {
|
|
297
|
+
commonInstance.showHideControls.showHideBottomControls(true, controls);
|
|
298
|
+
}
|
|
299
|
+
|
|
231
300
|
})
|
|
232
301
|
|
|
233
302
|
|
|
234
303
|
controls.addEventListener('mouseleave', function () {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
304
|
+
|
|
305
|
+
if (instance.plyr.paused) {
|
|
306
|
+
commonInstance.showHideControls.showHideOnPause(true, controls);
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
if (!instance.playerConfig.isPinTextControls()) {
|
|
311
|
+
setTimeout(() => {
|
|
312
|
+
commonInstance.showHideControls.showHideText(false, controls);
|
|
313
|
+
}, 100)
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
if (!instance.playerConfig.isPinSeekBarControls()) {
|
|
317
|
+
setTimeout(() => {
|
|
318
|
+
commonInstance.showHideControls.showHideSeekBar(false, controls);
|
|
319
|
+
|
|
320
|
+
}, 100)
|
|
321
|
+
}
|
|
322
|
+
if (!instance.playerConfig.isPinBottomControls()) {
|
|
323
|
+
setTimeout(() => {
|
|
324
|
+
commonInstance.showHideControls.showHideBottomControls(false, controls);
|
|
239
325
|
}, 100)
|
|
240
326
|
}
|
|
241
327
|
})
|
|
@@ -254,7 +340,7 @@ export namespace LTPlayerControlsEvents {
|
|
|
254
340
|
}
|
|
255
341
|
}
|
|
256
342
|
|
|
257
|
-
fullscreenIcon(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType, type: string){
|
|
343
|
+
fullscreenIcon(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType, type: string) {
|
|
258
344
|
|
|
259
345
|
let playerControls = instance.plyr.elements.controls;
|
|
260
346
|
const fullScreenButtonContainer = playerControls.querySelector('.fullscreen-custom-control');
|
|
@@ -277,8 +363,8 @@ export namespace LTPlayerControlsEvents {
|
|
|
277
363
|
let common = this.common;
|
|
278
364
|
switch (type) {
|
|
279
365
|
case 'timeupdate':
|
|
280
|
-
|
|
281
|
-
|
|
366
|
+
this.common.playPauseIconTimeUpdate(instance);
|
|
367
|
+
break
|
|
282
368
|
case 'ready':
|
|
283
369
|
const playButton = instance.plyr.elements.controls.querySelector('.play-button');
|
|
284
370
|
if (playButton) {
|
|
@@ -401,13 +487,13 @@ export namespace LTPlayerControlsEvents {
|
|
|
401
487
|
let playerControlsContainer = instance.plyr.elements.controls;
|
|
402
488
|
|
|
403
489
|
|
|
404
|
-
const volume:HTMLElement = playerControlsContainer.querySelector('.bottom-controller__volume_control');
|
|
490
|
+
const volume: HTMLElement = playerControlsContainer.querySelector('.bottom-controller__volume_control');
|
|
405
491
|
const openVolumeButton: HTMLElement = playerControlsContainer.querySelector('.volume_control__volume-button');
|
|
406
492
|
const muteUnmuteVolumeButton: HTMLElement = playerControlsContainer.querySelector('.volume_control__volume-button-close');
|
|
407
493
|
const volumeControl: HTMLElement = playerControlsContainer.querySelector('.volume_control__background__area');
|
|
408
494
|
const volumeBackground: HTMLElement = playerControlsContainer.querySelector('.volume_control__background');
|
|
409
495
|
const volumeRangeControl: HTMLElement = playerControlsContainer.querySelector('.volume_control__background__area__range');
|
|
410
|
-
const rangeVolumesItems: NodeListOf<HTMLElement
|
|
496
|
+
const rangeVolumesItems: NodeListOf<HTMLElement> = volume.querySelectorAll('.volume-max, .volume-75, .volume-50, .volume-mute');
|
|
411
497
|
|
|
412
498
|
openVolumeButton.addEventListener('mouseover', (event) => {
|
|
413
499
|
volumeControl.classList.remove('d-none');
|
|
@@ -456,10 +542,10 @@ export namespace LTPlayerControlsEvents {
|
|
|
456
542
|
const volumeBody: HTMLElement = playerControlsContainer.querySelector('.bottom-controller__volume_control');
|
|
457
543
|
const volumeIconsManger = (item: HTMLElement) => {
|
|
458
544
|
|
|
459
|
-
const rangeVolumesItems: NodeListOf<HTMLElement
|
|
545
|
+
const rangeVolumesItems: NodeListOf<HTMLElement> = volumeBody.querySelectorAll('.volume-max, .volume-75, .volume-50, .volume-mute');
|
|
460
546
|
|
|
461
547
|
rangeVolumesItems.forEach(function (value) {
|
|
462
|
-
if (item.dataset.rangeValue === value.dataset.rangeValue){
|
|
548
|
+
if (item.dataset.rangeValue === value.dataset.rangeValue) {
|
|
463
549
|
value.classList.remove('d-none');
|
|
464
550
|
} else {
|
|
465
551
|
value.classList.add('d-none')
|
|
@@ -495,12 +581,12 @@ export namespace LTPlayerControlsEvents {
|
|
|
495
581
|
return;
|
|
496
582
|
}
|
|
497
583
|
|
|
498
|
-
const getClosest = (curr: any, prev: any,
|
|
584
|
+
const getClosest = (curr: any, prev: any, range: any) => {
|
|
499
585
|
return (Math.abs(curr - range) < Math.abs(prev - range) ? curr : prev);
|
|
500
586
|
}
|
|
501
587
|
|
|
502
588
|
|
|
503
|
-
let closest = itemsDataSet.reduce(function(prev, curr) {
|
|
589
|
+
let closest = itemsDataSet.reduce(function (prev, curr) {
|
|
504
590
|
return getClosest(curr, prev, (volumeRangeControl as HTMLInputElement).value);
|
|
505
591
|
});
|
|
506
592
|
volumeIcons(closest);
|
|
@@ -563,6 +649,7 @@ export namespace LTPlayerControlsEvents {
|
|
|
563
649
|
const playerContainer = instance.plyr.elements.container;
|
|
564
650
|
const playerControlsContainer = instance.plyr.elements.controls;
|
|
565
651
|
const eventsInstance = this;
|
|
652
|
+
const commonInstance = this.common;
|
|
566
653
|
|
|
567
654
|
let playerControlsBackground = playerContainer.querySelector('.plyr__controls__mobile-background');
|
|
568
655
|
|
|
@@ -586,33 +673,65 @@ export namespace LTPlayerControlsEvents {
|
|
|
586
673
|
clearTimeout(this.controlsTimeOut);
|
|
587
674
|
}
|
|
588
675
|
|
|
676
|
+
commonInstance.showHideControls.showHideText(true, playerControlsContainer);
|
|
677
|
+
commonInstance.showHideControls.showHideSeekBar(true, playerControlsContainer);
|
|
678
|
+
commonInstance.showHideControls.showHideBottomControls(true, playerControlsContainer);
|
|
679
|
+
|
|
589
680
|
|
|
590
|
-
if (
|
|
591
|
-
|
|
681
|
+
if (instance.plyr.paused) {
|
|
682
|
+
commonInstance.showHideControls.showHideOnPause(true, playerControlsContainer);
|
|
592
683
|
return;
|
|
593
684
|
}
|
|
594
685
|
|
|
595
|
-
|
|
686
|
+
this.hideControls(instance, false);
|
|
596
687
|
}
|
|
597
688
|
|
|
598
689
|
hideControls(instance: LTPlayer.PortraitType | LTPlayer.LandscapeType, now: boolean) {
|
|
599
690
|
const playerContainer = instance.plyr.elements.container;
|
|
600
691
|
const playerControlsContainer = instance.plyr.elements.controls;
|
|
601
692
|
const eventsInstance = this;
|
|
693
|
+
const commonInstance = this.common;
|
|
602
694
|
let playerControlsBackground = playerContainer.querySelector('.plyr__controls__mobile-background');
|
|
603
695
|
|
|
696
|
+
const showHideControls = () => {
|
|
697
|
+
if (!instance.playerConfig.isPinTextControls()) {
|
|
698
|
+
commonInstance.showHideControls.showHideText(false, playerControlsContainer);
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
if (!instance.playerConfig.isPinSeekBarControls()) {
|
|
702
|
+
commonInstance.showHideControls.showHideSeekBar(false, playerControlsContainer);
|
|
703
|
+
}
|
|
704
|
+
if (!instance.playerConfig.isPinBottomControls()) {
|
|
705
|
+
commonInstance.showHideControls.showHideBottomControls(false, playerControlsContainer);
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
|
|
604
709
|
if (!playerControlsContainer.classList.contains('plyr__controls-enable-addInfo')) {
|
|
605
710
|
|
|
606
711
|
if (now) {
|
|
607
|
-
|
|
608
|
-
|
|
712
|
+
|
|
713
|
+
if (instance.plyr.paused) {
|
|
714
|
+
commonInstance.showHideControls.showHideOnPause(true, playerControlsContainer);
|
|
715
|
+
return;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
showHideControls();
|
|
719
|
+
// playerControlsContainer.classList.remove('plyr__controls-enable');
|
|
720
|
+
// playerContainer.classList.add('plyr--hide-controls');
|
|
609
721
|
if (!playerControlsContainer.classList.contains('player-lt__modal__mobile-show-modal')) {
|
|
610
722
|
playerControlsBackground.classList.remove('d-none');
|
|
611
723
|
}
|
|
612
724
|
} else {
|
|
613
725
|
this.controlsTimeOut = setTimeout(() => {
|
|
614
|
-
playerControlsContainer.classList.remove('plyr__controls-enable');
|
|
615
|
-
playerContainer.classList.add('plyr--hide-controls');
|
|
726
|
+
// playerControlsContainer.classList.remove('plyr__controls-enable');
|
|
727
|
+
// playerContainer.classList.add('plyr--hide-controls');
|
|
728
|
+
|
|
729
|
+
if (instance.plyr.paused) {
|
|
730
|
+
commonInstance.showHideControls.showHideOnPause(true, playerControlsContainer);
|
|
731
|
+
return;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
showHideControls();
|
|
616
735
|
if (playerControlsBackground && !playerControlsContainer.classList.contains('player-lt__modal__mobile-show-modal')) {
|
|
617
736
|
playerControlsBackground.classList.remove('d-none');
|
|
618
737
|
}
|
|
@@ -667,9 +786,7 @@ export namespace LTPlayerControlsEvents {
|
|
|
667
786
|
const selectors = common.backwardRewind.getSelectors(instance);
|
|
668
787
|
|
|
669
788
|
const singleTapAction = () => {
|
|
670
|
-
|
|
671
|
-
instance.playerControl.mobileEvents.hideControls(instance, true);
|
|
672
|
-
}
|
|
789
|
+
instance.playerControl.mobileEvents.hideControls(instance, true);
|
|
673
790
|
}
|
|
674
791
|
|
|
675
792
|
if (selectors.forwardArea) {
|