@latest-thinking/lt-player 1.0.8-g → 1.0.9-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/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/css/sample.css +12 -0
- package/src/assets/sass/abstracts/_mixins.scss +6 -0
- package/src/assets/sass/app.scss +9 -1
- package/src/assets/sass/components/_modal.scss +39 -24
- package/src/assets/sass/core/_player.scss +6 -6
- package/src/assets/sass/sections/_additional-info.scss +7 -0
- package/src/assets/sass/sections/controllers/_botom.scss +22 -0
- package/src/components/LTPlayerHls.ts +10 -1
- package/src/components/addInfo/LTPlayerAddInfoDesktop.ts +2 -0
- package/src/components/addInfo/LTPlayerAddInfoMobile.ts +53 -86
- package/src/components/config/LTPlayerConfig.ts +2 -0
- package/src/components/controls/LTPlayerControlsEvents.ts +42 -45
- package/src/components/controls/settings/LTPlayerDesktopSettingsControllers.ts +40 -5
- package/src/components/controls/settings/LTPlayerMobileSettingsControllers.ts +35 -34
- package/src/components/events/LTPlayerDesktop.ts +10 -2
- package/src/components/events/LTPlayerMobile.ts +21 -11
- package/src/services/ResizeService.ts +30 -27
- package/src/views/additionalInfo.handlebars +11 -1
- package/src/views/controls.handlebars +31 -16
- package/src/views/template.handlebars +1 -1
package/package.json
CHANGED
|
@@ -5,6 +5,12 @@
|
|
|
5
5
|
transform: translate(-#{$top}, -#{$top});
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
+
@mixin flex-position($flex, $content, $align) {
|
|
9
|
+
display: $flex;
|
|
10
|
+
justify-content: $content;
|
|
11
|
+
align-items: $align;
|
|
12
|
+
}
|
|
13
|
+
|
|
8
14
|
@mixin yellow-btn {
|
|
9
15
|
color: $default-lt-button-color;
|
|
10
16
|
background-color: $default_color_player;
|
package/src/assets/sass/app.scss
CHANGED
|
@@ -14,7 +14,11 @@
|
|
|
14
14
|
// 1. Basics
|
|
15
15
|
//---------------------------------------------
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
*,
|
|
18
|
+
*::before,
|
|
19
|
+
*::after {
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
}
|
|
18
22
|
|
|
19
23
|
//---------------------------------------------
|
|
20
24
|
// 2. Resetting properties
|
|
@@ -47,6 +51,10 @@ body {
|
|
|
47
51
|
visibility: hidden;
|
|
48
52
|
}
|
|
49
53
|
|
|
54
|
+
.overflow-hidden-body-important {
|
|
55
|
+
overflow: hidden !important;
|
|
56
|
+
}
|
|
57
|
+
|
|
50
58
|
.d-none {
|
|
51
59
|
display: none !important;
|
|
52
60
|
}
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
@import "../abstracts/variables";
|
|
2
2
|
|
|
3
|
+
$modal-max-width: 620px;
|
|
4
|
+
|
|
5
|
+
@mixin modal-max-width {
|
|
6
|
+
@media (max-width: #{$modal-max-width}) {
|
|
7
|
+
@content;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@mixin modal-min-width {
|
|
12
|
+
@media (min-width: #{$modal-max-width}) {
|
|
13
|
+
@content;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
3
17
|
@mixin modal-h2 {
|
|
4
18
|
font-size: $lt-player-font-size-xxxl2;
|
|
5
19
|
font-weight: $lt-player-font-weight-lg;
|
|
@@ -119,8 +133,8 @@
|
|
|
119
133
|
&__modal-content {
|
|
120
134
|
color: $default-lt-button-color;
|
|
121
135
|
text-align: left;
|
|
122
|
-
padding: 16px;
|
|
123
136
|
overflow: auto;
|
|
137
|
+
padding: 20px;
|
|
124
138
|
font-family: $lt-font-family-base;
|
|
125
139
|
|
|
126
140
|
button,
|
|
@@ -169,11 +183,10 @@
|
|
|
169
183
|
top: 0;
|
|
170
184
|
width: 100%;
|
|
171
185
|
height: 100%;
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
transition: visibility 0s linear 0.25s, opacity 0.25s 0s, transform 0.25s;
|
|
186
|
+
|
|
187
|
+
@include modal-min-width {
|
|
188
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
189
|
+
}
|
|
177
190
|
|
|
178
191
|
&__mobile {
|
|
179
192
|
position: absolute;
|
|
@@ -212,13 +225,18 @@
|
|
|
212
225
|
border-radius: 0;
|
|
213
226
|
font-family: $lt-font-family-base;
|
|
214
227
|
width: 100%;
|
|
215
|
-
max-height:
|
|
228
|
+
max-height: calc(100% - 50px);
|
|
216
229
|
overflow: auto;
|
|
217
230
|
max-width: 620px;
|
|
218
|
-
padding: 40px 0;
|
|
219
231
|
|
|
220
|
-
|
|
221
|
-
|
|
232
|
+
@include modal-max-width {
|
|
233
|
+
max-height: unset;
|
|
234
|
+
width: auto;
|
|
235
|
+
height: 100%;
|
|
236
|
+
position: unset;
|
|
237
|
+
transform: unset;
|
|
238
|
+
border: 1px solid $default-lt-span-color;
|
|
239
|
+
border-radius: 0 0 0 30px;
|
|
222
240
|
}
|
|
223
241
|
|
|
224
242
|
.modal-flex {
|
|
@@ -305,12 +323,15 @@
|
|
|
305
323
|
}
|
|
306
324
|
|
|
307
325
|
&__modal-body {
|
|
308
|
-
padding:
|
|
326
|
+
padding: 40px;
|
|
327
|
+
|
|
328
|
+
@include modal-max-width {
|
|
329
|
+
padding: 20px;
|
|
330
|
+
}
|
|
309
331
|
}
|
|
310
332
|
|
|
311
333
|
&__close-button {
|
|
312
334
|
z-index: 20;
|
|
313
|
-
float: right;
|
|
314
335
|
width: 24px;
|
|
315
336
|
font-size: $lt-player-font-size-xxxl2 !important;
|
|
316
337
|
line-height: 1;
|
|
@@ -321,24 +342,18 @@
|
|
|
321
342
|
background-color: transparent;
|
|
322
343
|
color: $default-lt-button-color;
|
|
323
344
|
transition: color 0.12s ease-in-out;
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
345
|
+
position: absolute;
|
|
346
|
+
top: 40px;
|
|
347
|
+
right: 40px;
|
|
327
348
|
margin-top: 0 !important;
|
|
328
349
|
|
|
329
|
-
|
|
330
|
-
|
|
350
|
+
@include modal-max-width {
|
|
351
|
+
top: 20px;
|
|
352
|
+
right: 20px;
|
|
331
353
|
}
|
|
332
354
|
}
|
|
333
355
|
|
|
334
356
|
&__close-button:hover {
|
|
335
357
|
color: #d75b4c;
|
|
336
358
|
}
|
|
337
|
-
|
|
338
|
-
&__show-modal {
|
|
339
|
-
opacity: 1;
|
|
340
|
-
visibility: visible;
|
|
341
|
-
transform: scale(1.0);
|
|
342
|
-
transition: visibility 0s linear 0s, opacity 0.25s 0s, transform 0.25s;
|
|
343
|
-
}
|
|
344
359
|
}
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
.lt-player-portrate--mobile {
|
|
2
|
-
.plyr {
|
|
3
|
-
border-radius: 0;
|
|
4
|
-
}
|
|
5
|
-
}
|
|
6
|
-
|
|
7
1
|
.lt-player-orientation--portrait {
|
|
8
2
|
.plyr {
|
|
9
3
|
iframe,
|
|
@@ -51,3 +45,9 @@
|
|
|
51
45
|
}
|
|
52
46
|
}
|
|
53
47
|
}
|
|
48
|
+
|
|
49
|
+
.lt-player-portrate--mobile {
|
|
50
|
+
.fullscreen-custom-control {
|
|
51
|
+
display: none !important;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -50,6 +50,23 @@
|
|
|
50
50
|
margin-left: auto;
|
|
51
51
|
justify-content: end;
|
|
52
52
|
flex: 1;
|
|
53
|
+
|
|
54
|
+
.plyr__controls_speed-button {
|
|
55
|
+
width: 30px;
|
|
56
|
+
height: 30px;
|
|
57
|
+
background-color: $default-lt-player-blue;
|
|
58
|
+
font-size: $lt-player-font-size-xs;
|
|
59
|
+
font-weight: $lt-player-font-weight-md;
|
|
60
|
+
|
|
61
|
+
&:hover {
|
|
62
|
+
background-color: darken($default-lt-player-blue, 5%);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&:focus,
|
|
66
|
+
&:active {
|
|
67
|
+
background-color: $default-lt-player-blue;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
53
70
|
}
|
|
54
71
|
|
|
55
72
|
.skip-backward-seconds,
|
|
@@ -313,6 +330,11 @@
|
|
|
313
330
|
padding: 16px;
|
|
314
331
|
}
|
|
315
332
|
}
|
|
333
|
+
|
|
334
|
+
.plyr__controls_speed-button {
|
|
335
|
+
width: 40px;
|
|
336
|
+
height: 40px;
|
|
337
|
+
}
|
|
316
338
|
}
|
|
317
339
|
}
|
|
318
340
|
}
|
|
@@ -14,7 +14,16 @@ export class LTPlayerHls {
|
|
|
14
14
|
this.instance = instance;
|
|
15
15
|
this.config = instance.playerConfig;
|
|
16
16
|
this.playerSettings = playerSettings;
|
|
17
|
-
this.hlsInstance = new Hls(
|
|
17
|
+
this.hlsInstance = new Hls({
|
|
18
|
+
"enableWorker": true,
|
|
19
|
+
"lowLatencyMode": true,
|
|
20
|
+
"backBufferLength": 20,
|
|
21
|
+
"abrEwmaFastVoD": 1,
|
|
22
|
+
"autoStartLoad": true,
|
|
23
|
+
"abrBandWidthUpFactor": 0.95,
|
|
24
|
+
"maxMaxBufferLength": 15,
|
|
25
|
+
"abrEwmaDefaultEstimate": 50
|
|
26
|
+
});
|
|
18
27
|
}
|
|
19
28
|
|
|
20
29
|
init() {
|
|
@@ -76,6 +76,7 @@ export class LTPlayerAddInfoDesktop {
|
|
|
76
76
|
|
|
77
77
|
if (modal) {
|
|
78
78
|
modal.classList.add('player-lt__show-modal');
|
|
79
|
+
document.body.classList.add('overflow-hidden-body-important');
|
|
79
80
|
}
|
|
80
81
|
|
|
81
82
|
window.Player.players.forEach(item => {
|
|
@@ -97,6 +98,7 @@ export class LTPlayerAddInfoDesktop {
|
|
|
97
98
|
let target = event.target as HTMLElement;
|
|
98
99
|
if (target.classList.contains('player-lt__show-modal') || target.classList.contains('player-lt__close-button')) {
|
|
99
100
|
modal.classList.remove('player-lt__show-modal');
|
|
101
|
+
document.body.classList.remove('overflow-hidden-body-important');
|
|
100
102
|
document.querySelectorAll(".player-lt__modal").forEach(el => el.remove());
|
|
101
103
|
|
|
102
104
|
window.Player.players.forEach(item => {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {LTPLayerAddInfo} from "./LTPlayerAddInfoManager";
|
|
2
2
|
import {additionalInformation} from "../../global/types/ModuleTypes";
|
|
3
|
+
import {LTPlayer} from "../LTPlayerType";
|
|
3
4
|
|
|
4
5
|
export class LTPlayerAddInfoMobile {
|
|
5
6
|
set(controller: LTPLayerAddInfo.Controller) {
|
|
7
|
+
|
|
6
8
|
const playerContainer = controller.plyr.elements.container;
|
|
7
|
-
const playerControlsContainer = controller.plyr.elements.controls;
|
|
8
9
|
let additionalInfoBody: Element = playerContainer.querySelector('.lt-player__additional-info-mobile');
|
|
9
10
|
let instance = controller;
|
|
10
11
|
let __this = this;
|
|
@@ -15,35 +16,28 @@ export class LTPlayerAddInfoMobile {
|
|
|
15
16
|
return
|
|
16
17
|
}
|
|
17
18
|
|
|
18
|
-
const
|
|
19
|
+
const createInformationModal = (info: additionalInformation, key: string) => {
|
|
20
|
+
|
|
19
21
|
let modalTemplate = null;
|
|
20
22
|
|
|
21
23
|
if (typeof info === 'object') {
|
|
22
24
|
modalTemplate = controller.templateService.getAdditionalInfo({
|
|
23
|
-
|
|
24
|
-
modal
|
|
25
|
-
|
|
26
|
-
object_data
|
|
27
|
-
[key]
|
|
25
|
+
desktop: true,
|
|
26
|
+
modal: true,
|
|
27
|
+
id: `${key}-${controller.playerInstance.playerConfig.getPlayerId()}`,
|
|
28
|
+
object_data: true,
|
|
29
|
+
[key]: info
|
|
28
30
|
})
|
|
29
31
|
} else {
|
|
30
32
|
modalTemplate = controller.templateService.getAdditionalInfo({
|
|
31
|
-
|
|
32
|
-
modal
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
desktop: true,
|
|
34
|
+
modal: true,
|
|
35
|
+
id: `${key}-${controller.playerInstance.playerConfig.getPlayerId()}`,
|
|
36
|
+
data: info
|
|
35
37
|
})
|
|
36
38
|
}
|
|
37
39
|
|
|
38
|
-
|
|
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
|
-
}
|
|
40
|
+
document.querySelector('body').insertAdjacentHTML("afterend", modalTemplate);
|
|
47
41
|
}
|
|
48
42
|
|
|
49
43
|
buttons.forEach((button: HTMLElement) => {
|
|
@@ -52,17 +46,19 @@ export class LTPlayerAddInfoMobile {
|
|
|
52
46
|
mobileEvent.on('singletap', function LTPlayerMobileAdditionalInfoButtons(event) {
|
|
53
47
|
event.preventDefault();
|
|
54
48
|
|
|
55
|
-
controller.playerInstance.plyr.elements.controls.classList.add('plyr__controls-enable-addInfo');
|
|
56
|
-
|
|
57
49
|
let targetModal = button.dataset.ltTarget;
|
|
58
50
|
let data = instance.additionalData;
|
|
59
51
|
|
|
60
|
-
|
|
61
52
|
if (data[targetModal] !== undefined) {
|
|
62
53
|
createInformationModal(data[targetModal], targetModal)
|
|
63
54
|
}
|
|
64
55
|
|
|
65
|
-
|
|
56
|
+
let modal = document.querySelector(`.lt-modal-${targetModal}-${instance.playerInstance.playerConfig.getPlayerId()}`);
|
|
57
|
+
|
|
58
|
+
if (modal) {
|
|
59
|
+
modal.classList.add('player-lt__show-modal');
|
|
60
|
+
document.body.classList.add('overflow-hidden-body-important');
|
|
61
|
+
}
|
|
66
62
|
|
|
67
63
|
window.Player.players.forEach(item => {
|
|
68
64
|
if (item.plyr.playing) {
|
|
@@ -72,75 +68,46 @@ export class LTPlayerAddInfoMobile {
|
|
|
72
68
|
}
|
|
73
69
|
})
|
|
74
70
|
|
|
75
|
-
__this.
|
|
76
|
-
|
|
77
|
-
controller.playerInstance.playerControl.mobileEvents.showControls(controller.playerInstance)
|
|
71
|
+
__this.closeModal(controller);
|
|
78
72
|
})
|
|
79
73
|
}
|
|
80
74
|
})
|
|
81
|
-
|
|
82
|
-
|
|
83
75
|
}
|
|
84
76
|
|
|
85
|
-
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
})
|
|
116
|
-
})
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
if (background) {
|
|
120
|
-
let mobileEvent: HammerManager = controller.playerInstance.eventInstance.mobileEvents.setMobileEvent(background);
|
|
121
|
-
if (mobileEvent) {
|
|
122
|
-
mobileEvent.on('singletap', function LTPlayerMobileCloseModal() {
|
|
123
|
-
closeModal();
|
|
124
|
-
window.Player.players.forEach(item => {
|
|
125
|
-
if (item.pausedPlayer !== undefined) {
|
|
126
|
-
if (item.pausedPlayer.isEmbed) {
|
|
127
|
-
item.pausedPlayer.embed.play().then(function () {
|
|
77
|
+
closeModal(controller: LTPLayerAddInfo.Controller) {
|
|
78
|
+
const modals = document.querySelectorAll('.player-lt__modal');
|
|
79
|
+
|
|
80
|
+
if (modals.length !== 0) {
|
|
81
|
+
modals.forEach(modal => {
|
|
82
|
+
const mobileEvent: HammerManager = controller.playerInstance.eventInstance.mobileEvents.setMobileEvent(modal);
|
|
83
|
+
mobileEvent.on('singletap', function(event) {
|
|
84
|
+
const target = event.target;
|
|
85
|
+
if (modal.classList.contains('player-lt__show-modal')) {
|
|
86
|
+
if (target.classList.contains('player-lt__show-modal') || target.classList.contains('player-lt__close-button')) {
|
|
87
|
+
modal.classList.remove('player-lt__show-modal');
|
|
88
|
+
document.body.classList.remove('overflow-hidden-body-important');
|
|
89
|
+
document.querySelectorAll(".player-lt__modal").forEach(el => el.remove());
|
|
90
|
+
window.Player.players.forEach(item => {
|
|
91
|
+
if (item.pausedPlayer !== undefined) {
|
|
92
|
+
if (item.pausedPlayer.isEmbed) {
|
|
93
|
+
item.pausedPlayer.embed.play().then(function () {
|
|
94
|
+
return;
|
|
95
|
+
}).catch(function () {
|
|
96
|
+
// an error occurred
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (item.pausedPlayer.isHTML5) {
|
|
101
|
+
item.pausedPlayer.play();
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
128
104
|
return;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
if (item.pausedPlayer.isHTML5) {
|
|
135
|
-
|
|
136
|
-
item.pausedPlayer.play();
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
return;
|
|
105
|
+
}
|
|
106
|
+
})
|
|
140
107
|
}
|
|
141
|
-
}
|
|
142
|
-
})
|
|
143
|
-
}
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
})
|
|
144
111
|
}
|
|
145
112
|
}
|
|
146
113
|
}
|
|
@@ -246,7 +246,6 @@ export namespace LTPlayerControlsEvents {
|
|
|
246
246
|
instance.plyr.fullscreen.toggle();
|
|
247
247
|
})
|
|
248
248
|
}
|
|
249
|
-
|
|
250
249
|
}
|
|
251
250
|
|
|
252
251
|
fullscreenIcon(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType, type: string){
|
|
@@ -612,18 +611,19 @@ export namespace LTPlayerControlsEvents {
|
|
|
612
611
|
}
|
|
613
612
|
|
|
614
613
|
fullScreenButtons(instance: LTPlayer.PortraitType | LTPlayer.LandscapeType) {
|
|
615
|
-
|
|
616
614
|
let playerControlsSelector = instance.plyr.elements.controls;
|
|
617
615
|
|
|
618
616
|
const fullScreenButtonContainer = playerControlsSelector.querySelector('.fullscreen-custom-control');
|
|
619
617
|
let mobileEvent: HammerManager = instance.eventInstance.mobileEvents.setMobileEvent(fullScreenButtonContainer);
|
|
620
618
|
|
|
621
619
|
if (mobileEvent) {
|
|
622
|
-
mobileEvent.on('singletap', function LTPlayerMobileFullScreen() {
|
|
620
|
+
mobileEvent.on('singletap', function LTPlayerMobileFullScreen(event) {
|
|
621
|
+
event.preventDefault();
|
|
623
622
|
instance.plyr.fullscreen.toggle();
|
|
624
623
|
})
|
|
625
624
|
}
|
|
626
625
|
}
|
|
626
|
+
|
|
627
627
|
playPauseIcon(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType, type: string) {
|
|
628
628
|
let common = this.common;
|
|
629
629
|
let instanceMobile = this;
|
|
@@ -750,49 +750,46 @@ export namespace LTPlayerControlsEvents {
|
|
|
750
750
|
}
|
|
751
751
|
}
|
|
752
752
|
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
// volumeMute.classList.add('d-none');
|
|
766
|
-
// } else {
|
|
767
|
-
// volumeUp.classList.remove('d-none');
|
|
768
|
-
// volumeMute.classList.remove('d-none');
|
|
769
|
-
// volumeUp.classList.add('d-none');
|
|
770
|
-
// }
|
|
771
|
-
// }
|
|
772
|
-
//
|
|
773
|
-
// const setVolume = (): string => {
|
|
774
|
-
// if (instance.plyr.muted) {
|
|
775
|
-
// instance.plyr.muted = false;
|
|
776
|
-
// return 'up';
|
|
777
|
-
// } else {
|
|
778
|
-
// instance.plyr.muted = true;
|
|
779
|
-
// return 'mute';
|
|
780
|
-
// }
|
|
781
|
-
// }
|
|
782
|
-
//
|
|
783
|
-
// setVolumeIcon('up');
|
|
784
|
-
//
|
|
785
|
-
// let mobileEvent: HammerManager = instance.eventInstance.mobileEvents.setMobileEvent(volumeButton);
|
|
786
|
-
//
|
|
787
|
-
// mobileEvent.on('singletap', function LTPlayerMobileRewindClick() {
|
|
788
|
-
// let volumeState = setVolume();
|
|
789
|
-
// setVolumeIcon(volumeState);
|
|
790
|
-
// instance.playerControl.mobileEvents.showControls(instance);
|
|
791
|
-
// })
|
|
792
|
-
//
|
|
793
|
-
// }
|
|
794
|
-
}
|
|
753
|
+
volume(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType) {
|
|
754
|
+
let playerControlsContainer = instance.plyr.elements.controls;
|
|
755
|
+
const volume:HTMLElement = playerControlsContainer.querySelector('.bottom-controller__volume_control');
|
|
756
|
+
const setVolume = (): string => {
|
|
757
|
+
if (instance.plyr.muted) {
|
|
758
|
+
instance.plyr.muted = false;
|
|
759
|
+
return 'up';
|
|
760
|
+
} else {
|
|
761
|
+
instance.plyr.muted = true;
|
|
762
|
+
return 'mute';
|
|
763
|
+
}
|
|
764
|
+
}
|
|
795
765
|
|
|
766
|
+
if (volume) {
|
|
767
|
+
const volumeButton = volume.querySelector('button');
|
|
768
|
+
const volumeUp = volume.querySelector('.volume-max');
|
|
769
|
+
const volumeMute = volume.querySelector('.volume-mute');
|
|
796
770
|
|
|
771
|
+
const setVolumeIcon = (volumeState: string) => {
|
|
772
|
+
if (volumeState === 'up') {
|
|
773
|
+
volumeUp.classList.remove('d-none');
|
|
774
|
+
volumeMute.classList.remove('d-none');
|
|
775
|
+
volumeMute.classList.add('d-none');
|
|
776
|
+
} else {
|
|
777
|
+
volumeUp.classList.remove('d-none');
|
|
778
|
+
volumeMute.classList.remove('d-none');
|
|
779
|
+
volumeUp.classList.add('d-none');
|
|
780
|
+
}
|
|
781
|
+
}
|
|
797
782
|
|
|
783
|
+
setVolumeIcon('up');
|
|
784
|
+
|
|
785
|
+
let mobileEvent: HammerManager = instance.eventInstance.mobileEvents.setMobileEvent(volumeButton);
|
|
786
|
+
|
|
787
|
+
mobileEvent.on('singletap', function LTPlayerMobileRewindClick() {
|
|
788
|
+
let volumeState = setVolume();
|
|
789
|
+
setVolumeIcon(volumeState);
|
|
790
|
+
instance.playerControl.mobileEvents.showControls(instance);
|
|
791
|
+
})
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
}
|
|
798
795
|
}
|
|
@@ -10,6 +10,7 @@ export class LTPlayerDesktopSettingsControllers implements SettingsControlsInter
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
init() {
|
|
13
|
+
this.setButtonSpeed();
|
|
13
14
|
this.settingsInstance.common.addSettingsTemplate(this.settingsInstance.playerInstance.playerConfig.getDevice());
|
|
14
15
|
this.addOpenSettingsEventButton();
|
|
15
16
|
this.initCaptionsEvent();
|
|
@@ -19,11 +20,12 @@ export class LTPlayerDesktopSettingsControllers implements SettingsControlsInter
|
|
|
19
20
|
|
|
20
21
|
addOpenSettingsEventButton() {
|
|
21
22
|
const selectors: defaultType = this.settingsInstance.common.getSelectors();
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
if (selectors.button) {
|
|
24
|
+
selectors.button.addEventListener('click', (event: MouseEvent) => {
|
|
25
|
+
event.preventDefault();
|
|
26
|
+
this.settingsInstance.common.openSettings();
|
|
27
|
+
})
|
|
28
|
+
}
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
initCaptionsEvent() {
|
|
@@ -84,4 +86,37 @@ export class LTPlayerDesktopSettingsControllers implements SettingsControlsInter
|
|
|
84
86
|
})
|
|
85
87
|
}
|
|
86
88
|
|
|
89
|
+
setButtonSpeed() {
|
|
90
|
+
let playerControlsContainer = this.settingsInstance.playerInstance.plyr.elements.controls;
|
|
91
|
+
let playerSpeedButton = playerControlsContainer.querySelector('.plyr__controls_speed-button');
|
|
92
|
+
if (playerSpeedButton) {
|
|
93
|
+
playerSpeedButton.innerHTML = `${this.settingsInstance.playerInstance.plyr.speed}`;
|
|
94
|
+
}
|
|
95
|
+
let plyr = this.settingsInstance.playerInstance.plyr;
|
|
96
|
+
let instance = this.settingsInstance.playerInstance;
|
|
97
|
+
|
|
98
|
+
if (playerSpeedButton) {
|
|
99
|
+
playerSpeedButton.addEventListener('click', function(event) {
|
|
100
|
+
let playSpeed = plyr.speed + 0.25;
|
|
101
|
+
|
|
102
|
+
if (playSpeed > 2) {
|
|
103
|
+
playerSpeedButton.innerHTML = `1`;
|
|
104
|
+
plyr.speed = 1;
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (playSpeed === 1.75) {
|
|
109
|
+
plyr.speed = playSpeed + 0.25
|
|
110
|
+
playerSpeedButton.innerHTML = `${playSpeed + 0.25}`;
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
plyr.speed = playSpeed;
|
|
115
|
+
playerSpeedButton.innerHTML = `${playSpeed}`;
|
|
116
|
+
|
|
117
|
+
instance.playerControl.mobileEvents.showControls(instance);
|
|
118
|
+
})
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
87
122
|
}
|