@latest-thinking/lt-player 1.1.0 → 1.2.0-a
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 +126 -0
- 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/basic.html +35 -0
- package/examples/lt-page-with-player.html +3529 -0
- package/examples/lt-page-with-player_files/Weiskopf_Coverphoto.jpg +0 -0
- package/examples/lt-page-with-player_files/ajax-progress.module.css +49 -0
- package/examples/lt-page-with-player_files/align.module.css +32 -0
- package/examples/lt-page-with-player_files/announce.js +49 -0
- package/examples/lt-page-with-player_files/autocomplete-loading.module.css +22 -0
- package/examples/lt-page-with-player_files/autocomplete.css +16 -0
- package/examples/lt-page-with-player_files/bootstrap.css +22691 -0
- package/examples/lt-page-with-player_files/clearfix.module.css +15 -0
- package/examples/lt-page-with-player_files/container-inline.module.css +16 -0
- package/examples/lt-page-with-player_files/cookiesjsr.min.css +10 -0
- package/examples/lt-page-with-player_files/core.css +97 -0
- package/examples/lt-page-with-player_files/details.module.css +10 -0
- package/examples/lt-page-with-player_files/fieldgroup.module.css +9 -0
- package/examples/lt-page-with-player_files/hidden.module.css +53 -0
- package/examples/lt-page-with-player_files/himme-alexander-beyond_0.jpg +0 -0
- package/examples/lt-page-with-player_files/item-list.module.css +19 -0
- package/examples/lt-page-with-player_files/js.module.css +22 -0
- package/examples/lt-page-with-player_files/latest_thinking.style.css +6496 -0
- package/examples/lt-page-with-player_files/logo-small.png +0 -0
- package/examples/lt-page-with-player_files/menu.css +64 -0
- package/examples/lt-page-with-player_files/nowrap.module.css +8 -0
- package/examples/lt-page-with-player_files/paragraphs.unpublished.css +3 -0
- package/examples/lt-page-with-player_files/position-container.module.css +8 -0
- package/examples/lt-page-with-player_files/progress.module.css +51 -0
- package/examples/lt-page-with-player_files/radix.style.css +1 -0
- package/examples/lt-page-with-player_files/reset-appearance.module.css +15 -0
- package/examples/lt-page-with-player_files/resize.module.css +21 -0
- package/examples/lt-page-with-player_files/search_api_autocomplete.css +41 -0
- package/examples/lt-page-with-player_files/sticky-header.module.css +13 -0
- package/examples/lt-page-with-player_files/system-status-counter.css +30 -0
- package/examples/lt-page-with-player_files/system-status-report-counters.css +27 -0
- package/examples/lt-page-with-player_files/system-status-report-general-info.css +14 -0
- package/examples/lt-page-with-player_files/tabledrag.module.css +98 -0
- package/examples/lt-page-with-player_files/tablesort.module.css +19 -0
- package/examples/lt-page-with-player_files/theme.css +446 -0
- package/examples/lt-page-with-player_files/thumbnail_MPI_CBS_Eingangsbereich.jpg +0 -0
- package/examples/lt-page-with-player_files/tree-child.module.css +18 -0
- package/examples/lt-page-with-player_files/widget-min.js +10 -0
- package/examples/lt-website.html +76 -0
- package/examples/portrait-with-subtitles.html +81 -0
- package/examples/samples/vtt/Pahl-Kerstin-Maria-MAIN-20230320.vtt +765 -0
- package/examples/samples/vtt/Sobolev-Anton-Subtitles-20230518_0.vtt +352 -0
- package/examples/samples/vtt/demo.vtt +7 -0
- package/package.json +1 -1
- package/src/assets/sass/abstracts/_mixins.scss +1 -1
- package/src/assets/sass/abstracts/_variables.scss +1 -1
- package/src/assets/sass/app.scss +19 -0
- package/src/assets/sass/components/_all.scss +1 -1
- package/src/assets/sass/components/_loader.scss +187 -0
- package/src/assets/sass/components/_modal.scss +6 -0
- package/src/assets/sass/core/_player.scss +23 -5
- package/src/assets/sass/sections/_additional-info.scss +1 -1
- package/src/assets/sass/sections/_control.scss +0 -1
- package/src/assets/sass/sections/_poster.scss +1 -0
- package/src/assets/sass/sections/_settings.scss +36 -53
- package/src/assets/sass/sections/_subtitles.scss +78 -23
- package/src/assets/sass/sections/controllers/_botom.scss +59 -36
- package/src/assets/sass/sections/controllers/_notification-rewind-forward.scss +29 -14
- package/src/assets/sass/sections/controllers/_top.scss +1 -1
- package/src/components/LTPlayerDevMethode.ts +106 -84
- package/src/components/LTPlayerManager.ts +16 -0
- package/src/components/LTPlayerSettingsManager.ts +117 -0
- package/src/components/LTPlayerSetup.ts +3 -10
- package/src/components/LTPlayerStatusFeedback.ts +76 -0
- package/src/components/LTPlayerStorage.ts +58 -0
- package/src/components/LTPlayerType.ts +10 -2
- package/src/components/LTPlayerUpdate.ts +61 -0
- package/src/components/captions/LTPlayerCaptions.ts +80 -0
- package/src/components/config/LTPlayerConfig.ts +43 -0
- package/src/components/config/LTPlayerConfigProcessor.ts +110 -56
- package/src/components/controls/LTPlayerChapters.ts +8 -4
- package/src/components/controls/LTPlayerControls.ts +2 -0
- package/src/components/controls/LTPlayerControlsEvents.ts +200 -49
- package/src/components/controls/settings/LTPlayerCommonSettingsControllers.ts +9 -1
- package/src/components/controls/settings/LTPlayerDesktopSettingsControllers.ts +17 -14
- package/src/components/controls/settings/LTPlayerMobileSettingsControllers.ts +50 -44
- package/src/components/events/LTPlayer.ts +24 -21
- package/src/components/events/LTPlayerCommon.ts +94 -20
- package/src/components/events/LTPlayerDesktop.ts +21 -7
- package/src/components/events/LTPlayerMobile.ts +22 -10
- package/src/global/controllers/LTPlayerController.ts +7 -0
- package/src/services/Helper.ts +6 -1
- package/src/services/ResizeService.ts +35 -30
- package/src/services/TemplateService.ts +7 -0
- package/src/views/additionalInfo.handlebars +18 -18
- package/src/views/controls.handlebars +14 -3
- package/src/views/poster.handlebars +2 -2
- package/src/views/settings.handlebars +1 -1
- package/src/views/settings.mobile.handlebars +22 -0
- package/src/views/template.handlebars +4 -1
- package/src/assets/sass/components/_spinner.scss +0 -46
|
@@ -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
|
|
|
@@ -199,38 +199,145 @@ export namespace LTPlayerControlsEvents {
|
|
|
199
199
|
captions.classList.add('d-none');
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
showHideText(visible: boolean, controls: HTMLElement) {
|
|
205
|
+
const textControlsElement = controls.querySelector('.lt-player-video-content');
|
|
206
|
+
|
|
207
|
+
if (textControlsElement) {
|
|
208
|
+
if (visible) {
|
|
209
|
+
if (!textControlsElement.classList.contains('lt-player-video-content-enable')) {
|
|
210
|
+
textControlsElement.classList.add('lt-player-video-content-enable')
|
|
211
|
+
}
|
|
212
|
+
} else {
|
|
213
|
+
textControlsElement.classList.remove('lt-player-video-content-enable')
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
showHideSeekBar(visible: boolean, controls: HTMLElement) {
|
|
219
|
+
const seekBarControlsElement = controls.querySelector('.plyr__progress--wrapper');
|
|
220
|
+
|
|
221
|
+
if (seekBarControlsElement) {
|
|
222
|
+
if (visible) {
|
|
223
|
+
if (!seekBarControlsElement.classList.contains('plyr__progress--wrapper-enable')) {
|
|
224
|
+
seekBarControlsElement.classList.add('plyr__progress--wrapper-enable')
|
|
225
|
+
}
|
|
226
|
+
} else {
|
|
227
|
+
seekBarControlsElement.classList.remove('plyr__progress--wrapper-enable')
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
showHideBottomControls(visible: boolean, controls: HTMLElement) {
|
|
233
|
+
const bottomControlsElement = controls.querySelector('.bottom-controller');
|
|
202
234
|
|
|
235
|
+
if (bottomControlsElement) {
|
|
236
|
+
if (visible) {
|
|
237
|
+
if (!bottomControlsElement.classList.contains('bottom-controller-enable')) {
|
|
238
|
+
bottomControlsElement.classList.add('bottom-controller-enable')
|
|
239
|
+
}
|
|
240
|
+
} else {
|
|
241
|
+
bottomControlsElement.classList.remove('bottom-controller-enable')
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
203
245
|
|
|
246
|
+
showHideAllControls(visible: boolean, controls: HTMLElement) {
|
|
247
|
+
this.showHideText(visible, controls);
|
|
248
|
+
this.showHideSeekBar(visible, controls);
|
|
249
|
+
this.showHideBottomControls(visible, controls);
|
|
204
250
|
}
|
|
251
|
+
|
|
205
252
|
}
|
|
206
253
|
|
|
207
254
|
export class Desktop {
|
|
208
255
|
|
|
209
256
|
common: Common
|
|
257
|
+
|
|
210
258
|
constructor() {
|
|
211
259
|
this.common = new Common();
|
|
212
260
|
}
|
|
261
|
+
|
|
213
262
|
titleLineBreak(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType) {
|
|
214
|
-
|
|
263
|
+
return;
|
|
264
|
+
/*Remove title break*/
|
|
265
|
+
// this.common.checkTitleBreakWord(instance);
|
|
266
|
+
/**/
|
|
215
267
|
}
|
|
216
268
|
|
|
217
269
|
|
|
218
270
|
showHide(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType) {
|
|
219
271
|
const controls = instance.plyr.elements.controls;
|
|
220
|
-
const
|
|
272
|
+
const commonInstance = this.common;
|
|
273
|
+
controls.classList.add('plyr__controls-enable');
|
|
274
|
+
instance.statusFeedbackService.setControlsVisible()
|
|
275
|
+
|
|
276
|
+
commonInstance.showHideText(true, controls);
|
|
277
|
+
commonInstance.showHideSeekBar(true, controls);
|
|
278
|
+
commonInstance.showHideBottomControls(true, controls);
|
|
279
|
+
|
|
280
|
+
let timerText: NodeJS.Timeout = null;
|
|
281
|
+
let timerSeekBar: NodeJS.Timeout = null;
|
|
282
|
+
let timerBottomControls: NodeJS.Timeout = null;
|
|
221
283
|
|
|
222
284
|
controls.addEventListener('mouseover', function () {
|
|
223
|
-
|
|
224
|
-
|
|
285
|
+
|
|
286
|
+
if (timerText) {
|
|
287
|
+
clearTimeout(timerText);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
if (timerSeekBar) {
|
|
291
|
+
clearTimeout(timerSeekBar);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
if (timerBottomControls) {
|
|
295
|
+
clearTimeout(timerBottomControls);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
if (instance.plyr.paused) {
|
|
299
|
+
commonInstance.showHideAllControls(true, controls);
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
if (!instance.playerConfig.isPinTextControls()) {
|
|
304
|
+
commonInstance.showHideText(true, controls);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
if (!instance.playerConfig.isPinSeekBarControls()) {
|
|
308
|
+
commonInstance.showHideSeekBar(true, controls);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
if (!instance.playerConfig.isPinBottomControls()) {
|
|
312
|
+
commonInstance.showHideBottomControls(true, controls);
|
|
313
|
+
}
|
|
314
|
+
|
|
225
315
|
})
|
|
226
316
|
|
|
227
317
|
|
|
228
318
|
controls.addEventListener('mouseleave', function () {
|
|
229
|
-
if (
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
319
|
+
if (instance.plyr.paused) {
|
|
320
|
+
commonInstance.showHideAllControls(true, controls);
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
if (!instance.playerConfig.isPinTextControls()) {
|
|
325
|
+
timerText = setTimeout(() => {
|
|
326
|
+
commonInstance.showHideText(false, controls);
|
|
327
|
+
}, 5000)
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
if (!instance.playerConfig.isPinSeekBarControls()) {
|
|
331
|
+
timerSeekBar = setTimeout(() => {
|
|
332
|
+
commonInstance.showHideSeekBar(false, controls);
|
|
333
|
+
|
|
334
|
+
}, 5000)
|
|
335
|
+
}
|
|
336
|
+
if (!instance.playerConfig.isPinBottomControls()) {
|
|
337
|
+
timerBottomControls = setTimeout(() => {
|
|
338
|
+
instance.statusFeedbackService.clearControlsVisible()
|
|
339
|
+
commonInstance.showHideBottomControls(false, controls);
|
|
340
|
+
}, 5000)
|
|
234
341
|
}
|
|
235
342
|
})
|
|
236
343
|
}
|
|
@@ -248,7 +355,7 @@ export namespace LTPlayerControlsEvents {
|
|
|
248
355
|
}
|
|
249
356
|
}
|
|
250
357
|
|
|
251
|
-
fullscreenIcon(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType, type: string){
|
|
358
|
+
fullscreenIcon(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType, type: string) {
|
|
252
359
|
|
|
253
360
|
let playerControls = instance.plyr.elements.controls;
|
|
254
361
|
const fullScreenButtonContainer = playerControls.querySelector('.fullscreen-custom-control');
|
|
@@ -271,8 +378,8 @@ export namespace LTPlayerControlsEvents {
|
|
|
271
378
|
let common = this.common;
|
|
272
379
|
switch (type) {
|
|
273
380
|
case 'timeupdate':
|
|
274
|
-
|
|
275
|
-
|
|
381
|
+
this.common.playPauseIconTimeUpdate(instance);
|
|
382
|
+
break
|
|
276
383
|
case 'ready':
|
|
277
384
|
const playButton = instance.plyr.elements.controls.querySelector('.play-button');
|
|
278
385
|
if (playButton) {
|
|
@@ -395,13 +502,13 @@ export namespace LTPlayerControlsEvents {
|
|
|
395
502
|
let playerControlsContainer = instance.plyr.elements.controls;
|
|
396
503
|
|
|
397
504
|
|
|
398
|
-
const volume:HTMLElement = playerControlsContainer.querySelector('.bottom-controller__volume_control');
|
|
505
|
+
const volume: HTMLElement = playerControlsContainer.querySelector('.bottom-controller__volume_control');
|
|
399
506
|
const openVolumeButton: HTMLElement = playerControlsContainer.querySelector('.volume_control__volume-button');
|
|
400
507
|
const muteUnmuteVolumeButton: HTMLElement = playerControlsContainer.querySelector('.volume_control__volume-button-close');
|
|
401
508
|
const volumeControl: HTMLElement = playerControlsContainer.querySelector('.volume_control__background__area');
|
|
402
509
|
const volumeBackground: HTMLElement = playerControlsContainer.querySelector('.volume_control__background');
|
|
403
510
|
const volumeRangeControl: HTMLElement = playerControlsContainer.querySelector('.volume_control__background__area__range');
|
|
404
|
-
const rangeVolumesItems: NodeListOf<HTMLElement
|
|
511
|
+
const rangeVolumesItems: NodeListOf<HTMLElement> = volume.querySelectorAll('.volume-max, .volume-75, .volume-50, .volume-mute');
|
|
405
512
|
|
|
406
513
|
openVolumeButton.addEventListener('mouseover', (event) => {
|
|
407
514
|
volumeControl.classList.remove('d-none');
|
|
@@ -450,10 +557,10 @@ export namespace LTPlayerControlsEvents {
|
|
|
450
557
|
const volumeBody: HTMLElement = playerControlsContainer.querySelector('.bottom-controller__volume_control');
|
|
451
558
|
const volumeIconsManger = (item: HTMLElement) => {
|
|
452
559
|
|
|
453
|
-
const rangeVolumesItems: NodeListOf<HTMLElement
|
|
560
|
+
const rangeVolumesItems: NodeListOf<HTMLElement> = volumeBody.querySelectorAll('.volume-max, .volume-75, .volume-50, .volume-mute');
|
|
454
561
|
|
|
455
562
|
rangeVolumesItems.forEach(function (value) {
|
|
456
|
-
if (item.dataset.rangeValue === value.dataset.rangeValue){
|
|
563
|
+
if (item.dataset.rangeValue === value.dataset.rangeValue) {
|
|
457
564
|
value.classList.remove('d-none');
|
|
458
565
|
} else {
|
|
459
566
|
value.classList.add('d-none')
|
|
@@ -489,12 +596,12 @@ export namespace LTPlayerControlsEvents {
|
|
|
489
596
|
return;
|
|
490
597
|
}
|
|
491
598
|
|
|
492
|
-
const getClosest = (curr: any, prev: any,
|
|
599
|
+
const getClosest = (curr: any, prev: any, range: any) => {
|
|
493
600
|
return (Math.abs(curr - range) < Math.abs(prev - range) ? curr : prev);
|
|
494
601
|
}
|
|
495
602
|
|
|
496
603
|
|
|
497
|
-
let closest = itemsDataSet.reduce(function(prev, curr) {
|
|
604
|
+
let closest = itemsDataSet.reduce(function (prev, curr) {
|
|
498
605
|
return getClosest(curr, prev, (volumeRangeControl as HTMLInputElement).value);
|
|
499
606
|
});
|
|
500
607
|
volumeIcons(closest);
|
|
@@ -557,9 +664,12 @@ export namespace LTPlayerControlsEvents {
|
|
|
557
664
|
const playerContainer = instance.plyr.elements.container;
|
|
558
665
|
const playerControlsContainer = instance.plyr.elements.controls;
|
|
559
666
|
const eventsInstance = this;
|
|
667
|
+
const commonInstance = this.common;
|
|
560
668
|
|
|
561
669
|
let playerControlsBackground = playerContainer.querySelector('.plyr__controls__mobile-background');
|
|
562
670
|
|
|
671
|
+
instance.statusFeedbackService.setControlsVisible()
|
|
672
|
+
|
|
563
673
|
if (playerContainer.classList.contains('plyr--hide-controls')) {
|
|
564
674
|
playerContainer.classList.remove('plyr--hide-controls');
|
|
565
675
|
}
|
|
@@ -580,6 +690,16 @@ export namespace LTPlayerControlsEvents {
|
|
|
580
690
|
clearTimeout(this.controlsTimeOut);
|
|
581
691
|
}
|
|
582
692
|
|
|
693
|
+
commonInstance.showHideText(true, playerControlsContainer);
|
|
694
|
+
commonInstance.showHideSeekBar(true, playerControlsContainer);
|
|
695
|
+
commonInstance.showHideBottomControls(true, playerControlsContainer);
|
|
696
|
+
|
|
697
|
+
|
|
698
|
+
if (instance.plyr.paused) {
|
|
699
|
+
commonInstance.showHideAllControls(true, playerControlsContainer);
|
|
700
|
+
return;
|
|
701
|
+
}
|
|
702
|
+
|
|
583
703
|
this.hideControls(instance, false);
|
|
584
704
|
}
|
|
585
705
|
|
|
@@ -587,24 +707,55 @@ export namespace LTPlayerControlsEvents {
|
|
|
587
707
|
const playerContainer = instance.plyr.elements.container;
|
|
588
708
|
const playerControlsContainer = instance.plyr.elements.controls;
|
|
589
709
|
const eventsInstance = this;
|
|
710
|
+
const commonInstance = this.common;
|
|
590
711
|
let playerControlsBackground = playerContainer.querySelector('.plyr__controls__mobile-background');
|
|
591
712
|
|
|
713
|
+
const showHideControls = () => {
|
|
714
|
+
instance.statusFeedbackService.clearControlsVisible()
|
|
715
|
+
|
|
716
|
+
if (!instance.playerConfig.isPinTextControls()) {
|
|
717
|
+
commonInstance.showHideText(false, playerControlsContainer);
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
if (!instance.playerConfig.isPinSeekBarControls()) {
|
|
721
|
+
commonInstance.showHideSeekBar(false, playerControlsContainer);
|
|
722
|
+
}
|
|
723
|
+
if (!instance.playerConfig.isPinBottomControls()) {
|
|
724
|
+
commonInstance.showHideBottomControls(false, playerControlsContainer);
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
|
|
592
729
|
if (!playerControlsContainer.classList.contains('plyr__controls-enable-addInfo')) {
|
|
593
730
|
|
|
594
731
|
if (now) {
|
|
595
|
-
|
|
596
|
-
|
|
732
|
+
|
|
733
|
+
if (instance.plyr.paused) {
|
|
734
|
+
commonInstance.showHideAllControls(true, playerControlsContainer);
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
showHideControls();
|
|
739
|
+
// playerControlsContainer.classList.remove('plyr__controls-enable');
|
|
740
|
+
// playerContainer.classList.add('plyr--hide-controls');
|
|
597
741
|
if (!playerControlsContainer.classList.contains('player-lt__modal__mobile-show-modal')) {
|
|
598
742
|
playerControlsBackground.classList.remove('d-none');
|
|
599
743
|
}
|
|
600
744
|
} else {
|
|
601
745
|
this.controlsTimeOut = setTimeout(() => {
|
|
602
|
-
playerControlsContainer.classList.remove('plyr__controls-enable');
|
|
603
|
-
playerContainer.classList.add('plyr--hide-controls');
|
|
604
|
-
|
|
746
|
+
// playerControlsContainer.classList.remove('plyr__controls-enable');
|
|
747
|
+
// playerContainer.classList.add('plyr--hide-controls');
|
|
748
|
+
|
|
749
|
+
if (instance.plyr.paused) {
|
|
750
|
+
commonInstance.showHideAllControls(true, playerControlsContainer);
|
|
751
|
+
return;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
showHideControls();
|
|
755
|
+
if (playerControlsBackground && !playerControlsContainer.classList.contains('player-lt__modal__mobile-show-modal')) {
|
|
605
756
|
playerControlsBackground.classList.remove('d-none');
|
|
606
757
|
}
|
|
607
|
-
},
|
|
758
|
+
}, 5000);
|
|
608
759
|
}
|
|
609
760
|
eventsInstance.common.subtitlesShow(instance);
|
|
610
761
|
}
|
|
@@ -9,7 +9,15 @@ export class LTPlayerCommonSettingsControllers {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
addSettingsTemplate(string: 'mobile' | 'desktop') {
|
|
12
|
-
const settingsTemplate = this.instance.templateService.getSettings(
|
|
12
|
+
const settingsTemplate = this.instance.templateService.getSettings(
|
|
13
|
+
{
|
|
14
|
+
id : this.instance.playerConfig.getPlayerId(),
|
|
15
|
+
[string] : true,
|
|
16
|
+
captions_enabled: this.instance.playerConfig.getCaptionsEnabled() &&
|
|
17
|
+
this.instance.playerConfig.hasCaptionsUrl(),
|
|
18
|
+
captions_missing: !this.instance.playerConfig.hasCaptionsUrl()
|
|
19
|
+
}
|
|
20
|
+
);
|
|
13
21
|
const lastElement = this.instance.plyr.elements.controls.lastElementChild;
|
|
14
22
|
|
|
15
23
|
if (lastElement) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {LTPlayerSettingsControlsManager} from "../LTPlayerSettingsControlsManager";
|
|
2
2
|
import {SettingsControlsInterfaces} from "../../../global/interfaces/SettingsControlsInterfaces";
|
|
3
3
|
import {defaultType} from "../../../global/types/ModuleTypes";
|
|
4
|
+
import {LTPlayerStorage} from "../../LTPlayerStorage";
|
|
4
5
|
|
|
5
6
|
export class LTPlayerDesktopSettingsControllers implements SettingsControlsInterfaces {
|
|
6
7
|
settingsInstance: LTPlayerSettingsControlsManager
|
|
@@ -32,18 +33,17 @@ export class LTPlayerDesktopSettingsControllers implements SettingsControlsInter
|
|
|
32
33
|
|
|
33
34
|
const selectors = this.settingsInstance.common.getSelectors();
|
|
34
35
|
|
|
35
|
-
const checkBox = selectors.playerControlsContainer.querySelector(
|
|
36
|
+
const checkBox = selectors.playerControlsContainer.querySelector(`.subtitles-body__input-switch`) as HTMLInputElement;
|
|
36
37
|
|
|
37
38
|
if (checkBox) {
|
|
38
39
|
checkBox.addEventListener('change', () => {
|
|
39
40
|
|
|
40
41
|
if (!checkBox.checked) {
|
|
41
|
-
this.settingsInstance.
|
|
42
|
-
|
|
42
|
+
this.settingsInstance.playerInstance.captionsService.disableCaptions();
|
|
43
|
+
} else {
|
|
44
|
+
this.settingsInstance.playerInstance.captionsService.enableCaptions();
|
|
43
45
|
}
|
|
44
46
|
|
|
45
|
-
this.settingsInstance.player.toggleCaptions(true);
|
|
46
|
-
|
|
47
47
|
})
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -87,20 +87,23 @@ export class LTPlayerDesktopSettingsControllers implements SettingsControlsInter
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
setButtonSpeed() {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
const playerControlsContainer = this.settingsInstance.playerInstance.plyr.elements.controls;
|
|
91
|
+
const playerSpeedButton = playerControlsContainer.querySelector('.plyr__controls_speed-button');
|
|
92
|
+
const plyr = this.settingsInstance.playerInstance.plyr;
|
|
93
|
+
const instance = this.settingsInstance.playerInstance;
|
|
94
|
+
const storage = new LTPlayerStorage();
|
|
94
95
|
|
|
95
96
|
if (playerSpeedButton) {
|
|
96
|
-
|
|
97
|
+
const speedSpan = document.createElement('span');
|
|
97
98
|
playerSpeedButton.appendChild(speedSpan);
|
|
98
|
-
|
|
99
|
+
|
|
100
|
+
const displaySpeed = Math.floor(plyr.speed * 10) / 10;
|
|
101
|
+
speedSpan.innerHTML = displaySpeed + "X";
|
|
99
102
|
speedSpan.className = '';
|
|
100
|
-
speedSpan.classList.add('playback-speed--
|
|
103
|
+
speedSpan.classList.add('playback-speed--' + plyr.speed + 'X');
|
|
101
104
|
|
|
102
105
|
playerSpeedButton.addEventListener('click', function(event) {
|
|
103
|
-
|
|
106
|
+
const playSpeed = plyr.speed + 0.25;
|
|
104
107
|
|
|
105
108
|
if (playSpeed > 2) {
|
|
106
109
|
speedSpan.innerHTML = `1X`;
|
|
@@ -111,7 +114,7 @@ export class LTPlayerDesktopSettingsControllers implements SettingsControlsInter
|
|
|
111
114
|
}
|
|
112
115
|
|
|
113
116
|
if (playSpeed === 1.75) {
|
|
114
|
-
plyr.speed = playSpeed + 0.25
|
|
117
|
+
plyr.speed = playSpeed + 0.25;
|
|
115
118
|
speedSpan.innerHTML = `2X`;
|
|
116
119
|
speedSpan.className = '';
|
|
117
120
|
speedSpan.classList.add('playback-speed--2X');
|
|
@@ -2,6 +2,7 @@ import {LTPlayerSettingsControlsManager} from "../LTPlayerSettingsControlsManage
|
|
|
2
2
|
import {SettingsControlsInterfaces} from "../../../global/interfaces/SettingsControlsInterfaces";
|
|
3
3
|
|
|
4
4
|
export class LTPlayerMobileSettingsControllers implements SettingsControlsInterfaces {
|
|
5
|
+
|
|
5
6
|
settingsInstance: LTPlayerSettingsControlsManager
|
|
6
7
|
constructor(settingsInstance: LTPlayerSettingsControlsManager) {
|
|
7
8
|
this.settingsInstance = settingsInstance;
|
|
@@ -11,6 +12,7 @@ export class LTPlayerMobileSettingsControllers implements SettingsControlsInterf
|
|
|
11
12
|
init() {
|
|
12
13
|
this.addOpenSettingsEventButton();
|
|
13
14
|
this.setButtonSpeed();
|
|
15
|
+
this.createModal();
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
addOpenSettingsEventButton() {
|
|
@@ -21,11 +23,10 @@ export class LTPlayerMobileSettingsControllers implements SettingsControlsInterf
|
|
|
21
23
|
if (mobileEvent) {
|
|
22
24
|
mobileEvent.on('singletap', function LTPlayerMobileSettingsButton() {
|
|
23
25
|
instance.settingsInstance.playerInstance.playerControl.mobileEvents.showControls(instance.settingsInstance.playerInstance);
|
|
24
|
-
instance.createModal();
|
|
25
|
-
instance.setActiveModal();
|
|
26
26
|
instance.initCaptionsEvent();
|
|
27
27
|
instance.initSpeedVideoEvent();
|
|
28
28
|
instance.initSaveButton();
|
|
29
|
+
instance.showModal()
|
|
29
30
|
setTimeout(() => {
|
|
30
31
|
instance.setInactiveTouchModal();
|
|
31
32
|
}, 100)
|
|
@@ -34,8 +35,24 @@ export class LTPlayerMobileSettingsControllers implements SettingsControlsInterf
|
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
|
|
38
|
+
hideModal() {
|
|
39
|
+
const body = document.body
|
|
40
|
+
body.removeAttribute('modal-open-body')
|
|
41
|
+
|
|
42
|
+
const modal = this.getModal()
|
|
43
|
+
modal.close()
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
showModal() {
|
|
47
|
+
const body = document.body
|
|
48
|
+
body.setAttribute('modal-open-body', '')
|
|
49
|
+
|
|
50
|
+
const modal = this.getModal()
|
|
51
|
+
modal.showModal()
|
|
52
|
+
}
|
|
53
|
+
|
|
37
54
|
setInactiveTouchModal() {
|
|
38
|
-
const modal =
|
|
55
|
+
const modal = this.getModal()
|
|
39
56
|
const background = modal.querySelector('.settings-controllers-enable__background');
|
|
40
57
|
const settingsContainerHeader = modal.querySelector('.settings-controllers-header')
|
|
41
58
|
const instance = this;
|
|
@@ -46,10 +63,6 @@ export class LTPlayerMobileSettingsControllers implements SettingsControlsInterf
|
|
|
46
63
|
mobileEvent.on('singletap', function LTPlayerMobileSettingsBackground(event) {
|
|
47
64
|
instance.settingsInstance.playerInstance.playerControl.mobileEvents.showControls(instance.settingsInstance.playerInstance);
|
|
48
65
|
event.preventDefault();
|
|
49
|
-
let target = event.target as HTMLElement;
|
|
50
|
-
if (!target.classList.contains('settings-controllers')) {
|
|
51
|
-
instance.setInactiveModal();
|
|
52
|
-
}
|
|
53
66
|
})
|
|
54
67
|
}
|
|
55
68
|
}
|
|
@@ -61,64 +74,57 @@ export class LTPlayerMobileSettingsControllers implements SettingsControlsInterf
|
|
|
61
74
|
instance.settingsInstance.playerInstance.playerControl.mobileEvents.showControls(instance.settingsInstance.playerInstance);
|
|
62
75
|
event.preventDefault();
|
|
63
76
|
let target = event.target as HTMLElement;
|
|
64
|
-
instance.
|
|
77
|
+
instance.hideModal();
|
|
65
78
|
})
|
|
66
79
|
}
|
|
67
80
|
}
|
|
68
|
-
|
|
69
81
|
}
|
|
70
82
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const modal = document.createElement('div');
|
|
75
|
-
modal.classList.add('lt-player-mobile-settings-modal')
|
|
76
|
-
modal.innerHTML = modalTemplate;
|
|
77
|
-
|
|
78
|
-
const body = document.querySelector('body');
|
|
79
|
-
|
|
80
|
-
if (body) {
|
|
81
|
-
body.appendChild(modal);
|
|
82
|
-
}
|
|
83
|
+
getModal(): HTMLDialogElement {
|
|
84
|
+
const playerElementContainer = this.settingsInstance.playerInstance.playerConfig.getPlayerElementContainer()
|
|
85
|
+
return playerElementContainer.querySelector("dialog")
|
|
83
86
|
}
|
|
84
87
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
createModal() {
|
|
89
|
+
let settingsDialog = this.settingsInstance.playerInstance.templateService.getMobileSettings(
|
|
90
|
+
{
|
|
91
|
+
id : this.settingsInstance.playerInstance.playerConfig.getPlayerId(),
|
|
92
|
+
captions_enabled: this.settingsInstance.playerInstance.playerConfig.hasCaptionsUrl() &&
|
|
93
|
+
this.settingsInstance.playerInstance.playerConfig.getCaptionsEnabled(),
|
|
94
|
+
captions_missing: !this.settingsInstance.playerInstance.playerConfig.hasCaptionsUrl()
|
|
92
95
|
}
|
|
93
|
-
|
|
94
|
-
|
|
96
|
+
);
|
|
97
|
+
const playerElementContainer = this.settingsInstance.playerInstance.playerConfig.getPlayerElementContainer()
|
|
98
|
+
playerElementContainer.insertAdjacentHTML('beforeend', settingsDialog)
|
|
99
|
+
|
|
100
|
+
const modal = this.getModal()
|
|
101
|
+
modal.addEventListener('click', (e) => {
|
|
102
|
+
if (e.target === modal) {
|
|
103
|
+
this.hideModal()
|
|
104
|
+
}
|
|
105
|
+
});
|
|
95
106
|
|
|
96
|
-
setInactiveModal() {
|
|
97
|
-
const modal = document.querySelector('.lt-player-mobile-settings-modal');
|
|
98
|
-
if (modal) {
|
|
99
|
-
modal.remove();
|
|
100
|
-
}
|
|
101
107
|
}
|
|
108
|
+
|
|
102
109
|
initCaptionsEvent() {
|
|
103
|
-
const modal =
|
|
104
|
-
const checkBox = modal.querySelector(
|
|
110
|
+
const modal = this.getModal()
|
|
111
|
+
const checkBox = modal.querySelector(`.subtitles-body__input-switch`) as HTMLInputElement;
|
|
105
112
|
const instance = this;
|
|
106
113
|
if (checkBox) {
|
|
107
114
|
checkBox.addEventListener('change', () => {
|
|
108
115
|
instance.settingsInstance.playerInstance.playerControl.mobileEvents.showControls(instance.settingsInstance.playerInstance);
|
|
109
116
|
|
|
110
117
|
if (!checkBox.checked) {
|
|
111
|
-
this.settingsInstance.
|
|
112
|
-
|
|
118
|
+
this.settingsInstance.playerInstance.captionsService.disableCaptions();
|
|
119
|
+
} else {
|
|
120
|
+
this.settingsInstance.playerInstance.captionsService.enableCaptions();
|
|
113
121
|
}
|
|
114
122
|
|
|
115
|
-
this.settingsInstance.player.toggleCaptions(true);
|
|
116
|
-
|
|
117
123
|
})
|
|
118
124
|
}
|
|
119
125
|
}
|
|
120
126
|
initSpeedVideoEvent() {
|
|
121
|
-
const modal =
|
|
127
|
+
const modal = this.getModal()
|
|
122
128
|
const playerInstance = this.settingsInstance.playerInstance;
|
|
123
129
|
const player = this.settingsInstance.player;
|
|
124
130
|
const rangeInput: HTMLInputElement = modal.querySelector('.speed-range-input');
|
|
@@ -145,7 +151,7 @@ export class LTPlayerMobileSettingsControllers implements SettingsControlsInterf
|
|
|
145
151
|
myValue.innerHTML = `${values[0]}X`;
|
|
146
152
|
}
|
|
147
153
|
initSaveButton() {
|
|
148
|
-
const modal =
|
|
154
|
+
const modal = this.getModal()
|
|
149
155
|
const instance = this;
|
|
150
156
|
|
|
151
157
|
const saveButton = modal.querySelector('.button-save');
|
|
@@ -153,7 +159,7 @@ export class LTPlayerMobileSettingsControllers implements SettingsControlsInterf
|
|
|
153
159
|
saveButton.addEventListener('click', function (event) {
|
|
154
160
|
instance.settingsInstance.playerInstance.playerControl.mobileEvents.showControls(instance.settingsInstance.playerInstance);
|
|
155
161
|
event.preventDefault();
|
|
156
|
-
instance.
|
|
162
|
+
instance.hideModal();
|
|
157
163
|
})
|
|
158
164
|
}
|
|
159
165
|
setButtonSpeed() {
|