@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
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import {LTPlayerController} from "../../global/controllers/LTPlayerController";
|
|
2
|
+
|
|
3
|
+
export class LTPlayerCaptionsManager {
|
|
4
|
+
player: LTPlayerController
|
|
5
|
+
|
|
6
|
+
constructor(player: LTPlayerController) {
|
|
7
|
+
this.player = player;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
enableSubtitlesCheckbox() {
|
|
11
|
+
const playerContainer = this.player.playerConfig.getPlayerElementContainer()
|
|
12
|
+
const subtitleCheckboxInput = playerContainer.querySelector('.subtitles-body__input-switch')
|
|
13
|
+
subtitleCheckboxInput.removeAttribute('disabled')
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
disableSubtitlesCheckbox() {
|
|
17
|
+
const playerContainer = this.player.playerConfig.getPlayerElementContainer()
|
|
18
|
+
const subtitleCheckboxInput = playerContainer.querySelector('.subtitles-body__input-switch')
|
|
19
|
+
subtitleCheckboxInput.setAttribute('disabled', '')
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
setCaptions(src: string|null): void {
|
|
23
|
+
const playerContainer = this.player.playerConfig.getPlayerElementContainer()
|
|
24
|
+
const videoElement = playerContainer.querySelector("video")
|
|
25
|
+
const trackElement = videoElement.querySelector("track")
|
|
26
|
+
|
|
27
|
+
this.player.plyr.currentTrack = -1;
|
|
28
|
+
this.clearSubtitles()
|
|
29
|
+
|
|
30
|
+
if (trackElement) {
|
|
31
|
+
trackElement.remove()
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (src) {
|
|
35
|
+
const newTrack = document.createElement('track');
|
|
36
|
+
Object.assign(newTrack, {
|
|
37
|
+
kind: 'captions',
|
|
38
|
+
label: 'English captions',
|
|
39
|
+
srclang: 'en',
|
|
40
|
+
default: 'default',
|
|
41
|
+
src: src
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
newTrack.addEventListener(`load`, evt => {
|
|
45
|
+
this.player.plyr.currentTrack = 0;
|
|
46
|
+
});
|
|
47
|
+
this.enableSubtitlesCheckbox()
|
|
48
|
+
this.player.plyr.toggleCaptions(true);
|
|
49
|
+
videoElement.appendChild(newTrack);
|
|
50
|
+
} else {
|
|
51
|
+
this.disableSubtitlesCheckbox()
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
enableCaptions() {
|
|
56
|
+
this.player.playerConfig.setCaptionsEnabled(true)
|
|
57
|
+
this.player.plyr.currentTrack = 0;
|
|
58
|
+
this.player.plyr.toggleCaptions(true)
|
|
59
|
+
this.player.statusFeedbackService.setCaptionsEnabled()
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
disableCaptions() {
|
|
63
|
+
this.player.playerConfig.setCaptionsEnabled(false)
|
|
64
|
+
this.player.plyr.currentTrack = -1;
|
|
65
|
+
this.player.plyr.toggleCaptions(false)
|
|
66
|
+
this.clearSubtitles()
|
|
67
|
+
this.player.statusFeedbackService.clearCaptionsEnabled()
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
clearSubtitles(): void {
|
|
71
|
+
const controls = this.player.plyr.elements.controls
|
|
72
|
+
const customSubtitlesElement = controls.querySelector('.lt-player-custom-captions');
|
|
73
|
+
const spanElement = customSubtitlesElement.querySelector('span');
|
|
74
|
+
|
|
75
|
+
if (!spanElement) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
spanElement.innerHTML = ''; // Clear previous captions
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -6,13 +6,19 @@ export class LTPlayerConfig {
|
|
|
6
6
|
|
|
7
7
|
private configData: playerConfigType = {
|
|
8
8
|
version : null,
|
|
9
|
+
pinText: false,
|
|
10
|
+
pinSeekBar: false,
|
|
11
|
+
pinControls: false,
|
|
12
|
+
embed: false,
|
|
9
13
|
preload: false,
|
|
10
14
|
autoPlay : false,
|
|
15
|
+
fullscreenDisabled: false,
|
|
11
16
|
videoTitle: '',
|
|
12
17
|
posterImage: '',
|
|
13
18
|
videoParagraph: '',
|
|
14
19
|
videoUrl : false,
|
|
15
20
|
playerId: '',
|
|
21
|
+
externalId: '',
|
|
16
22
|
playerContainer: '',
|
|
17
23
|
vimeo: false,
|
|
18
24
|
youtube: {
|
|
@@ -25,6 +31,7 @@ export class LTPlayerConfig {
|
|
|
25
31
|
'playsinline': true,
|
|
26
32
|
},
|
|
27
33
|
defaultConfig : false,
|
|
34
|
+
captionsEnabled: false,
|
|
28
35
|
share: null,
|
|
29
36
|
chapters : null,
|
|
30
37
|
playerType: null,
|
|
@@ -92,6 +99,18 @@ export class LTPlayerConfig {
|
|
|
92
99
|
|
|
93
100
|
}
|
|
94
101
|
|
|
102
|
+
isPinTextControls() {
|
|
103
|
+
return this.configData.pinText
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
isPinSeekBarControls() {
|
|
107
|
+
return this.configData.pinSeekBar
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
isPinBottomControls() {
|
|
111
|
+
return this.configData.pinControls
|
|
112
|
+
}
|
|
113
|
+
|
|
95
114
|
getObjectFit() {
|
|
96
115
|
return this.configData.videoObjectFit
|
|
97
116
|
}
|
|
@@ -137,6 +156,10 @@ export class LTPlayerConfig {
|
|
|
137
156
|
return this.configData.posterImage;
|
|
138
157
|
}
|
|
139
158
|
|
|
159
|
+
setPosterImage(image: string) {
|
|
160
|
+
this.configData.posterImage = image;
|
|
161
|
+
}
|
|
162
|
+
|
|
140
163
|
getParagraph() {
|
|
141
164
|
return this.configData.videoParagraph;
|
|
142
165
|
}
|
|
@@ -225,6 +248,9 @@ export class LTPlayerConfig {
|
|
|
225
248
|
}
|
|
226
249
|
|
|
227
250
|
getFullscreenMode() {
|
|
251
|
+
if (this.configData.fullscreenDisabled) {
|
|
252
|
+
return {fullscreen: {enabled: false}};
|
|
253
|
+
}
|
|
228
254
|
return {fullscreen: {enabled: true}};
|
|
229
255
|
|
|
230
256
|
if (this.getDevice() === 'mobile') {
|
|
@@ -233,5 +259,22 @@ export class LTPlayerConfig {
|
|
|
233
259
|
return false
|
|
234
260
|
}
|
|
235
261
|
}
|
|
262
|
+
|
|
263
|
+
getEmbed() {
|
|
264
|
+
return this.configData.embed;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
getCaptionsEnabled(): boolean {
|
|
268
|
+
return this.configData.captionsEnabled
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
setCaptionsEnabled(status: boolean) {
|
|
272
|
+
this.configData.captionsEnabled = status
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
hasCaptionsUrl(): boolean {
|
|
276
|
+
const defaultConfig = this.getDefaultConfigItems();
|
|
277
|
+
return !!(defaultConfig.captions.url)
|
|
278
|
+
}
|
|
236
279
|
}
|
|
237
280
|
|
|
@@ -15,6 +15,8 @@ export namespace LTPlayerConfigProcessor {
|
|
|
15
15
|
|
|
16
16
|
mapByVersion(name: string, value : any) {
|
|
17
17
|
switch (name) {
|
|
18
|
+
case 'embed':
|
|
19
|
+
return Processor.processEmbed(value, this.version);
|
|
18
20
|
case 'preload':
|
|
19
21
|
return Processor.processPreload(value, this.version);
|
|
20
22
|
case 'autoPlay' :
|
|
@@ -23,6 +25,8 @@ export namespace LTPlayerConfigProcessor {
|
|
|
23
25
|
return Processor.processVideoTitle(value, this.version);
|
|
24
26
|
case 'posterImage' :
|
|
25
27
|
return Processor.processPosterImage(value, this.version);
|
|
28
|
+
case 'fullscreenDisabled' :
|
|
29
|
+
return Processor.processFullscreenDisabled(value, this.version);
|
|
26
30
|
case 'videoParagraph':
|
|
27
31
|
return Processor.processVideoParagraph(value, this.version);
|
|
28
32
|
case 'videoUrl' :
|
|
@@ -51,20 +55,21 @@ export namespace LTPlayerConfigProcessor {
|
|
|
51
55
|
}
|
|
52
56
|
case 'observe':
|
|
53
57
|
return Processor.processObserve(value, this.version);
|
|
58
|
+
default: return value;
|
|
54
59
|
}
|
|
55
60
|
}
|
|
56
61
|
}
|
|
57
62
|
|
|
58
63
|
export class Processor {
|
|
59
64
|
|
|
60
|
-
static processObserve(data
|
|
65
|
+
static processObserve(data: defaultType, version: number) {
|
|
61
66
|
|
|
62
|
-
let output
|
|
63
|
-
width
|
|
64
|
-
height
|
|
67
|
+
let output: defaultType = {
|
|
68
|
+
width: false,
|
|
69
|
+
height: false
|
|
65
70
|
}
|
|
66
71
|
|
|
67
|
-
if(!data) {
|
|
72
|
+
if (!data) {
|
|
68
73
|
return;
|
|
69
74
|
}
|
|
70
75
|
if (version === 1) {
|
|
@@ -75,7 +80,7 @@ export namespace LTPlayerConfigProcessor {
|
|
|
75
80
|
return;
|
|
76
81
|
}
|
|
77
82
|
|
|
78
|
-
const setPropriety = (value
|
|
83
|
+
const setPropriety = (value: boolean | string | number): boolean => {
|
|
79
84
|
if (!value) {
|
|
80
85
|
return false;
|
|
81
86
|
}
|
|
@@ -105,9 +110,9 @@ export namespace LTPlayerConfigProcessor {
|
|
|
105
110
|
return output
|
|
106
111
|
}
|
|
107
112
|
|
|
108
|
-
static processChapters(data
|
|
113
|
+
static processChapters(data: defaultType, version: number) {
|
|
109
114
|
|
|
110
|
-
if(!data) {
|
|
115
|
+
if (!data) {
|
|
111
116
|
return;
|
|
112
117
|
}
|
|
113
118
|
|
|
@@ -124,19 +129,20 @@ export namespace LTPlayerConfigProcessor {
|
|
|
124
129
|
}
|
|
125
130
|
|
|
126
131
|
|
|
127
|
-
static processDefaultConfig(data
|
|
128
|
-
let outputData
|
|
129
|
-
speed
|
|
130
|
-
selected
|
|
131
|
-
captions
|
|
132
|
+
static processDefaultConfig(data: defaultType, version: number) {
|
|
133
|
+
let outputData: defaultType = {
|
|
134
|
+
speed: {
|
|
135
|
+
selected: 1,
|
|
136
|
+
captions: false,
|
|
132
137
|
update: true
|
|
133
138
|
},
|
|
134
|
-
captions
|
|
135
|
-
active
|
|
139
|
+
captions: {
|
|
140
|
+
active: false,
|
|
141
|
+
update: true,
|
|
136
142
|
},
|
|
137
|
-
clickToPlay
|
|
138
|
-
playsinline
|
|
139
|
-
pip
|
|
143
|
+
clickToPlay: false,
|
|
144
|
+
playsinline: true,
|
|
145
|
+
pip: false
|
|
140
146
|
}
|
|
141
147
|
|
|
142
148
|
if (!data) {
|
|
@@ -163,9 +169,9 @@ export namespace LTPlayerConfigProcessor {
|
|
|
163
169
|
|
|
164
170
|
}
|
|
165
171
|
|
|
166
|
-
static processVimeoConfig(data
|
|
172
|
+
static processVimeoConfig(data: defaultType, version: number) {
|
|
167
173
|
|
|
168
|
-
let outputData
|
|
174
|
+
let outputData: defaultType = {
|
|
169
175
|
controls: false,
|
|
170
176
|
active: false,
|
|
171
177
|
gesture: 'media',
|
|
@@ -187,7 +193,7 @@ export namespace LTPlayerConfigProcessor {
|
|
|
187
193
|
return outputData;
|
|
188
194
|
}
|
|
189
195
|
|
|
190
|
-
if (Object.keys(data).length === 0){
|
|
196
|
+
if (Object.keys(data).length === 0) {
|
|
191
197
|
return outputData;
|
|
192
198
|
}
|
|
193
199
|
|
|
@@ -202,21 +208,21 @@ export namespace LTPlayerConfigProcessor {
|
|
|
202
208
|
return outputData;
|
|
203
209
|
}
|
|
204
210
|
|
|
205
|
-
static processShareData(data
|
|
211
|
+
static processShareData(data: defaultType, version: number) {
|
|
206
212
|
if (!data) {
|
|
207
213
|
return null
|
|
208
214
|
}
|
|
209
215
|
|
|
210
216
|
type shareDataConfig = {
|
|
211
|
-
canonicalUrl
|
|
212
|
-
embedUrl
|
|
213
|
-
title
|
|
217
|
+
canonicalUrl: string,
|
|
218
|
+
embedUrl: string,
|
|
219
|
+
title: string
|
|
214
220
|
} | null
|
|
215
221
|
|
|
216
|
-
let outputData
|
|
217
|
-
canonicalUrl
|
|
218
|
-
embedUrl
|
|
219
|
-
title
|
|
222
|
+
let outputData: shareDataConfig = {
|
|
223
|
+
canonicalUrl: undefined,
|
|
224
|
+
embedUrl: undefined,
|
|
225
|
+
title: undefined
|
|
220
226
|
}
|
|
221
227
|
|
|
222
228
|
if (version === 1) {
|
|
@@ -247,7 +253,7 @@ export namespace LTPlayerConfigProcessor {
|
|
|
247
253
|
return outputData;
|
|
248
254
|
}
|
|
249
255
|
|
|
250
|
-
static processPlayerContainer(data
|
|
256
|
+
static processPlayerContainer(data: Element | defaultType, version: number) {
|
|
251
257
|
if (!data) {
|
|
252
258
|
return null
|
|
253
259
|
}
|
|
@@ -259,7 +265,7 @@ export namespace LTPlayerConfigProcessor {
|
|
|
259
265
|
return data;
|
|
260
266
|
}
|
|
261
267
|
|
|
262
|
-
static processVideoUrl(data
|
|
268
|
+
static processVideoUrl(data: string | defaultType, version: number) {
|
|
263
269
|
|
|
264
270
|
if (!data) {
|
|
265
271
|
return null
|
|
@@ -272,14 +278,14 @@ export namespace LTPlayerConfigProcessor {
|
|
|
272
278
|
}
|
|
273
279
|
}
|
|
274
280
|
|
|
275
|
-
type configData = {videoUrl
|
|
281
|
+
type configData = { videoUrl: string, videoType: string, embedId: string, embedHash: string, origin: string };
|
|
276
282
|
|
|
277
|
-
let outputData
|
|
278
|
-
videoUrl
|
|
279
|
-
videoType
|
|
280
|
-
embedHash
|
|
281
|
-
embedId
|
|
282
|
-
origin
|
|
283
|
+
let outputData: configData = {
|
|
284
|
+
videoUrl: undefined,
|
|
285
|
+
videoType: undefined,
|
|
286
|
+
embedHash: undefined,
|
|
287
|
+
embedId: undefined,
|
|
288
|
+
origin: undefined
|
|
283
289
|
}
|
|
284
290
|
|
|
285
291
|
if (!Helper.isValidHttpUrl(data)) {
|
|
@@ -328,7 +334,7 @@ export namespace LTPlayerConfigProcessor {
|
|
|
328
334
|
return outputData;
|
|
329
335
|
}
|
|
330
336
|
|
|
331
|
-
static processVideoParagraph(data
|
|
337
|
+
static processVideoParagraph(data: string | defaultType, version: number) {
|
|
332
338
|
|
|
333
339
|
if (!data) {
|
|
334
340
|
return null
|
|
@@ -342,14 +348,14 @@ export namespace LTPlayerConfigProcessor {
|
|
|
342
348
|
}
|
|
343
349
|
}
|
|
344
350
|
|
|
345
|
-
if (typeof data === 'string' && /[a-zA-Z]/.test(data)){
|
|
351
|
+
if (typeof data === 'string' && /[a-zA-Z]/.test(data)) {
|
|
346
352
|
outputData = data;
|
|
347
353
|
}
|
|
348
354
|
|
|
349
355
|
return outputData;
|
|
350
356
|
}
|
|
351
357
|
|
|
352
|
-
static processPosterImage(data: string | defaultType, version
|
|
358
|
+
static processPosterImage(data: string | defaultType, version: number) {
|
|
353
359
|
|
|
354
360
|
if (!data) {
|
|
355
361
|
return null
|
|
@@ -370,7 +376,8 @@ export namespace LTPlayerConfigProcessor {
|
|
|
370
376
|
console.error(`Set valid url for poster image config item => posterImage : ${data} `);
|
|
371
377
|
return undefined;
|
|
372
378
|
}
|
|
373
|
-
|
|
379
|
+
|
|
380
|
+
static processVideoTitle(data: string | defaultType, version: number) {
|
|
374
381
|
|
|
375
382
|
if (!data) {
|
|
376
383
|
return null
|
|
@@ -385,20 +392,21 @@ export namespace LTPlayerConfigProcessor {
|
|
|
385
392
|
}
|
|
386
393
|
|
|
387
394
|
if (data) {
|
|
388
|
-
if (typeof data === 'string' && /[a-zA-Z]/.test(data)){
|
|
395
|
+
if (typeof data === 'string' && /[a-zA-Z]/.test(data)) {
|
|
389
396
|
outputData = data;
|
|
390
397
|
}
|
|
391
398
|
}
|
|
392
399
|
|
|
393
400
|
return outputData;
|
|
394
401
|
}
|
|
395
|
-
|
|
402
|
+
|
|
403
|
+
static processAutoPlay(data: boolean | string | object, version: number) {
|
|
396
404
|
|
|
397
405
|
if (!data) {
|
|
398
406
|
return null
|
|
399
407
|
}
|
|
400
408
|
|
|
401
|
-
let outputData
|
|
409
|
+
let outputData: boolean = false;
|
|
402
410
|
|
|
403
411
|
if (version === 1) {
|
|
404
412
|
return outputData;
|
|
@@ -419,7 +427,8 @@ export namespace LTPlayerConfigProcessor {
|
|
|
419
427
|
|
|
420
428
|
return outputData;
|
|
421
429
|
}
|
|
422
|
-
|
|
430
|
+
|
|
431
|
+
static processPreload(data: object | null, version: number) {
|
|
423
432
|
|
|
424
433
|
if (!data) {
|
|
425
434
|
return null
|
|
@@ -429,8 +438,8 @@ export namespace LTPlayerConfigProcessor {
|
|
|
429
438
|
return
|
|
430
439
|
}
|
|
431
440
|
|
|
432
|
-
type outputType = {start
|
|
433
|
-
const setTimeRange = (config: defaultType, itemOutput
|
|
441
|
+
type outputType = { start: number, stop: number, autoType: boolean, isActive: boolean };
|
|
442
|
+
const setTimeRange = (config: defaultType, itemOutput: outputType) => {
|
|
434
443
|
|
|
435
444
|
if (config.start) {
|
|
436
445
|
|
|
@@ -467,7 +476,7 @@ export namespace LTPlayerConfigProcessor {
|
|
|
467
476
|
return itemOutput;
|
|
468
477
|
}
|
|
469
478
|
|
|
470
|
-
const setPreloadType = (type: defaultType, itemOutput
|
|
479
|
+
const setPreloadType = (type: defaultType, itemOutput: outputType) => {
|
|
471
480
|
|
|
472
481
|
itemOutput.autoType = true;
|
|
473
482
|
|
|
@@ -487,18 +496,17 @@ export namespace LTPlayerConfigProcessor {
|
|
|
487
496
|
|
|
488
497
|
}
|
|
489
498
|
|
|
490
|
-
const setActive = (itemOutput
|
|
499
|
+
const setActive = (itemOutput: outputType) => {
|
|
491
500
|
itemOutput.isActive = true;
|
|
492
501
|
return itemOutput
|
|
493
502
|
}
|
|
494
503
|
|
|
495
504
|
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
autoType : false,
|
|
505
|
+
let itemOutput: outputType = {
|
|
506
|
+
start: 0,
|
|
507
|
+
stop: 10,
|
|
508
|
+
isActive: false,
|
|
509
|
+
autoType: false,
|
|
502
510
|
|
|
503
511
|
};
|
|
504
512
|
|
|
@@ -544,6 +552,52 @@ export namespace LTPlayerConfigProcessor {
|
|
|
544
552
|
|
|
545
553
|
return false;
|
|
546
554
|
}
|
|
555
|
+
|
|
556
|
+
static processEmbed(data : boolean | string | object, version : number) {
|
|
557
|
+
|
|
558
|
+
if (!data) {
|
|
559
|
+
return null;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
let outputData : boolean = false;
|
|
563
|
+
|
|
564
|
+
if (version === 1) {
|
|
565
|
+
return outputData;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
|
|
569
|
+
if (typeof data === 'string') {
|
|
570
|
+
if (data === 'true') {
|
|
571
|
+
outputData = true;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
if (typeof data === 'boolean') {
|
|
576
|
+
if (data) {
|
|
577
|
+
outputData = true;
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
return outputData;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
static processFullscreenDisabled(data : boolean | string | object, version : number) {
|
|
585
|
+
let outputData = false;
|
|
586
|
+
|
|
587
|
+
if (typeof data === 'string') {
|
|
588
|
+
if (data === 'true') {
|
|
589
|
+
outputData = true;
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
if (typeof data === 'boolean') {
|
|
594
|
+
if (data) {
|
|
595
|
+
outputData = true;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
return outputData;
|
|
600
|
+
}
|
|
547
601
|
}
|
|
548
602
|
}
|
|
549
603
|
|
|
@@ -70,7 +70,7 @@ export class LTPlayerChapters {
|
|
|
70
70
|
|
|
71
71
|
if (chapters !== undefined) {
|
|
72
72
|
instance.playerControl.chaptersService.setChapterPreviousNext(chapters[2], chapters[0]);
|
|
73
|
-
instance.playerControl.chaptersService.setTitleChapterName(chapters[1]);
|
|
73
|
+
// instance.playerControl.chaptersService.setTitleChapterName(chapters[1]);
|
|
74
74
|
instance.playerControl.chaptersService.setButtonsChapterTime(chapters[0], chapters[2])
|
|
75
75
|
}
|
|
76
76
|
}
|
|
@@ -191,13 +191,13 @@ export class LTPlayerChapters {
|
|
|
191
191
|
|
|
192
192
|
leftButton.dataset.ltPlayerChaptertimestamp = String(false);
|
|
193
193
|
|
|
194
|
-
if (left !== null) {
|
|
194
|
+
if (left !== null && left != undefined) {
|
|
195
195
|
leftButton.dataset.ltPlayerChaptertimestamp = left.timestamp;
|
|
196
196
|
}
|
|
197
197
|
|
|
198
198
|
const rightButton: HTMLElement = playerControlsContainer.querySelector('.skip-forward');
|
|
199
199
|
|
|
200
|
-
if (right !== null) {
|
|
200
|
+
if (right !== null && right != undefined) {
|
|
201
201
|
rightButton.dataset.ltPlayerChaptertimestamp = right.timestamp;
|
|
202
202
|
}
|
|
203
203
|
|
|
@@ -244,6 +244,10 @@ export class LTPlayerChapters {
|
|
|
244
244
|
*/
|
|
245
245
|
findChapter(time: number, state: Array<any>) {
|
|
246
246
|
|
|
247
|
+
if (time == null || state.length == 0) {
|
|
248
|
+
return undefined;
|
|
249
|
+
}
|
|
250
|
+
|
|
247
251
|
let current: null;
|
|
248
252
|
let left: null;
|
|
249
253
|
let right = null;
|
|
@@ -264,7 +268,7 @@ export class LTPlayerChapters {
|
|
|
264
268
|
}
|
|
265
269
|
|
|
266
270
|
for (let index = 0; index < state.length; index += 1) {
|
|
267
|
-
|
|
271
|
+
const element = state[index];
|
|
268
272
|
if (element.timestamp >= time) {
|
|
269
273
|
right = element;
|
|
270
274
|
current = findCurrent(state, index);
|
|
@@ -14,6 +14,7 @@ export class LTPlayerControls {
|
|
|
14
14
|
chaptersService : LTPlayerChapters
|
|
15
15
|
desktopEvents: LTPlayerControlsEvents.Desktop;
|
|
16
16
|
mobileEvents: LTPlayerControlsEvents.Mobile;
|
|
17
|
+
commonEvents: LTPlayerControlsEvents.Common;
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* Generate Player LTPlayerControls to pass in Plyr
|
|
@@ -22,6 +23,7 @@ export class LTPlayerControls {
|
|
|
22
23
|
constructor(templateService: TemplateService) {
|
|
23
24
|
this.settingsControlsManager = new LTPlayerSettingsControlsManager();
|
|
24
25
|
this.templateService = templateService;
|
|
26
|
+
this.commonEvents = new LTPlayerControlsEvents.Common();
|
|
25
27
|
this.setDesktopEvents();
|
|
26
28
|
this.setMobileEvents();
|
|
27
29
|
|