@latest-thinking/lt-player 1.0.8-g → 1.0.9
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 +0 -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
|
@@ -10,6 +10,7 @@ export class LTPlayerMobileSettingsControllers implements SettingsControlsInterf
|
|
|
10
10
|
|
|
11
11
|
init() {
|
|
12
12
|
this.addOpenSettingsEventButton();
|
|
13
|
+
this.setButtonSpeed();
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
addOpenSettingsEventButton() {
|
|
@@ -155,39 +156,39 @@ export class LTPlayerMobileSettingsControllers implements SettingsControlsInterf
|
|
|
155
156
|
instance.setInactiveModal();
|
|
156
157
|
})
|
|
157
158
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
159
|
+
setButtonSpeed() {
|
|
160
|
+
let playerControlsContainer = this.settingsInstance.playerInstance.plyr.elements.controls;
|
|
161
|
+
let playerSpeedButton = playerControlsContainer.querySelector('.plyr__controls_speed-button');
|
|
162
|
+
let plyr = this.settingsInstance.playerInstance.plyr;
|
|
163
|
+
let instance = this.settingsInstance.playerInstance;
|
|
164
|
+
|
|
165
|
+
if (playerSpeedButton) {
|
|
166
|
+
playerSpeedButton.innerHTML = `${this.settingsInstance.playerInstance.plyr.speed}`;
|
|
167
|
+
let mobileEvent: HammerManager = this.settingsInstance.playerInstance.eventInstance.mobileEvents.setMobileEvent(playerSpeedButton);
|
|
168
|
+
if (mobileEvent) {
|
|
169
|
+
mobileEvent.on('singletap', function LTPlayerMobileSpeedButton() {
|
|
170
|
+
|
|
171
|
+
let playSpeed = plyr.speed + 0.25;
|
|
172
|
+
|
|
173
|
+
if (playSpeed > 2) {
|
|
174
|
+
playerSpeedButton.innerHTML = `1`;
|
|
175
|
+
plyr.speed = 1;
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if (playSpeed === 1.75) {
|
|
180
|
+
plyr.speed = playSpeed + 0.25
|
|
181
|
+
playerSpeedButton.innerHTML = `${playSpeed + 0.25}`;
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
plyr.speed = playSpeed;
|
|
186
|
+
playerSpeedButton.innerHTML = `${playSpeed}`;
|
|
187
|
+
|
|
188
|
+
instance.playerControl.mobileEvents.showControls(instance);
|
|
189
|
+
})
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
192
193
|
|
|
193
194
|
}
|
|
@@ -140,8 +140,12 @@ export class LTPlayerDesktop extends LTPlayerCommon implements EventsInterfaces
|
|
|
140
140
|
let instance: LTPlayer.PortraitType | LTPlayer.LandscapeType = this.player;
|
|
141
141
|
let plyr: Plyr = this.plyr;
|
|
142
142
|
|
|
143
|
-
plyr.on('enterfullscreen', function LTPlayerDesktopEnterFullScreen() {
|
|
143
|
+
plyr.on('enterfullscreen', function LTPlayerDesktopEnterFullScreen(event) {
|
|
144
144
|
//remove mini player on fullscreen
|
|
145
|
+
const target = event.target as HTMLElement;
|
|
146
|
+
const parent = target.closest('.lt-player');
|
|
147
|
+
|
|
148
|
+
parent.classList.add('is-fullscreen');
|
|
145
149
|
instance.miniPlayer.event.removeMiniPLOnFullScreen(instance, 'enterfullscreen');
|
|
146
150
|
|
|
147
151
|
//fullscreen icon
|
|
@@ -151,8 +155,12 @@ export class LTPlayerDesktop extends LTPlayerCommon implements EventsInterfaces
|
|
|
151
155
|
|
|
152
156
|
});
|
|
153
157
|
|
|
154
|
-
plyr.on('exitfullscreen', function LTPlayerDesktopExitFullScreen() {
|
|
158
|
+
plyr.on('exitfullscreen', function LTPlayerDesktopExitFullScreen(event) {
|
|
155
159
|
//add mini player on exit fullscreen
|
|
160
|
+
const target = event.target as HTMLElement;
|
|
161
|
+
const parent = target.closest('.lt-player');
|
|
162
|
+
|
|
163
|
+
parent.classList.remove('is-fullscreen');
|
|
156
164
|
instance.miniPlayer.event.removeMiniPLOnFullScreen(instance, 'exitfullscreen');
|
|
157
165
|
|
|
158
166
|
//fullscreen icon
|
|
@@ -54,6 +54,8 @@ export class LTPlayerMobile extends LTPlayerCommon implements EventsInterfaces {
|
|
|
54
54
|
instance.playerId = instance.playerConfig.getPlayerId();
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
eventManager.setDefaultSettingsConfig();
|
|
58
|
+
|
|
57
59
|
if (instance.plyr.isHTML5) {
|
|
58
60
|
|
|
59
61
|
if (instance.hls) {
|
|
@@ -70,12 +72,12 @@ export class LTPlayerMobile extends LTPlayerCommon implements EventsInterfaces {
|
|
|
70
72
|
}
|
|
71
73
|
}
|
|
72
74
|
|
|
73
|
-
eventManager.setDefaultSettingsConfig();
|
|
74
|
-
|
|
75
75
|
instance.posterManager.mobileEvents.showControls(instance);
|
|
76
76
|
|
|
77
77
|
instance.playerControl.mobileEvents.controlsTimeShow(instance);
|
|
78
78
|
|
|
79
|
+
instance.playerControl.mobileEvents.fullScreenButtons(instance);
|
|
80
|
+
|
|
79
81
|
//set play/pause icon
|
|
80
82
|
instance.playerControl.mobileEvents.playPauseIcon(instance, 'ready');
|
|
81
83
|
|
|
@@ -84,7 +86,7 @@ export class LTPlayerMobile extends LTPlayerCommon implements EventsInterfaces {
|
|
|
84
86
|
instance.playerControl.mobileEvents.backwardForwardSeconds(instance);
|
|
85
87
|
|
|
86
88
|
//remove volume controller
|
|
87
|
-
|
|
89
|
+
instance.playerControl.mobileEvents.volume(instance);
|
|
88
90
|
|
|
89
91
|
//set settings controller
|
|
90
92
|
instance.playerControl.settingsControlsManager.init(instance);
|
|
@@ -128,14 +130,24 @@ export class LTPlayerMobile extends LTPlayerCommon implements EventsInterfaces {
|
|
|
128
130
|
let instance: LTPlayer.PortraitType | LTPlayer.LandscapeType = this.player;
|
|
129
131
|
let plyr: Plyr = this.plyr;
|
|
130
132
|
|
|
131
|
-
plyr.on('enterfullscreen', function LTPlayerDesktopEnterFullScreen() {
|
|
133
|
+
plyr.on('enterfullscreen', function LTPlayerDesktopEnterFullScreen(event) {
|
|
134
|
+
const target = event.target as HTMLElement;
|
|
135
|
+
const parent = target.closest('.lt-player');
|
|
136
|
+
|
|
137
|
+
parent.classList.add('is-fullscreen');
|
|
138
|
+
instance.miniPlayer.event.removeMiniPLOnFullScreen(instance, 'enterfullscreen');
|
|
132
139
|
//fullscreen icon
|
|
133
140
|
instance.playerControl.desktopEvents.fullscreenIcon(instance, 'enterfullscreen');
|
|
134
141
|
|
|
135
142
|
instance.videoService.removeObjectFit();
|
|
136
143
|
});
|
|
137
144
|
|
|
138
|
-
plyr.on('exitfullscreen', function LTPlayerDesktopExitFullScreen() {
|
|
145
|
+
plyr.on('exitfullscreen', function LTPlayerDesktopExitFullScreen(event) {
|
|
146
|
+
const target = event.target as HTMLElement;
|
|
147
|
+
const parent = target.closest('.lt-player');
|
|
148
|
+
|
|
149
|
+
parent.classList.remove('is-fullscreen');
|
|
150
|
+
instance.miniPlayer.event.removeMiniPLOnFullScreen(instance, 'exitfullscreen');
|
|
139
151
|
//fullscreen icon
|
|
140
152
|
instance.playerControl.desktopEvents.fullscreenIcon(instance, 'exitfullscreen');
|
|
141
153
|
instance.videoService.appendObjectFit();
|
|
@@ -185,15 +197,13 @@ export class LTPlayerMobile extends LTPlayerCommon implements EventsInterfaces {
|
|
|
185
197
|
|
|
186
198
|
//check if getDevice is mobile or desktop
|
|
187
199
|
if (instance.player.playerConfig.getDevice() === 'mobile') {
|
|
188
|
-
|
|
189
200
|
const manager = new Hammer.Manager(selector);
|
|
190
|
-
|
|
191
201
|
manager.add(new Hammer.Pan({
|
|
192
202
|
direction : 30
|
|
193
203
|
}))
|
|
194
204
|
|
|
195
205
|
manager.add(new Hammer.Tap({
|
|
196
|
-
event : '
|
|
206
|
+
event : 'tripletap',
|
|
197
207
|
taps : 3
|
|
198
208
|
}));
|
|
199
209
|
|
|
@@ -208,9 +218,9 @@ export class LTPlayerMobile extends LTPlayerCommon implements EventsInterfaces {
|
|
|
208
218
|
|
|
209
219
|
manager.get('doubletap').recognizeWith('singletap');
|
|
210
220
|
manager.get('singletap').requireFailure('doubletap');
|
|
211
|
-
manager.get('
|
|
212
|
-
manager.get('doubletap').requireFailure('
|
|
213
|
-
manager.get('pan').set({direction: Hammer.DIRECTION_DOWN})
|
|
221
|
+
manager.get('tripletap').recognizeWith('doubletap');
|
|
222
|
+
manager.get('doubletap').requireFailure('tripletap');
|
|
223
|
+
manager.get('pan').set({direction: Hammer.DIRECTION_DOWN});
|
|
214
224
|
|
|
215
225
|
return manager;
|
|
216
226
|
}
|
|
@@ -212,34 +212,37 @@ export class ResizeService {
|
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
|
|
215
|
-
if (containerWidth >= 380) {
|
|
215
|
+
// if (containerWidth >= 380) {
|
|
216
|
+
//
|
|
217
|
+
// if (this.addInfoInSide && (containerWidth + 70 <= 380)) {
|
|
218
|
+
// return;
|
|
219
|
+
// }
|
|
220
|
+
//
|
|
221
|
+
// if (this.addInfoOutSide) {
|
|
222
|
+
// return;
|
|
223
|
+
// }
|
|
224
|
+
//
|
|
225
|
+
// this.addInfoOutSide = true;
|
|
226
|
+
// this.addInfoInSide = false;
|
|
227
|
+
//
|
|
228
|
+
// createAddInfoButtonsOutSide();
|
|
229
|
+
// } else {
|
|
230
|
+
//
|
|
231
|
+
// if (this.addInfoOutSide && (containerWidth + 70 >= 380)) {
|
|
232
|
+
// return;
|
|
233
|
+
// }
|
|
234
|
+
//
|
|
235
|
+
// if (this.addInfoInSide) {
|
|
236
|
+
// return;
|
|
237
|
+
// }
|
|
238
|
+
//
|
|
239
|
+
// this.addInfoInSide = true;
|
|
240
|
+
// this.addInfoOutSide = false;
|
|
241
|
+
// createAddInfoButtonsInSide();
|
|
242
|
+
// }
|
|
243
|
+
|
|
244
|
+
createAddInfoButtonsInSide();
|
|
216
245
|
|
|
217
|
-
if (this.addInfoInSide && (containerWidth + 70 <= 380)) {
|
|
218
|
-
return;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
if (this.addInfoOutSide) {
|
|
222
|
-
return;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
this.addInfoOutSide = true;
|
|
226
|
-
this.addInfoInSide = false;
|
|
227
|
-
|
|
228
|
-
createAddInfoButtonsOutSide();
|
|
229
|
-
} else {
|
|
230
|
-
|
|
231
|
-
if (this.addInfoOutSide && (containerWidth + 70 >= 380)) {
|
|
232
|
-
return;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
if (this.addInfoInSide) {
|
|
236
|
-
return;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
this.addInfoInSide = true;
|
|
240
|
-
this.addInfoOutSide = false;
|
|
241
|
-
createAddInfoButtonsInSide();
|
|
242
|
-
}
|
|
243
246
|
}
|
|
244
247
|
|
|
245
248
|
protected setDimensions(containerWidth: number, containerHeight: number, defaultData: defaultType) {
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
{{#modal}}
|
|
2
2
|
{{#mobile}}
|
|
3
|
+
{{#data}}
|
|
4
|
+
<div class="player-lt__modal__mobile__background"></div>
|
|
5
|
+
<div class="player-lt__modal__mobile">
|
|
6
|
+
<div class="player-lt__mobile__modal-header">
|
|
7
|
+
<span class="line-button"></span>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="player-lt__mobile__modal-content">
|
|
10
|
+
{{{data}}}
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
{{/data}}
|
|
3
14
|
{{#object_data}}
|
|
4
15
|
<div class="player-lt__modal__mobile__background"></div>
|
|
5
16
|
<div class="player-lt__modal__mobile">
|
|
@@ -28,7 +39,6 @@
|
|
|
28
39
|
</div>
|
|
29
40
|
</div>
|
|
30
41
|
{{/object_data}}
|
|
31
|
-
|
|
32
42
|
{{/mobile}}
|
|
33
43
|
{{#desktop}}
|
|
34
44
|
{{#object_data}}
|
|
@@ -208,17 +208,26 @@
|
|
|
208
208
|
<div class="top-controllers__body__center">
|
|
209
209
|
<p class="chapter"></p>
|
|
210
210
|
</div>
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
211
|
+
<div class="top-controllers__body__right">
|
|
212
|
+
{{#desktop}}
|
|
213
|
+
<button type="button" class="plyr__control fullscreen-custom-control">
|
|
214
|
+
<img class="filter minimize d-none" src="{{icons.minimize}}" alt="">
|
|
215
|
+
<img class="filter maximize" src="{{icons.maximize}}" alt="">
|
|
216
|
+
</button>
|
|
217
|
+
<button type="button" class="plyr__control mini-player-control">
|
|
218
|
+
<img class="filter" src="{{icons.mini-player}}" alt="">
|
|
219
|
+
</button>
|
|
220
|
+
{{/desktop}}
|
|
221
|
+
{{#mobile}}
|
|
222
|
+
<button type="button" class="plyr__control fullscreen-custom-control">
|
|
223
|
+
<img class="filter minimize d-none" src="{{icons.minimize}}" alt="">
|
|
224
|
+
<img class="filter maximize" src="{{icons.maximize}}" alt="">
|
|
225
|
+
</button>
|
|
226
|
+
<button type="button" class="plyr__control mini-player-control">
|
|
227
|
+
<img class="filter" src="{{icons.mini-player}}" alt="">
|
|
228
|
+
</button>
|
|
229
|
+
{{/mobile}}
|
|
230
|
+
</div>
|
|
222
231
|
</div>
|
|
223
232
|
</div>
|
|
224
233
|
<div class="lt-player-notification portrait">
|
|
@@ -275,9 +284,12 @@
|
|
|
275
284
|
<div class="bottom-controller">
|
|
276
285
|
{{#mobile}}
|
|
277
286
|
<div class="bottom-controller__left-buttons">
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
287
|
+
<div class="bottom-controller__volume_control">
|
|
288
|
+
<button type="button" class="plyr__control volume_control__volume-button button-open">
|
|
289
|
+
<img class="volume-max filter button-open" data-range-value="1" src="{{icons.volume-3}}" alt="">
|
|
290
|
+
<img class="volume-mute d-none filter button-open" data-range-value="0" src="{{icons.mute}}" alt="">
|
|
291
|
+
</button>
|
|
292
|
+
</div>
|
|
281
293
|
</div>
|
|
282
294
|
{{/mobile}}
|
|
283
295
|
{{#desktop}}
|
|
@@ -321,6 +333,9 @@
|
|
|
321
333
|
</div>
|
|
322
334
|
{{#mobile}}
|
|
323
335
|
<div class="bottom-controller__right-buttons">
|
|
336
|
+
<button type="button" class="plyr__control plyr__controls_speed-button">
|
|
337
|
+
<span class="playback-speed"></span>
|
|
338
|
+
</button>
|
|
324
339
|
</div>
|
|
325
340
|
{{/mobile}}
|
|
326
341
|
{{#mobile}}
|
|
@@ -329,8 +344,8 @@
|
|
|
329
344
|
|
|
330
345
|
{{#desktop}}
|
|
331
346
|
<div class="bottom-controller__right-buttons">
|
|
332
|
-
<button type="button" class="plyr__control
|
|
333
|
-
|
|
347
|
+
<button type="button" class="plyr__control plyr__controls_speed-button">
|
|
348
|
+
<span class="playback-speed></span>
|
|
334
349
|
</button>
|
|
335
350
|
</div>
|
|
336
351
|
{{/desktop}}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
</div>
|
|
4
4
|
{{/embedded}}
|
|
5
5
|
{{#video}}
|
|
6
|
-
<video class="embed_player lt-player-wrapper" playsinline controls>
|
|
6
|
+
<video class="embed_player lt-player-wrapper" playsinline controls crossorigin preload="none">
|
|
7
7
|
<source src="{{videoUrl.videoUrl}}"/>
|
|
8
8
|
{{#defaultConfig.captions}}
|
|
9
9
|
<track kind="captions" label="{{label}} captions" src="{{url}}" srclang="{{srclang}}" {{default}} />
|