@latest-thinking/lt-player 1.1.0 → 1.2.0
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 +27 -52
- 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
|
@@ -56,34 +56,35 @@ export namespace LTPlayerEvents {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
const volumeControl = controls.querySelector('.bottom-controller__volume_control');
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
if (volumeControl) {
|
|
60
|
+
const volumeButton = volumeControl.querySelector('.button-open');
|
|
61
|
+
const volumeBackground = volumeControl.querySelector('.volume_control__background');
|
|
62
|
+
const volumeBackgroundArea = volumeControl.querySelector('.volume_control__background__area');
|
|
63
|
+
const volumeArea = volumeControl.querySelector('.volume_control__background__area__range');
|
|
64
64
|
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
if (volumeButton) {
|
|
67
|
+
volumeButton.classList.remove('d-none');
|
|
68
|
+
}
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
if (volumeBackground) {
|
|
71
|
+
volumeBackground.classList.add('d-none')
|
|
72
|
+
}
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
if (volumeBackgroundArea) {
|
|
75
|
+
volumeBackgroundArea.classList.add('d-none')
|
|
76
|
+
}
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
if (volumeArea) {
|
|
79
|
+
volumeArea.classList.remove('volume-area-open')
|
|
80
|
+
}
|
|
81
81
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
if (volumeControl) {
|
|
83
|
+
volumeControl.classList.remove('volume-area-open');
|
|
84
|
+
volumeControl.classList.remove('volume-control-enable');
|
|
85
|
+
}
|
|
85
86
|
}
|
|
86
|
-
|
|
87
|
+
const controlsBackground = player.elements.container.querySelector('.plyr__controls__mobile-background');
|
|
87
88
|
if (controlsBackground) {
|
|
88
89
|
if (!controlsBackground.classList.contains('d-none')) {
|
|
89
90
|
controlsBackground.classList.add('d-none');
|
|
@@ -182,6 +183,8 @@ export namespace LTPlayerEvents {
|
|
|
182
183
|
if (!instance.plyr.elements.container.classList.contains('plyr__poster-enabled')) {
|
|
183
184
|
instance.plyr.elements.container.classList.add('plyr__poster-enabled');
|
|
184
185
|
}
|
|
186
|
+
|
|
187
|
+
instance.statusFeedbackService.clearLoading()
|
|
185
188
|
}
|
|
186
189
|
|
|
187
190
|
}
|
|
@@ -9,11 +9,23 @@ export class LTPlayerCommon {
|
|
|
9
9
|
player: LTPlayer.PortraitType | LTPlayer.LandscapeType;
|
|
10
10
|
plyr: Plyr;
|
|
11
11
|
|
|
12
|
+
setupCommon() {
|
|
13
|
+
this.playerPlay()
|
|
14
|
+
this.plyrOnPlaying()
|
|
15
|
+
this.plyrOnSeeking()
|
|
16
|
+
this.plyrOnControlsShown()
|
|
17
|
+
this.plyrOnCanplay()
|
|
18
|
+
}
|
|
19
|
+
|
|
12
20
|
playerPlay() {
|
|
13
21
|
const instance = this.player;
|
|
14
22
|
|
|
15
23
|
this.plyr.on('play', function LTPlayerPlay(event) {
|
|
16
24
|
|
|
25
|
+
if (!instance.plyr.elements.controls.classList.contains('plyr__controls-enable')) {
|
|
26
|
+
instance.plyr.elements.controls.classList.add('plyr__controls-enable');
|
|
27
|
+
}
|
|
28
|
+
|
|
17
29
|
instance.desktopEvents.playPause(event);
|
|
18
30
|
|
|
19
31
|
if (instance.additionalInfoService) {
|
|
@@ -27,26 +39,25 @@ export class LTPlayerCommon {
|
|
|
27
39
|
|
|
28
40
|
instance.plyr.speed = 1;
|
|
29
41
|
|
|
30
|
-
instance.plyr.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
// }
|
|
42
|
+
if (!instance.plyr.isEmbed) {
|
|
43
|
+
let checkCaptions = (instance.plyr as plyr).captions;
|
|
44
|
+
|
|
45
|
+
if (checkCaptions.currentTrack >= 0) {
|
|
46
|
+
instance.plyr.toggleCaptions(true);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
instance.plyr.toggleCaptions(false);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
instance.plyr.embed.getTextTracks().then( (response: string | any[]) => {
|
|
54
|
+
if (response.length !== 0) {
|
|
55
|
+
instance.plyr.toggleCaptions(true);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
instance.plyr.toggleCaptions(false);
|
|
59
|
+
|
|
60
|
+
})
|
|
50
61
|
}
|
|
51
62
|
removeDesktopPlyrEvents() {
|
|
52
63
|
let plyrInstance = this.plyr as Plyr as Plyr & { eventListeners: Array<any> }
|
|
@@ -175,4 +186,67 @@ export class LTPlayerCommon {
|
|
|
175
186
|
}
|
|
176
187
|
}
|
|
177
188
|
|
|
189
|
+
setCustomSubtitles(controls: HTMLElement, event: Plyr.PlyrEvent )
|
|
190
|
+
{
|
|
191
|
+
const eventPlayer: any = event.detail.plyr;
|
|
192
|
+
|
|
193
|
+
const customSubtitlesElement = controls.querySelector('.lt-player-custom-captions');
|
|
194
|
+
const spanElement = customSubtitlesElement.querySelector('span');
|
|
195
|
+
|
|
196
|
+
if (!spanElement) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
if (!eventPlayer.captions.currentTrackNode.activeCues) {
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
if (eventPlayer.captions.currentTrackNode.activeCues.length > 0) {
|
|
203
|
+
spanElement.innerHTML = eventPlayer.captions.currentTrackNode.activeCues[0].text;
|
|
204
|
+
} else {
|
|
205
|
+
spanElement.innerHTML = ''; // Clear previous captions
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
clearCustomSubtitles(controls: HTMLElement)
|
|
210
|
+
{
|
|
211
|
+
const customSubtitlesElement = controls.querySelector('.lt-player-custom-captions');
|
|
212
|
+
const spanElement = customSubtitlesElement.querySelector('span');
|
|
213
|
+
|
|
214
|
+
if (!spanElement) {
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
spanElement.innerHTML = ''; // Clear previous captions
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
plyrOnSeeking() {
|
|
221
|
+
const instance: LTPlayer.PortraitType | LTPlayer.LandscapeType = this.player;
|
|
222
|
+
const plyr: Plyr = this.plyr;
|
|
223
|
+
plyr.on('seeking', () => {
|
|
224
|
+
instance.statusFeedbackService.setLoadingSeek()
|
|
225
|
+
})
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
plyrOnPlaying() {
|
|
229
|
+
const instance: LTPlayer.PortraitType | LTPlayer.LandscapeType = this.player;
|
|
230
|
+
const plyr: Plyr = this.plyr;
|
|
231
|
+
plyr.on('playing', () => {
|
|
232
|
+
instance.statusFeedbackService.clearLoading()
|
|
233
|
+
})
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
plyrOnCanplay() {
|
|
237
|
+
const instance: LTPlayer.PortraitType | LTPlayer.LandscapeType = this.player;
|
|
238
|
+
const plyr: Plyr = this.plyr;
|
|
239
|
+
plyr.on('canplay', () => {
|
|
240
|
+
instance.statusFeedbackService.clearLoading()
|
|
241
|
+
})
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
plyrOnControlsShown() {
|
|
245
|
+
const instance: LTPlayer.PortraitType | LTPlayer.LandscapeType = this.player;
|
|
246
|
+
const plyr: Plyr = this.plyr;
|
|
247
|
+
plyr.on('controlsshown', () => {
|
|
248
|
+
instance.statusFeedbackService.setControlsVisible()
|
|
249
|
+
})
|
|
250
|
+
}
|
|
251
|
+
|
|
178
252
|
}
|
|
@@ -13,7 +13,6 @@ export class LTPlayerDesktop extends LTPlayerCommon implements EventsInterfaces
|
|
|
13
13
|
this.plyr = eventManager.plyr;
|
|
14
14
|
|
|
15
15
|
//init common events
|
|
16
|
-
this.playerPlay();
|
|
17
16
|
this.removeDesktopPlyrEvents();
|
|
18
17
|
|
|
19
18
|
//init desktop events
|
|
@@ -25,6 +24,9 @@ export class LTPlayerDesktop extends LTPlayerCommon implements EventsInterfaces
|
|
|
25
24
|
this.plyrOnPlay();
|
|
26
25
|
this.plyrOnPause();
|
|
27
26
|
this.plyrOnSeek();
|
|
27
|
+
this.plyrOnCueChange();
|
|
28
|
+
|
|
29
|
+
this.setupCommon()
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
plyrOnSeek():void {
|
|
@@ -33,6 +35,10 @@ export class LTPlayerDesktop extends LTPlayerCommon implements EventsInterfaces
|
|
|
33
35
|
let plyr: Plyr = this.plyr;
|
|
34
36
|
|
|
35
37
|
plyr.on('seeked', function LTPlayerSeek(){
|
|
38
|
+
if (plyr.stopped === true) {
|
|
39
|
+
eventManager.endVideo()
|
|
40
|
+
}
|
|
41
|
+
|
|
36
42
|
if (plyr.isEmbed) {
|
|
37
43
|
if (plyr.paused) {
|
|
38
44
|
return;
|
|
@@ -142,10 +148,8 @@ export class LTPlayerDesktop extends LTPlayerCommon implements EventsInterfaces
|
|
|
142
148
|
|
|
143
149
|
plyr.on('enterfullscreen', function LTPlayerDesktopEnterFullScreen(event) {
|
|
144
150
|
//remove mini player on fullscreen
|
|
145
|
-
const target = event.target as HTMLElement;
|
|
146
|
-
const parent = target.closest('.lt-player');
|
|
147
151
|
|
|
148
|
-
|
|
152
|
+
instance.statusFeedbackService.setFullscreen()
|
|
149
153
|
instance.miniPlayer.event.removeMiniPLOnFullScreen(instance, 'enterfullscreen');
|
|
150
154
|
|
|
151
155
|
//fullscreen icon
|
|
@@ -157,10 +161,8 @@ export class LTPlayerDesktop extends LTPlayerCommon implements EventsInterfaces
|
|
|
157
161
|
|
|
158
162
|
plyr.on('exitfullscreen', function LTPlayerDesktopExitFullScreen(event) {
|
|
159
163
|
//add mini player on exit fullscreen
|
|
160
|
-
const target = event.target as HTMLElement;
|
|
161
|
-
const parent = target.closest('.lt-player');
|
|
162
164
|
|
|
163
|
-
|
|
165
|
+
instance.statusFeedbackService.clearFullscreen()
|
|
164
166
|
instance.miniPlayer.event.removeMiniPLOnFullScreen(instance, 'exitfullscreen');
|
|
165
167
|
|
|
166
168
|
//fullscreen icon
|
|
@@ -190,6 +192,7 @@ export class LTPlayerDesktop extends LTPlayerCommon implements EventsInterfaces
|
|
|
190
192
|
let instance: LTPlayer.PortraitType | LTPlayer.LandscapeType = this.player;
|
|
191
193
|
let plyr: Plyr = this.plyr;
|
|
192
194
|
plyr.on('play', function LTPlayerDesktopTimeUpdate(event) {
|
|
195
|
+
instance.statusFeedbackService.setLoading()
|
|
193
196
|
LoaderService.removeSpinner(plyr.elements.container)
|
|
194
197
|
instance.playerControl.desktopEvents.playPauseIcon(instance, 'timeupdate');
|
|
195
198
|
})
|
|
@@ -205,4 +208,15 @@ export class LTPlayerDesktop extends LTPlayerCommon implements EventsInterfaces
|
|
|
205
208
|
})
|
|
206
209
|
}
|
|
207
210
|
|
|
211
|
+
plyrOnCueChange() {
|
|
212
|
+
let common = this;
|
|
213
|
+
let instance: LTPlayer.PortraitType | LTPlayer.LandscapeType = this.player;
|
|
214
|
+
let plyr: Plyr = this.plyr;
|
|
215
|
+
|
|
216
|
+
plyr.on('cuechange', function LTPlayerDesktopTimeUpdate(event) {
|
|
217
|
+
if (instance.playerConfig.getCaptionsEnabled() && plyr.currentTrack >= 0) {
|
|
218
|
+
common.setCustomSubtitles(plyr.elements.controls, event)
|
|
219
|
+
}
|
|
220
|
+
})
|
|
221
|
+
}
|
|
208
222
|
}
|
|
@@ -13,7 +13,6 @@ export class LTPlayerMobile extends LTPlayerCommon implements EventsInterfaces {
|
|
|
13
13
|
this.plyr = eventManager.plyr;
|
|
14
14
|
|
|
15
15
|
//init common events
|
|
16
|
-
this.playerPlay();
|
|
17
16
|
this.removeMobilePlyrEvents();
|
|
18
17
|
|
|
19
18
|
//init mobile events
|
|
@@ -25,6 +24,9 @@ export class LTPlayerMobile extends LTPlayerCommon implements EventsInterfaces {
|
|
|
25
24
|
this.plyrOnPlay();
|
|
26
25
|
this.plyrOnPause();
|
|
27
26
|
this.plyrOnSeek();
|
|
27
|
+
this.plyrOnCueChange()
|
|
28
|
+
|
|
29
|
+
this.setupCommon()
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
plyrOnSeek():void {
|
|
@@ -33,6 +35,10 @@ export class LTPlayerMobile extends LTPlayerCommon implements EventsInterfaces {
|
|
|
33
35
|
let plyr: Plyr = this.plyr;
|
|
34
36
|
|
|
35
37
|
plyr.on('seeked', function LTPlayerSeek(){
|
|
38
|
+
if (plyr.stopped === true) {
|
|
39
|
+
eventManager.endVideo()
|
|
40
|
+
}
|
|
41
|
+
|
|
36
42
|
if (plyr.isEmbed) {
|
|
37
43
|
if (plyr.paused) {
|
|
38
44
|
return;
|
|
@@ -131,10 +137,7 @@ export class LTPlayerMobile extends LTPlayerCommon implements EventsInterfaces {
|
|
|
131
137
|
let plyr: Plyr = this.plyr;
|
|
132
138
|
|
|
133
139
|
plyr.on('enterfullscreen', function LTPlayerDesktopEnterFullScreen(event) {
|
|
134
|
-
|
|
135
|
-
const parent = target.closest('.lt-player');
|
|
136
|
-
|
|
137
|
-
parent.classList.add('is-fullscreen');
|
|
140
|
+
instance.statusFeedbackService.setFullscreen()
|
|
138
141
|
instance.miniPlayer.event.removeMiniPLOnFullScreen(instance, 'enterfullscreen');
|
|
139
142
|
//fullscreen icon
|
|
140
143
|
instance.playerControl.desktopEvents.fullscreenIcon(instance, 'enterfullscreen');
|
|
@@ -143,10 +146,7 @@ export class LTPlayerMobile extends LTPlayerCommon implements EventsInterfaces {
|
|
|
143
146
|
});
|
|
144
147
|
|
|
145
148
|
plyr.on('exitfullscreen', function LTPlayerDesktopExitFullScreen(event) {
|
|
146
|
-
|
|
147
|
-
const parent = target.closest('.lt-player');
|
|
148
|
-
|
|
149
|
-
parent.classList.remove('is-fullscreen');
|
|
149
|
+
instance.statusFeedbackService.clearFullscreen()
|
|
150
150
|
instance.miniPlayer.event.removeMiniPLOnFullScreen(instance, 'exitfullscreen');
|
|
151
151
|
//fullscreen icon
|
|
152
152
|
instance.playerControl.desktopEvents.fullscreenIcon(instance, 'exitfullscreen');
|
|
@@ -177,7 +177,7 @@ export class LTPlayerMobile extends LTPlayerCommon implements EventsInterfaces {
|
|
|
177
177
|
let plyr: Plyr = this.plyr;
|
|
178
178
|
|
|
179
179
|
plyr.on('play', function LTPlayerDesktopTimeUpdate(event) {
|
|
180
|
-
|
|
180
|
+
instance.statusFeedbackService.setLoading()
|
|
181
181
|
instance.playerControl.desktopEvents.playPauseIcon(instance, 'timeupdate');
|
|
182
182
|
})
|
|
183
183
|
}
|
|
@@ -228,4 +228,16 @@ export class LTPlayerMobile extends LTPlayerCommon implements EventsInterfaces {
|
|
|
228
228
|
return undefined;
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
+
plyrOnCueChange() {
|
|
232
|
+
let common = this;
|
|
233
|
+
let instance: LTPlayer.PortraitType | LTPlayer.LandscapeType = this.player;
|
|
234
|
+
let plyr: Plyr = this.plyr;
|
|
235
|
+
|
|
236
|
+
plyr.on('cuechange', function LTPlayerDesktopTimeUpdate(event) {
|
|
237
|
+
if (instance.playerConfig.getCaptionsEnabled() && plyr.currentTrack >= 0) {
|
|
238
|
+
common.setCustomSubtitles(plyr.elements.controls, event)
|
|
239
|
+
}
|
|
240
|
+
})
|
|
241
|
+
}
|
|
242
|
+
|
|
231
243
|
}
|
|
@@ -13,6 +13,8 @@ import {LTPlayerPosterManager} from "../../components/poster/LTPlayerPosterManag
|
|
|
13
13
|
import {LTPlayerShareManager} from "../../components/share/LTPlayerShareManager";
|
|
14
14
|
import {LTPlayerHls} from "../../components/LTPlayerHls";
|
|
15
15
|
import {LTPlayerVideo} from "../../components/video/LTPlayerVideo";
|
|
16
|
+
import {LTPlayerCaptionsManager} from "../../components/captions/LTPlayerCaptions";
|
|
17
|
+
import {LTPlayerStatusFeedback} from "../../components/LTPlayerStatusFeedback";
|
|
16
18
|
|
|
17
19
|
/**
|
|
18
20
|
* Default Player type Service
|
|
@@ -36,6 +38,9 @@ export class LTPlayerController {
|
|
|
36
38
|
share : LTPlayerShareManager
|
|
37
39
|
hls : LTPlayerHls
|
|
38
40
|
videoService : LTPlayerVideo
|
|
41
|
+
captionsService : LTPlayerCaptionsManager
|
|
42
|
+
statusFeedbackService: LTPlayerStatusFeedback
|
|
43
|
+
|
|
39
44
|
/**
|
|
40
45
|
* Base player type service
|
|
41
46
|
*/
|
|
@@ -47,5 +52,7 @@ export class LTPlayerController {
|
|
|
47
52
|
this.posterManager = new LTPlayerPosterManager();
|
|
48
53
|
this.share = new LTPlayerShareManager();
|
|
49
54
|
this.videoService = new LTPlayerVideo();
|
|
55
|
+
this.captionsService = new LTPlayerCaptionsManager(this);
|
|
56
|
+
this.statusFeedbackService = new LTPlayerStatusFeedback(this);
|
|
50
57
|
}
|
|
51
58
|
}
|
package/src/services/Helper.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {defaultType} from "../global/types/ModuleTypes";
|
|
2
2
|
|
|
3
3
|
export class Helper {
|
|
4
|
+
|
|
4
5
|
static getDevice() {
|
|
5
6
|
let device = 'desktop'; //initiate as false
|
|
6
7
|
if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)
|
|
@@ -10,7 +11,11 @@ export class Helper {
|
|
|
10
11
|
return device;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
static setDebugEvent(data: string | object, type
|
|
14
|
+
static setDebugEvent(data: string | object, type?: string) {
|
|
15
|
+
if (type === undefined) {
|
|
16
|
+
type = 'info'
|
|
17
|
+
}
|
|
18
|
+
|
|
14
19
|
if (process.env.DEBUG === "true") {
|
|
15
20
|
switch (type) {
|
|
16
21
|
case 'info':
|
|
@@ -20,8 +20,8 @@ export class ResizeService {
|
|
|
20
20
|
playerType: string
|
|
21
21
|
addInfo: LTPLayerAddInfoResizeManager
|
|
22
22
|
|
|
23
|
-
addInfoOutSide:
|
|
24
|
-
addInfoInSide:
|
|
23
|
+
addInfoOutSide: false
|
|
24
|
+
addInfoInSide: true
|
|
25
25
|
|
|
26
26
|
playerParam: defaultType = {
|
|
27
27
|
width : null,
|
|
@@ -212,37 +212,42 @@ export class ResizeService {
|
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
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
|
-
// }
|
|
215
|
+
if (this.playerInstance.playerConfig.getEmbed()) {
|
|
216
|
+
createAddInfoButtonsInSide();
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
243
219
|
|
|
244
220
|
createAddInfoButtonsInSide();
|
|
245
221
|
|
|
222
|
+
|
|
223
|
+
// if (containerWidth >= 380) {
|
|
224
|
+
//
|
|
225
|
+
// if (this.addInfoInSide && (containerWidth + 70 <= 380)) {
|
|
226
|
+
// return;
|
|
227
|
+
// }
|
|
228
|
+
//
|
|
229
|
+
// if (this.addInfoOutSide) {
|
|
230
|
+
// return;
|
|
231
|
+
// }
|
|
232
|
+
//
|
|
233
|
+
// this.addInfoOutSide = true;
|
|
234
|
+
// this.addInfoInSide = false;
|
|
235
|
+
//
|
|
236
|
+
// createAddInfoButtonsOutSide();
|
|
237
|
+
// } else {
|
|
238
|
+
//
|
|
239
|
+
// if (this.addInfoOutSide && (containerWidth + 70 >= 380)) {
|
|
240
|
+
// return;
|
|
241
|
+
// }
|
|
242
|
+
//
|
|
243
|
+
// if (this.addInfoInSide) {
|
|
244
|
+
// return;
|
|
245
|
+
// }
|
|
246
|
+
//
|
|
247
|
+
// this.addInfoInSide = true;
|
|
248
|
+
// this.addInfoOutSide = false;
|
|
249
|
+
// createAddInfoButtonsInSide();
|
|
250
|
+
// }
|
|
246
251
|
}
|
|
247
252
|
|
|
248
253
|
protected setDimensions(containerWidth: number, containerHeight: number, defaultData: defaultType) {
|
|
@@ -3,6 +3,7 @@ import template from '../views/template.handlebars';
|
|
|
3
3
|
import controlsTemplate from '../views/controls.handlebars';
|
|
4
4
|
import posterTemplate from '../views/poster.handlebars';
|
|
5
5
|
import settingsTemplate from '../views/settings.handlebars';
|
|
6
|
+
import settingsMobileTemplate from '../views/settings.mobile.handlebars';
|
|
6
7
|
import additionalInfo from '../views/additionalInfo.handlebars';
|
|
7
8
|
import share from '../views/share.handlebars';
|
|
8
9
|
import background from '../views/background.handlebars';
|
|
@@ -43,6 +44,10 @@ export class TemplateService {
|
|
|
43
44
|
return Mustache.render(settingsTemplate, data);
|
|
44
45
|
}
|
|
45
46
|
|
|
47
|
+
getMobileSettings(data: Object) {
|
|
48
|
+
return Mustache.render(settingsMobileTemplate, data);
|
|
49
|
+
}
|
|
50
|
+
|
|
46
51
|
getAdditionalInfo(data : Object) {
|
|
47
52
|
return Mustache.render(additionalInfo, data);
|
|
48
53
|
}
|
|
@@ -109,6 +114,8 @@ export class TemplateService {
|
|
|
109
114
|
break
|
|
110
115
|
}
|
|
111
116
|
|
|
117
|
+
Object.assign(configData, {chaptersEnabled: (!!configData['chapters']) })
|
|
118
|
+
|
|
112
119
|
let render = Mustache.render(controlsTemplate,configData);
|
|
113
120
|
|
|
114
121
|
delete configData.mobile;
|
|
@@ -19,22 +19,22 @@
|
|
|
19
19
|
</div>
|
|
20
20
|
<div class="player-lt__mobile__modal-content">
|
|
21
21
|
{{#abstract}}
|
|
22
|
-
<h2>{{abstract.title}}</h2>
|
|
23
|
-
<p>{{abstract.description}}</p>
|
|
24
|
-
<p>{{abstract.videoDOI}}</p>
|
|
25
|
-
<p>{{abstract.videoCitation}}</p>
|
|
22
|
+
<h2>{{{abstract.title}}}</h2>
|
|
23
|
+
<p>{{{abstract.description}}}</p>
|
|
24
|
+
<p>{{{abstract.videoDOI}}}</p>
|
|
25
|
+
<p>{{{abstract.videoCitation}}}</p>
|
|
26
26
|
{{/abstract}}
|
|
27
27
|
|
|
28
28
|
{{#institution}}
|
|
29
|
-
<h2>{{institution.title}}</h2>
|
|
29
|
+
<h2>{{{institution.title}}}</h2>
|
|
30
30
|
<img src="{{institution.image}}" alt="image">
|
|
31
|
-
<p>{{institution.institutionName}}</p>
|
|
32
|
-
<p>{{institution.description}}</p>
|
|
31
|
+
<p>{{{institution.institutionName}}}</p>
|
|
32
|
+
<p>{{{institution.description}}}</p>
|
|
33
33
|
{{/institution}}
|
|
34
34
|
|
|
35
35
|
{{#bio}}
|
|
36
|
-
<h2>{{bio.title}}</h2>
|
|
37
|
-
<p>{{bio.description}}</p>
|
|
36
|
+
<h2>{{{bio.title}}}</h2>
|
|
37
|
+
<p>{{{bio.description}}}</p>
|
|
38
38
|
{{/bio}}
|
|
39
39
|
</div>
|
|
40
40
|
</div>
|
|
@@ -47,28 +47,28 @@
|
|
|
47
47
|
<span class="player-lt__close-button">×</span>
|
|
48
48
|
<div class="player-lt__modal-body">
|
|
49
49
|
{{#abstract}}
|
|
50
|
-
<h2>{{abstract.title}}</h2>
|
|
51
|
-
<p>{{abstract.description}}</p>
|
|
50
|
+
<h2>{{{abstract.title}}}</h2>
|
|
51
|
+
<p>{{{abstract.description}}}</p>
|
|
52
52
|
<hr>
|
|
53
53
|
<h3>Video DOI</h3>
|
|
54
|
-
<p>{{abstract.videoDOI}}</p>
|
|
54
|
+
<p>{{{abstract.videoDOI}}}</p>
|
|
55
55
|
<h3>Video Citation</h3>
|
|
56
|
-
<p>{{abstract.videoCitation}}</p>
|
|
56
|
+
<p>{{{abstract.videoCitation}}}</p>
|
|
57
57
|
{{/abstract}}
|
|
58
58
|
|
|
59
59
|
{{#institution}}
|
|
60
|
-
<h2>{{institution.title}}</h2>
|
|
60
|
+
<h2>{{{institution.title}}}</h2>
|
|
61
61
|
<div class="modal-flex">
|
|
62
62
|
<img src="{{institution.image}}" alt="image">
|
|
63
|
-
<h3>{{institution.institutionName}}</h3>
|
|
63
|
+
<h3>{{{institution.institutionName}}}</h3>
|
|
64
64
|
</div>
|
|
65
65
|
<hr>
|
|
66
|
-
<p>{{institution.description}}</p>
|
|
66
|
+
<p>{{{institution.description}}}</p>
|
|
67
67
|
{{/institution}}
|
|
68
68
|
|
|
69
69
|
{{#bio}}
|
|
70
|
-
<h2>{{bio.title}}</h2>
|
|
71
|
-
<p>{{bio.description}}</p>
|
|
70
|
+
<h2>{{{bio.title}}}</h2>
|
|
71
|
+
<p>{{{bio.description}}}</p>
|
|
72
72
|
{{/bio}}
|
|
73
73
|
</div>
|
|
74
74
|
</div>
|