@latest-thinking/lt-player 1.0.6 → 1.0.7-b
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 +2 -1
- package/src/assets/sass/abstracts/_mixins.scss +11 -0
- package/src/assets/sass/abstracts/_variables.scss +3 -0
- package/src/assets/sass/app.scss +14 -1
- package/src/assets/sass/components/_modal.scss +1 -1
- package/src/assets/sass/sections/_settings.scss +255 -82
- package/src/assets/sass/sections/_share.scss +132 -21
- package/src/assets/sass/sections/controllers/_botom.scss +296 -303
- package/src/assets/sass/sections/controllers/_notification-rewind-forward.scss +36 -66
- package/src/assets/sass/sections/controllers/_top.scss +94 -113
- package/src/components/LTPlayerSetup.ts +0 -1
- package/src/components/LTPlayerType.ts +12 -12
- package/src/components/addInfo/LTPlayerAddInfoDesktop.ts +99 -0
- package/src/components/addInfo/LTPlayerAddInfoManager.ts +6 -6
- package/src/components/addInfo/LTPlayerAddInfoMobile.ts +110 -0
- package/src/components/config/LTPlayerConfig.ts +25 -11
- package/src/components/controls/LTPlayerControlsEvents.ts +141 -95
- package/src/components/controls/settings/LTPlayerDesktopSettingsControllers.ts +0 -1
- package/src/components/controls/settings/LTPlayerMobileSettingsControllers.ts +166 -30
- package/src/components/events/LTPlayer.ts +8 -0
- package/src/components/events/LTPlayerCommon.ts +27 -35
- package/src/components/events/LTPlayerDesktop.ts +4 -0
- package/src/components/events/LTPlayerMobile.ts +4 -2
- package/src/components/share/LTPlayerShareDesktop.ts +131 -0
- package/src/components/share/LTPlayerShareEvents.ts +30 -132
- package/src/components/share/{LTPlayerShare.ts → LTPlayerShareManager.ts} +26 -8
- package/src/components/share/LTPlayerShareMobile.ts +154 -0
- package/src/components/video/LTPlayerVideo.ts +49 -0
- package/src/global/controllers/LTPlayerController.ts +6 -3
- package/src/index.ts +7 -6
- package/src/services/ResizeService.ts +7 -7
- package/src/views/additionalInfo.handlebars +4 -8
- package/src/views/controls.handlebars +45 -41
- package/src/views/settings.handlebars +11 -14
- package/src/views/share.handlebars +36 -33
- package/src/components/addInfo/LTPlayerAdditionalInfoEvents.ts +0 -247
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import {LTPLayerAddInfo} from "./LTPlayerAddInfoManager";
|
|
2
|
+
import {additionalInformation} from "../../global/types/ModuleTypes";
|
|
3
|
+
|
|
4
|
+
export class LTPlayerAddInfoMobile {
|
|
5
|
+
set(controller: LTPLayerAddInfo.Controller) {
|
|
6
|
+
const playerContainer = controller.plyr.elements.container;
|
|
7
|
+
const playerControlsContainer = controller.plyr.elements.controls;
|
|
8
|
+
let additionalInfoBody: Element = playerContainer.querySelector('.lt-player__additional-info-mobile');
|
|
9
|
+
let instance = controller;
|
|
10
|
+
let __this = this;
|
|
11
|
+
|
|
12
|
+
let buttons: NodeList = additionalInfoBody.querySelectorAll('button');
|
|
13
|
+
|
|
14
|
+
if (buttons.length === 0) {
|
|
15
|
+
return
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const createInformationModal = (info: additionalInformation, key: string) => {
|
|
19
|
+
let modalTemplate = null;
|
|
20
|
+
|
|
21
|
+
if (typeof info === 'object') {
|
|
22
|
+
modalTemplate = controller.templateService.getAdditionalInfo({
|
|
23
|
+
mobile : true,
|
|
24
|
+
modal : true,
|
|
25
|
+
[controller.device] : true,
|
|
26
|
+
object_data : true,
|
|
27
|
+
[key] : info
|
|
28
|
+
})
|
|
29
|
+
} else {
|
|
30
|
+
modalTemplate = controller.templateService.getAdditionalInfo({
|
|
31
|
+
mobile : true,
|
|
32
|
+
modal : true,
|
|
33
|
+
data : info,
|
|
34
|
+
[controller.device] : true
|
|
35
|
+
})
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const modal = document.createElement('div');
|
|
39
|
+
modal.classList.add('lt-player-mobile-add-info-modal')
|
|
40
|
+
modal.innerHTML = modalTemplate;
|
|
41
|
+
|
|
42
|
+
const body = document.querySelector('body');
|
|
43
|
+
|
|
44
|
+
if (body) {
|
|
45
|
+
body.appendChild(modal);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
buttons.forEach((button: HTMLElement) => {
|
|
50
|
+
let mobileEvent: HammerManager = controller.playerInstance.eventInstance.mobileEvents.setMobileEvent(button);
|
|
51
|
+
if (mobileEvent) {
|
|
52
|
+
mobileEvent.on('singletap', function LTPlayerMobileAdditionalInfoButtons(event) {
|
|
53
|
+
event.preventDefault();
|
|
54
|
+
|
|
55
|
+
controller.playerInstance.plyr.elements.controls.classList.add('plyr__controls-enable-addInfo');
|
|
56
|
+
|
|
57
|
+
let targetModal = button.dataset.ltTarget;
|
|
58
|
+
let data = instance.additionalData;
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
if (data[targetModal] !== undefined) {
|
|
62
|
+
createInformationModal(data[targetModal], targetModal)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
playerControlsContainer.classList.add('player-lt__modal__mobile-show-modal');
|
|
66
|
+
|
|
67
|
+
window.Player.players.forEach( item => {item.plyr.pause()});
|
|
68
|
+
|
|
69
|
+
__this.dragCloseModal(controller);
|
|
70
|
+
|
|
71
|
+
controller.playerInstance.playerControl.mobileEvents.showControls(controller.playerInstance)
|
|
72
|
+
})
|
|
73
|
+
}
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
dragCloseModal(controller: LTPLayerAddInfo.Controller) {
|
|
80
|
+
const modalBody = document.querySelector('.lt-player-mobile-add-info-modal');
|
|
81
|
+
const modalHeader = modalBody.querySelector('.player-lt__mobile__modal-header');
|
|
82
|
+
const background = modalBody.querySelector('.player-lt__modal__mobile__background');
|
|
83
|
+
|
|
84
|
+
const closeModal = () => {
|
|
85
|
+
modalBody.remove();
|
|
86
|
+
}
|
|
87
|
+
if (modalHeader) {
|
|
88
|
+
let mobileEvent: HammerManager = controller.playerInstance.eventInstance.mobileEvents.setMobileEvent(modalHeader);
|
|
89
|
+
if (mobileEvent) {
|
|
90
|
+
mobileEvent.on('pan', function LTPlayerMobileDragDownModal() {
|
|
91
|
+
closeModal();
|
|
92
|
+
if (controller.plyr.paused) {
|
|
93
|
+
controller.plyr.play();
|
|
94
|
+
}
|
|
95
|
+
})
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (background) {
|
|
99
|
+
let mobileEvent: HammerManager = controller.playerInstance.eventInstance.mobileEvents.setMobileEvent(background);
|
|
100
|
+
if (mobileEvent) {
|
|
101
|
+
mobileEvent.on('singletap', function LTPlayerMobileCloseModal() {
|
|
102
|
+
closeModal();
|
|
103
|
+
if (controller.plyr.paused) {
|
|
104
|
+
controller.plyr.play();
|
|
105
|
+
}
|
|
106
|
+
})
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -29,7 +29,8 @@ export class LTPlayerConfig {
|
|
|
29
29
|
chapters : null,
|
|
30
30
|
playerType: null,
|
|
31
31
|
device : 'desktop',
|
|
32
|
-
observe : false
|
|
32
|
+
observe : false,
|
|
33
|
+
videoObjectFit : false
|
|
33
34
|
}
|
|
34
35
|
processor : LTPlayerConfigProcessor.Map
|
|
35
36
|
|
|
@@ -64,22 +65,35 @@ export class LTPlayerConfig {
|
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
setObjectFit(plyr : Plyr, instanceType : string) {
|
|
67
|
-
if (plyr.isHTML5) {
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
return new Promise(resolve => {
|
|
70
|
+
if (plyr.isHTML5) {
|
|
70
71
|
|
|
71
|
-
|
|
72
|
+
const videoTag = plyr.elements.wrapper.querySelector('video');
|
|
72
73
|
|
|
73
|
-
|
|
74
|
+
if (videoTag) {
|
|
74
75
|
|
|
75
|
-
|
|
76
|
+
videoTag.addEventListener('loadedmetadata', (event)=> {
|
|
76
77
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
const type = Helper.getVideoOrientation(videoTag.videoWidth, videoTag.videoHeight);
|
|
79
|
+
|
|
80
|
+
if (type === instanceType) {
|
|
81
|
+
this.configData.videoObjectFit = 'cover';
|
|
82
|
+
} else {
|
|
83
|
+
this.configData.videoObjectFit = 'clip';
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
resolve(true);
|
|
87
|
+
})
|
|
88
|
+
}
|
|
81
89
|
}
|
|
82
|
-
}
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
getObjectFit() {
|
|
96
|
+
return this.configData.videoObjectFit
|
|
83
97
|
}
|
|
84
98
|
|
|
85
99
|
setVersion(version : string | number) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {LTPlayer} from "../LTPlayerType";
|
|
2
2
|
import {plyr} from "../../global/types/ModuleTypes";
|
|
3
|
+
import * as events from "events";
|
|
3
4
|
|
|
4
5
|
export namespace LTPlayerControlsEvents {
|
|
5
6
|
|
|
@@ -122,7 +123,6 @@ export namespace LTPlayerControlsEvents {
|
|
|
122
123
|
})
|
|
123
124
|
}
|
|
124
125
|
}
|
|
125
|
-
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
playPauseIconTimeUpdate(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType) {
|
|
@@ -154,21 +154,32 @@ export namespace LTPlayerControlsEvents {
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
|
|
158
157
|
}
|
|
159
|
-
}
|
|
160
158
|
|
|
161
|
-
|
|
159
|
+
subtitlesShow(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType) {
|
|
160
|
+
const playerContainer = instance.plyr.elements.container;
|
|
161
|
+
const playerControls = instance.plyr.elements.controls;
|
|
162
162
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
163
|
+
const captions = playerContainer.querySelector('.plyr__captions');
|
|
164
|
+
|
|
165
|
+
let checkCaptions = (instance.plyr as plyr).captions.active;
|
|
166
|
+
|
|
167
|
+
if (!checkCaptions) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
if (!captions) {
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
if (!playerControls.classList.contains('plyr__controls-enable')) {
|
|
176
|
+
if (captions.classList.contains('d-none')) {
|
|
177
|
+
captions.classList.remove('d-none');
|
|
178
|
+
}
|
|
179
|
+
}
|
|
169
180
|
}
|
|
170
|
-
subtitles(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType) {
|
|
171
181
|
|
|
182
|
+
subtitlesHide(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType) {
|
|
172
183
|
const playerContainer = instance.plyr.elements.container;
|
|
173
184
|
const playerControls = instance.plyr.elements.controls;
|
|
174
185
|
const captions = playerContainer.querySelector('.plyr__captions');
|
|
@@ -183,26 +194,43 @@ export namespace LTPlayerControlsEvents {
|
|
|
183
194
|
return;
|
|
184
195
|
}
|
|
185
196
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
return;
|
|
197
|
+
if (playerControls.classList.contains('plyr__controls-enable')) {
|
|
198
|
+
if (!captions.classList.contains('d-none')) {
|
|
199
|
+
captions.classList.add('d-none');
|
|
200
|
+
}
|
|
191
201
|
}
|
|
192
|
-
captions.classList.add('d-none');
|
|
193
|
-
// captions.classList.add('on-controls-hover');
|
|
194
202
|
|
|
203
|
+
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export class Desktop {
|
|
208
|
+
|
|
209
|
+
common: Common
|
|
210
|
+
constructor() {
|
|
211
|
+
this.common = new Common();
|
|
195
212
|
}
|
|
213
|
+
titleLineBreak(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType) {
|
|
214
|
+
this.common.checkTitleBreakWord(instance)
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
|
|
196
218
|
showHide(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType) {
|
|
197
219
|
const controls = instance.plyr.elements.controls;
|
|
220
|
+
const eventsInstance = this;
|
|
221
|
+
|
|
198
222
|
controls.addEventListener('mouseover', function () {
|
|
199
|
-
controls.classList.add('plyr__controls-enable')
|
|
223
|
+
controls.classList.add('plyr__controls-enable');
|
|
224
|
+
eventsInstance.common.subtitlesHide(instance);
|
|
200
225
|
})
|
|
201
226
|
|
|
202
227
|
|
|
203
228
|
controls.addEventListener('mouseleave', function () {
|
|
204
229
|
if (!controls.classList.contains('plyr__controls-enable-settings')) {
|
|
205
|
-
controls.classList.remove('plyr__controls-enable')
|
|
230
|
+
controls.classList.remove('plyr__controls-enable');
|
|
231
|
+
setTimeout(()=>{
|
|
232
|
+
eventsInstance.common.subtitlesShow(instance);
|
|
233
|
+
}, 100)
|
|
206
234
|
}
|
|
207
235
|
})
|
|
208
236
|
}
|
|
@@ -370,45 +398,28 @@ export namespace LTPlayerControlsEvents {
|
|
|
370
398
|
|
|
371
399
|
const volume:HTMLElement = playerControlsContainer.querySelector('.bottom-controller__volume_control');
|
|
372
400
|
const openVolumeButton: HTMLElement = playerControlsContainer.querySelector('.volume_control__volume-button');
|
|
373
|
-
const
|
|
401
|
+
const muteUnmuteVolumeButton: HTMLElement = playerControlsContainer.querySelector('.volume_control__volume-button-close');
|
|
374
402
|
const volumeControl: HTMLElement = playerControlsContainer.querySelector('.volume_control__background__area');
|
|
375
403
|
const volumeBackground: HTMLElement = playerControlsContainer.querySelector('.volume_control__background');
|
|
376
404
|
const volumeRangeControl: HTMLElement = playerControlsContainer.querySelector('.volume_control__background__area__range');
|
|
405
|
+
const rangeVolumesItems: NodeListOf<HTMLElement>= volume.querySelectorAll('.volume-max, .volume-75, .volume-50, .volume-mute');
|
|
406
|
+
|
|
407
|
+
openVolumeButton.addEventListener('mouseover', (event) => {
|
|
408
|
+
volumeControl.classList.remove('d-none');
|
|
409
|
+
volumeBackground.classList.remove('d-none');
|
|
410
|
+
openVolumeButton.classList.add('d-none');
|
|
411
|
+
volume.classList.add('volume-control-enable');
|
|
412
|
+
volume.classList.add('volume-area-open')
|
|
413
|
+
})
|
|
377
414
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
if (!volume.classList.contains('volume-control-enable')) {
|
|
386
|
-
if (!eventTarget.classList.contains('button-open')) {
|
|
387
|
-
return;
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
if (
|
|
392
|
-
!eventTarget.classList.contains('button-close') &&
|
|
393
|
-
!eventTarget.classList.contains('volume-area-open')
|
|
394
|
-
) {
|
|
395
|
-
if (!volume.classList.contains('volume-control-enable')) {
|
|
396
|
-
volumeControl.classList.remove('d-none');
|
|
397
|
-
volumeBackground.classList.remove('d-none');
|
|
398
|
-
openVolumeButton.classList.add('d-none');
|
|
399
|
-
volume.classList.add('volume-control-enable');
|
|
400
|
-
volume.classList.add('volume-area-open')
|
|
401
|
-
} else {
|
|
402
|
-
volumeControl.classList.add('d-none');
|
|
403
|
-
volumeBackground.classList.add('d-none');
|
|
404
|
-
openVolumeButton.classList.remove('d-none');
|
|
405
|
-
volume.classList.remove('volume-control-enable');
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
event.preventDefault();
|
|
415
|
+
volume.addEventListener('mouseleave', () => {
|
|
416
|
+
volumeControl.classList.add('d-none');
|
|
417
|
+
volumeBackground.classList.add('d-none');
|
|
418
|
+
openVolumeButton.classList.remove('d-none');
|
|
419
|
+
volume.classList.remove('volume-control-enable');
|
|
409
420
|
})
|
|
410
421
|
|
|
411
|
-
|
|
422
|
+
muteUnmuteVolumeButton.addEventListener('click', (event) => {
|
|
412
423
|
event.preventDefault();
|
|
413
424
|
if (instance.plyr.volume > 0) {
|
|
414
425
|
instance.playerControl.playerVolumeBefore = instance.plyr.volume;
|
|
@@ -433,12 +444,11 @@ export namespace LTPlayerControlsEvents {
|
|
|
433
444
|
range = range.toString()
|
|
434
445
|
}
|
|
435
446
|
|
|
436
|
-
const volumeMax: HTMLElement =
|
|
437
|
-
const volume75: HTMLElement =
|
|
438
|
-
const volume50: HTMLElement =
|
|
439
|
-
const volumeMute: HTMLElement =
|
|
447
|
+
const volumeMax: HTMLElement = muteUnmuteVolumeButton.querySelector('.volume-max');
|
|
448
|
+
const volume75: HTMLElement = muteUnmuteVolumeButton.querySelector('.volume-75');
|
|
449
|
+
const volume50: HTMLElement = muteUnmuteVolumeButton.querySelector('.volume-50');
|
|
450
|
+
const volumeMute: HTMLElement = muteUnmuteVolumeButton.querySelector('.volume-mute');
|
|
440
451
|
const volumeBody: HTMLElement = playerControlsContainer.querySelector('.bottom-controller__volume_control');
|
|
441
|
-
|
|
442
452
|
const volumeIconsManger = (item: HTMLElement) => {
|
|
443
453
|
|
|
444
454
|
const rangeVolumesItems: NodeListOf<HTMLElement>= volumeBody.querySelectorAll('.volume-max, .volume-75, .volume-50, .volume-mute');
|
|
@@ -469,7 +479,26 @@ export namespace LTPlayerControlsEvents {
|
|
|
469
479
|
}
|
|
470
480
|
|
|
471
481
|
volumeRangeControl.addEventListener('input', function () {
|
|
472
|
-
|
|
482
|
+
|
|
483
|
+
let itemsDataSet: string[] = [];
|
|
484
|
+
|
|
485
|
+
rangeVolumesItems.forEach(item => {
|
|
486
|
+
itemsDataSet.push(item.dataset.rangeValue)
|
|
487
|
+
})
|
|
488
|
+
|
|
489
|
+
if (itemsDataSet.length === 0) {
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
const getClosest = (curr: any, prev: any, range: any) => {
|
|
494
|
+
return (Math.abs(curr - range) < Math.abs(prev - range) ? curr : prev);
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
let closest = itemsDataSet.reduce(function(prev, curr) {
|
|
499
|
+
return getClosest(curr, prev, (volumeRangeControl as HTMLInputElement).value);
|
|
500
|
+
});
|
|
501
|
+
volumeIcons(closest);
|
|
473
502
|
})
|
|
474
503
|
|
|
475
504
|
instance.plyr.volume = 1;
|
|
@@ -528,6 +557,8 @@ export namespace LTPlayerControlsEvents {
|
|
|
528
557
|
showControls(instance: LTPlayer.PortraitType | LTPlayer.LandscapeType) {
|
|
529
558
|
const playerContainer = instance.plyr.elements.container;
|
|
530
559
|
const playerControlsContainer = instance.plyr.elements.controls;
|
|
560
|
+
const eventsInstance = this;
|
|
561
|
+
|
|
531
562
|
let playerControlsBackground = playerContainer.querySelector('.plyr__controls__mobile-background');
|
|
532
563
|
|
|
533
564
|
if (playerContainer.classList.contains('plyr--hide-controls')) {
|
|
@@ -544,6 +575,8 @@ export namespace LTPlayerControlsEvents {
|
|
|
544
575
|
playerControlsContainer.classList.add('plyr__controls-enable');
|
|
545
576
|
}
|
|
546
577
|
|
|
578
|
+
eventsInstance.common.subtitlesHide(instance);
|
|
579
|
+
|
|
547
580
|
if (this.controlsTimeOut) {
|
|
548
581
|
clearTimeout(this.controlsTimeOut);
|
|
549
582
|
}
|
|
@@ -554,6 +587,7 @@ export namespace LTPlayerControlsEvents {
|
|
|
554
587
|
hideControls(instance: LTPlayer.PortraitType | LTPlayer.LandscapeType, now: boolean) {
|
|
555
588
|
const playerContainer = instance.plyr.elements.container;
|
|
556
589
|
const playerControlsContainer = instance.plyr.elements.controls;
|
|
590
|
+
const eventsInstance = this;
|
|
557
591
|
let playerControlsBackground = playerContainer.querySelector('.plyr__controls__mobile-background');
|
|
558
592
|
|
|
559
593
|
if (!playerControlsContainer.classList.contains('plyr__controls-enable-addInfo')) {
|
|
@@ -573,6 +607,8 @@ export namespace LTPlayerControlsEvents {
|
|
|
573
607
|
}
|
|
574
608
|
}, 4000);
|
|
575
609
|
}
|
|
610
|
+
console.log('hide;')
|
|
611
|
+
eventsInstance.common.subtitlesShow(instance);
|
|
576
612
|
}
|
|
577
613
|
}
|
|
578
614
|
|
|
@@ -706,46 +742,56 @@ export namespace LTPlayerControlsEvents {
|
|
|
706
742
|
}
|
|
707
743
|
|
|
708
744
|
|
|
709
|
-
|
|
745
|
+
settings(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType) {
|
|
710
746
|
let playerControlsContainer = instance.plyr.elements.controls;
|
|
711
|
-
const
|
|
712
|
-
const volumeButton = volume.querySelector('button');
|
|
713
|
-
const volumeUp = volume.querySelector('.volume-max');
|
|
714
|
-
const volumeMute = volume.querySelector('.volume-mute');
|
|
715
|
-
|
|
716
|
-
const setVolumeIcon = (volumeState: string) => {
|
|
717
|
-
if (volumeState === 'up') {
|
|
718
|
-
volumeUp.classList.remove('d-none');
|
|
719
|
-
volumeMute.classList.remove('d-none');
|
|
720
|
-
volumeMute.classList.add('d-none');
|
|
721
|
-
} else {
|
|
722
|
-
volumeUp.classList.remove('d-none');
|
|
723
|
-
volumeMute.classList.remove('d-none');
|
|
724
|
-
volumeUp.classList.add('d-none');
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
|
|
728
|
-
const setVolume = (): string => {
|
|
729
|
-
if (instance.plyr.muted) {
|
|
730
|
-
instance.plyr.muted = false;
|
|
731
|
-
return 'up';
|
|
732
|
-
} else {
|
|
733
|
-
instance.plyr.muted = true;
|
|
734
|
-
return 'mute';
|
|
735
|
-
}
|
|
736
|
-
}
|
|
747
|
+
const settingsButton = playerControlsContainer.querySelector('.plyr__controls_settings-button');
|
|
737
748
|
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
let mobileEvent: HammerManager = instance.eventInstance.mobileEvents.setMobileEvent(volumeButton);
|
|
741
|
-
|
|
742
|
-
mobileEvent.on('singletap', function LTPlayerMobileRewindClick() {
|
|
743
|
-
let volumeState = setVolume();
|
|
744
|
-
setVolumeIcon(volumeState);
|
|
745
|
-
instance.playerControl.mobileEvents.showControls(instance);
|
|
746
|
-
})
|
|
749
|
+
if (settingsButton) {
|
|
747
750
|
|
|
751
|
+
}
|
|
748
752
|
}
|
|
753
|
+
|
|
754
|
+
//remove volume
|
|
755
|
+
// volume(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType) {
|
|
756
|
+
// let playerControlsContainer = instance.plyr.elements.controls;
|
|
757
|
+
// const volume:HTMLElement = playerControlsContainer.querySelector('.bottom-controller__volume_control');
|
|
758
|
+
// const volumeButton = volume.querySelector('button');
|
|
759
|
+
// const volumeUp = volume.querySelector('.volume-max');
|
|
760
|
+
// const volumeMute = volume.querySelector('.volume-mute');
|
|
761
|
+
//
|
|
762
|
+
// const setVolumeIcon = (volumeState: string) => {
|
|
763
|
+
// if (volumeState === 'up') {
|
|
764
|
+
// volumeUp.classList.remove('d-none');
|
|
765
|
+
// volumeMute.classList.remove('d-none');
|
|
766
|
+
// volumeMute.classList.add('d-none');
|
|
767
|
+
// } else {
|
|
768
|
+
// volumeUp.classList.remove('d-none');
|
|
769
|
+
// volumeMute.classList.remove('d-none');
|
|
770
|
+
// volumeUp.classList.add('d-none');
|
|
771
|
+
// }
|
|
772
|
+
// }
|
|
773
|
+
//
|
|
774
|
+
// const setVolume = (): string => {
|
|
775
|
+
// if (instance.plyr.muted) {
|
|
776
|
+
// instance.plyr.muted = false;
|
|
777
|
+
// return 'up';
|
|
778
|
+
// } else {
|
|
779
|
+
// instance.plyr.muted = true;
|
|
780
|
+
// return 'mute';
|
|
781
|
+
// }
|
|
782
|
+
// }
|
|
783
|
+
//
|
|
784
|
+
// setVolumeIcon('up');
|
|
785
|
+
//
|
|
786
|
+
// let mobileEvent: HammerManager = instance.eventInstance.mobileEvents.setMobileEvent(volumeButton);
|
|
787
|
+
//
|
|
788
|
+
// mobileEvent.on('singletap', function LTPlayerMobileRewindClick() {
|
|
789
|
+
// let volumeState = setVolume();
|
|
790
|
+
// setVolumeIcon(volumeState);
|
|
791
|
+
// instance.playerControl.mobileEvents.showControls(instance);
|
|
792
|
+
// })
|
|
793
|
+
//
|
|
794
|
+
// }
|
|
749
795
|
}
|
|
750
796
|
|
|
751
797
|
|
|
@@ -18,7 +18,6 @@ export class LTPlayerDesktopSettingsControllers implements SettingsControlsInter
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
addOpenSettingsEventButton() {
|
|
21
|
-
|
|
22
21
|
const selectors: defaultType = this.settingsInstance.common.getSelectors();
|
|
23
22
|
|
|
24
23
|
selectors.button.addEventListener('click', (event: MouseEvent) => {
|