@latest-thinking/lt-player 1.2.0-d → 2.0.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/.editorconfig +1 -1
- package/.node-version +1 -0
- package/.nvmrc +1 -0
- package/README.md +162 -0
- package/dist/main.js +24375 -0
- package/package.json +31 -67
- package/tsconfig.json +2 -1
- package/vite-dev.config.mts +35 -0
- package/vite.config.mts +40 -0
- package/ README.md +0 -270
- package/.babelrc +0 -11
- package/.eslintrc.js +0 -6
- package/dist/css/lt-player-main.css +0 -3
- package/dist/css/lt-player-main.css.map +0 -1
- package/dist/fonts/0574e80a2483be7b033e.otf +0 -0
- package/dist/fonts/34274fbfb2f270b8d53b.otf +0 -0
- package/dist/fonts/80acced0ba3630ee652b.otf +0 -0
- package/dist/fonts/8ccea4947561e7008d19.otf +0 -0
- package/dist/fonts/d355445ed7d61b887e58.otf +0 -0
- package/dist/js/lt-player-main.js +0 -3
- package/dist/js/lt-player-main.js.LICENSE.txt +0 -9
- package/dist/js/lt-player-main.js.map +0 -1
- package/examples/basic.html +0 -35
- package/examples/lt-page-with-player.html +0 -3529
- package/examples/lt-page-with-player_files/Weiskopf_Coverphoto.jpg +0 -0
- package/examples/lt-page-with-player_files/ajax-progress.module.css +0 -49
- package/examples/lt-page-with-player_files/align.module.css +0 -32
- package/examples/lt-page-with-player_files/announce.js +0 -49
- package/examples/lt-page-with-player_files/autocomplete-loading.module.css +0 -22
- package/examples/lt-page-with-player_files/autocomplete.css +0 -16
- package/examples/lt-page-with-player_files/bootstrap.css +0 -22691
- package/examples/lt-page-with-player_files/clearfix.module.css +0 -15
- package/examples/lt-page-with-player_files/container-inline.module.css +0 -16
- package/examples/lt-page-with-player_files/cookiesjsr.min.css +0 -10
- package/examples/lt-page-with-player_files/core.css +0 -97
- package/examples/lt-page-with-player_files/details.module.css +0 -10
- package/examples/lt-page-with-player_files/fieldgroup.module.css +0 -9
- package/examples/lt-page-with-player_files/hidden.module.css +0 -53
- 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 +0 -19
- package/examples/lt-page-with-player_files/js.module.css +0 -22
- package/examples/lt-page-with-player_files/latest_thinking.style.css +0 -6496
- package/examples/lt-page-with-player_files/logo-small.png +0 -0
- package/examples/lt-page-with-player_files/menu.css +0 -64
- package/examples/lt-page-with-player_files/nowrap.module.css +0 -8
- package/examples/lt-page-with-player_files/paragraphs.unpublished.css +0 -3
- package/examples/lt-page-with-player_files/position-container.module.css +0 -8
- package/examples/lt-page-with-player_files/progress.module.css +0 -51
- package/examples/lt-page-with-player_files/radix.style.css +0 -1
- package/examples/lt-page-with-player_files/reset-appearance.module.css +0 -15
- package/examples/lt-page-with-player_files/resize.module.css +0 -21
- package/examples/lt-page-with-player_files/search_api_autocomplete.css +0 -41
- package/examples/lt-page-with-player_files/sticky-header.module.css +0 -13
- package/examples/lt-page-with-player_files/system-status-counter.css +0 -30
- package/examples/lt-page-with-player_files/system-status-report-counters.css +0 -27
- package/examples/lt-page-with-player_files/system-status-report-general-info.css +0 -14
- package/examples/lt-page-with-player_files/tabledrag.module.css +0 -98
- package/examples/lt-page-with-player_files/tablesort.module.css +0 -19
- package/examples/lt-page-with-player_files/theme.css +0 -446
- 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 +0 -18
- package/examples/lt-page-with-player_files/widget-min.js +0 -10
- package/examples/lt-website.html +0 -76
- package/examples/portrait-with-subtitles.html +0 -81
- package/examples/samples/vtt/Pahl-Kerstin-Maria-MAIN-20230320.vtt +0 -765
- package/examples/samples/vtt/Sobolev-Anton-Subtitles-20230518_0.vtt +0 -352
- package/examples/samples/vtt/demo.vtt +0 -7
- package/src/assets/css/sample.css +0 -12
- package/src/assets/fonts/museo/MuseoSans-100.otf +0 -0
- package/src/assets/fonts/museo/MuseoSans-300.otf +0 -0
- package/src/assets/fonts/museo/MuseoSans-500.otf +0 -0
- package/src/assets/fonts/museo/MuseoSans-700.otf +0 -0
- package/src/assets/fonts/museo/MuseoSans-900.otf +0 -0
- package/src/assets/icons/arrow-down.svg +0 -8
- package/src/assets/icons/arrow-left.svg +0 -8
- package/src/assets/icons/chevron-down-full.svg +0 -7
- package/src/assets/icons/chevron-down.svg +0 -7
- package/src/assets/icons/chevron-up-full.svg +0 -7
- package/src/assets/icons/chevron-up.svg +0 -7
- package/src/assets/icons/close.svg +0 -8
- package/src/assets/icons/compass.svg +0 -8
- package/src/assets/icons/external-link.svg +0 -9
- package/src/assets/icons/facebook.svg +0 -7
- package/src/assets/icons/fast-backward.svg +0 -8
- package/src/assets/icons/fast-forward.svg +0 -8
- package/src/assets/icons/file-text.svg +0 -11
- package/src/assets/icons/home.svg +0 -8
- package/src/assets/icons/logo-big.png +0 -0
- package/src/assets/icons/logo.png +0 -0
- package/src/assets/icons/maximize.svg +0 -7
- package/src/assets/icons/mini-player.svg +0 -8
- package/src/assets/icons/minimize.svg +0 -7
- package/src/assets/icons/more-vertical.svg +0 -9
- package/src/assets/icons/mute.svg +0 -9
- package/src/assets/icons/pause.svg +0 -8
- package/src/assets/icons/play.svg +0 -8
- package/src/assets/icons/search.svg +0 -8
- package/src/assets/icons/settings.svg +0 -8
- package/src/assets/icons/share.svg +0 -11
- package/src/assets/icons/skip-backward.svg +0 -8
- package/src/assets/icons/skip-forward.svg +0 -8
- package/src/assets/icons/speed-1-5.svg +0 -7
- package/src/assets/icons/speed-1.svg +0 -7
- package/src/assets/icons/speed-2.svg +0 -7
- package/src/assets/icons/subtitles.svg +0 -7
- package/src/assets/icons/twitter.svg +0 -7
- package/src/assets/icons/university.svg +0 -9
- package/src/assets/icons/user.svg +0 -8
- package/src/assets/icons/volume-1.svg +0 -15
- package/src/assets/icons/volume-2.svg +0 -15
- package/src/assets/icons/volume-3.svg +0 -15
- package/src/assets/sass/abstracts/_mixins.scss +0 -145
- package/src/assets/sass/abstracts/_placeholders.scss +0 -112
- package/src/assets/sass/abstracts/_variables.scss +0 -68
- package/src/assets/sass/abstracts/all.scss +0 -4
- package/src/assets/sass/app.scss +0 -100
- package/src/assets/sass/components/_all.scss +0 -6
- package/src/assets/sass/components/_buttons.scss +0 -1
- package/src/assets/sass/components/_images.scss +0 -4
- package/src/assets/sass/components/_loader.scss +0 -187
- package/src/assets/sass/components/_modal.scss +0 -365
- package/src/assets/sass/components/_range.scss +0 -33
- package/src/assets/sass/core/_all.scss +0 -13
- package/src/assets/sass/core/_fonts.scss +0 -55
- package/src/assets/sass/core/_player.scss +0 -70
- package/src/assets/sass/core/_typography.scss +0 -13
- package/src/assets/sass/layout/_all.scss +0 -3
- package/src/assets/sass/layout/_grid.scss +0 -0
- package/src/assets/sass/sections/_additional-info.scss +0 -90
- package/src/assets/sass/sections/_all.scss +0 -6
- package/src/assets/sass/sections/_control.scss +0 -122
- package/src/assets/sass/sections/_poster.scss +0 -319
- package/src/assets/sass/sections/_settings.scss +0 -512
- package/src/assets/sass/sections/_share.scss +0 -250
- package/src/assets/sass/sections/_subtitles.scss +0 -85
- package/src/assets/sass/sections/controllers/_all.scss +0 -4
- package/src/assets/sass/sections/controllers/_botom.scss +0 -522
- package/src/assets/sass/sections/controllers/_mini-player.scss +0 -169
- package/src/assets/sass/sections/controllers/_notification-rewind-forward.scss +0 -260
- package/src/assets/sass/sections/controllers/_top.scss +0 -169
- package/src/components/LTPlayerDevMethode.ts +0 -192
- package/src/components/LTPlayerEventsManager.ts +0 -31
- package/src/components/LTPlayerHls.ts +0 -38
- package/src/components/LTPlayerManager.ts +0 -266
- package/src/components/LTPlayerSettingsManager.ts +0 -117
- package/src/components/LTPlayerSetup.ts +0 -286
- package/src/components/LTPlayerStatusFeedback.ts +0 -76
- package/src/components/LTPlayerStorage.ts +0 -58
- package/src/components/LTPlayerType.ts +0 -371
- package/src/components/LTPlayerUpdate.ts +0 -61
- package/src/components/addInfo/LTPLayerAddInfoResizeManager.ts +0 -15
- package/src/components/addInfo/LTPlayerAddInfoDesktop.ts +0 -127
- package/src/components/addInfo/LTPlayerAddInfoManager.ts +0 -230
- package/src/components/addInfo/LTPlayerAddInfoMobile.ts +0 -113
- package/src/components/captions/LTPlayerCaptions.ts +0 -80
- package/src/components/config/LTPlayerConfig.ts +0 -280
- package/src/components/config/LTPlayerConfigProcessor.ts +0 -604
- package/src/components/controls/LTPlayerChapters.ts +0 -285
- package/src/components/controls/LTPlayerControls.ts +0 -57
- package/src/components/controls/LTPlayerControlsEvents.ts +0 -943
- package/src/components/controls/LTPlayerMini.ts +0 -285
- package/src/components/controls/LTPlayerSettingsControlsManager.ts +0 -60
- package/src/components/controls/settings/LTPlayerCommonSettingsControllers.ts +0 -71
- package/src/components/controls/settings/LTPlayerDesktopSettingsControllers.ts +0 -135
- package/src/components/controls/settings/LTPlayerMobileSettingsControllers.ts +0 -211
- package/src/components/events/LTPlayer.ts +0 -194
- package/src/components/events/LTPlayerCommon.ts +0 -252
- package/src/components/events/LTPlayerDesktop.ts +0 -222
- package/src/components/events/LTPlayerMobile.ts +0 -243
- package/src/components/poster/LTPlayerPoster.ts +0 -78
- package/src/components/poster/LTPlayerPosterEvents.ts +0 -172
- package/src/components/poster/LTPlayerPosterManager.ts +0 -46
- package/src/components/poster/LTPlayerPosterPreload.ts +0 -51
- package/src/components/poster/LTPlayerPosterPreloadEvents.ts +0 -152
- package/src/components/share/LTPlayerShareDesktop.ts +0 -131
- package/src/components/share/LTPlayerShareEvents.ts +0 -64
- package/src/components/share/LTPlayerShareManager.ts +0 -58
- package/src/components/share/LTPlayerShareMobile.ts +0 -154
- package/src/components/video/LTPlayerVideo.ts +0 -49
- package/src/global/controllers/LTPlayerController.ts +0 -58
- package/src/global/interfaces/EventsInterfaces.ts +0 -11
- package/src/global/interfaces/SettingsControlsInterfaces.ts +0 -3
- package/src/global/interfaces/TypeInterface.ts +0 -9
- package/src/global/types/ModuleTypes.d.ts +0 -35
- package/src/global/types/ModuleViews.d.ts +0 -13
- package/src/global/types/ModuleWindow.d.ts +0 -12
- package/src/global/types/Modules.d.ts +0 -44
- package/src/index.ts +0 -10
- package/src/json-schema/player-config.json +0 -16
- package/src/services/Helper.ts +0 -147
- package/src/services/IconsService.ts +0 -124
- package/src/services/LTPlayerRotateDeviceService.ts +0 -15
- package/src/services/LoaderService.ts +0 -21
- package/src/services/ResizeService.ts +0 -352
- package/src/services/TemplateService.ts +0 -136
- package/src/services/ValidatorService.ts +0 -31
- package/src/views/additionalInfo.handlebars +0 -103
- package/src/views/background.handlebars +0 -5
- package/src/views/controls.handlebars +0 -390
- package/src/views/onloadPoster.handlebars +0 -1
- package/src/views/poster.handlebars +0 -69
- package/src/views/settings.handlebars +0 -31
- package/src/views/settings.mobile.handlebars +0 -22
- package/src/views/share.handlebars +0 -101
- package/src/views/template.handlebars +0 -15
|
@@ -1,604 +0,0 @@
|
|
|
1
|
-
import {defaultType, urlDataType} from "../../global/types/ModuleTypes";
|
|
2
|
-
import {Helper} from "../../services/Helper";
|
|
3
|
-
|
|
4
|
-
export namespace LTPlayerConfigProcessor {
|
|
5
|
-
export class Map {
|
|
6
|
-
version : number
|
|
7
|
-
|
|
8
|
-
setVersion(version : number) {
|
|
9
|
-
this.version = version;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
processItem(name: string, value : any) {
|
|
13
|
-
return this.mapByVersion(name, value);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
mapByVersion(name: string, value : any) {
|
|
17
|
-
switch (name) {
|
|
18
|
-
case 'embed':
|
|
19
|
-
return Processor.processEmbed(value, this.version);
|
|
20
|
-
case 'preload':
|
|
21
|
-
return Processor.processPreload(value, this.version);
|
|
22
|
-
case 'autoPlay' :
|
|
23
|
-
return Processor.processAutoPlay(value, this.version);
|
|
24
|
-
case 'videoTitle' :
|
|
25
|
-
return Processor.processVideoTitle(value, this.version);
|
|
26
|
-
case 'posterImage' :
|
|
27
|
-
return Processor.processPosterImage(value, this.version);
|
|
28
|
-
case 'fullscreenDisabled' :
|
|
29
|
-
return Processor.processFullscreenDisabled(value, this.version);
|
|
30
|
-
case 'videoParagraph':
|
|
31
|
-
return Processor.processVideoParagraph(value, this.version);
|
|
32
|
-
case 'videoUrl' :
|
|
33
|
-
return Processor.processVideoUrl(value, this.version);
|
|
34
|
-
case 'playerContainer' :
|
|
35
|
-
return Processor.processPlayerContainer(value, this.version);
|
|
36
|
-
case 'share':
|
|
37
|
-
return Processor.processShareData(value, this.version);
|
|
38
|
-
case 'vimeo':
|
|
39
|
-
return Processor.processVimeoConfig(value, this.version);
|
|
40
|
-
case 'defaultConfig':
|
|
41
|
-
return Processor.processDefaultConfig(value, this.version);
|
|
42
|
-
case 'chapters':
|
|
43
|
-
return Processor.processChapters(value, this.version);
|
|
44
|
-
case 'device':
|
|
45
|
-
if (this.version === 1) {
|
|
46
|
-
return value.device;
|
|
47
|
-
} else {
|
|
48
|
-
return value;
|
|
49
|
-
}
|
|
50
|
-
case 'playerType':
|
|
51
|
-
if (this.version === 1) {
|
|
52
|
-
return value.playerType;
|
|
53
|
-
} else {
|
|
54
|
-
return value;
|
|
55
|
-
}
|
|
56
|
-
case 'observe':
|
|
57
|
-
return Processor.processObserve(value, this.version);
|
|
58
|
-
default: return value;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export class Processor {
|
|
64
|
-
|
|
65
|
-
static processObserve(data: defaultType, version: number) {
|
|
66
|
-
|
|
67
|
-
let output: defaultType = {
|
|
68
|
-
width: false,
|
|
69
|
-
height: false
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if (!data) {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
if (version === 1) {
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
if (Object.keys(data).length === 0) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
const setPropriety = (value: boolean | string | number): boolean => {
|
|
84
|
-
if (!value) {
|
|
85
|
-
return false;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (typeof value === 'boolean') {
|
|
89
|
-
return value;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
if (typeof value === 'string') {
|
|
93
|
-
return value === 'true' || value === 'TRUE' || value === '1';
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
if (typeof value === 'number') {
|
|
97
|
-
return value === 1;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
return false;
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
Object.keys(data).forEach(item => {
|
|
105
|
-
if (output.hasOwnProperty(item)) {
|
|
106
|
-
output[item] = setPropriety(data[item]);
|
|
107
|
-
}
|
|
108
|
-
})
|
|
109
|
-
|
|
110
|
-
return output
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
static processChapters(data: defaultType, version: number) {
|
|
114
|
-
|
|
115
|
-
if (!data) {
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
if (version === 1) {
|
|
120
|
-
data = data.chapters;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
if (Object.keys(data).length === 0) {
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
return data;
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
static processDefaultConfig(data: defaultType, version: number) {
|
|
133
|
-
let outputData: defaultType = {
|
|
134
|
-
speed: {
|
|
135
|
-
selected: 1,
|
|
136
|
-
captions: false,
|
|
137
|
-
update: true
|
|
138
|
-
},
|
|
139
|
-
captions: {
|
|
140
|
-
active: false,
|
|
141
|
-
update: true,
|
|
142
|
-
},
|
|
143
|
-
clickToPlay: false,
|
|
144
|
-
playsinline: true,
|
|
145
|
-
pip: false
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
if (!data) {
|
|
149
|
-
return outputData;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
if (version === 1) {
|
|
153
|
-
return outputData;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
if (Object.keys(data).length === 0) {
|
|
157
|
-
return outputData;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
Object.keys(data).forEach(item => {
|
|
161
|
-
if (outputData[item] !== undefined) {
|
|
162
|
-
outputData[item] = data[item];
|
|
163
|
-
} else {
|
|
164
|
-
outputData[item] = data[item];
|
|
165
|
-
}
|
|
166
|
-
})
|
|
167
|
-
|
|
168
|
-
return outputData;
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
static processVimeoConfig(data: defaultType, version: number) {
|
|
173
|
-
|
|
174
|
-
let outputData: defaultType = {
|
|
175
|
-
controls: false,
|
|
176
|
-
active: false,
|
|
177
|
-
gesture: 'media',
|
|
178
|
-
transparent: true,
|
|
179
|
-
speed: true,
|
|
180
|
-
portrait: true,
|
|
181
|
-
keyboard: false,
|
|
182
|
-
title: false,
|
|
183
|
-
byline: false,
|
|
184
|
-
playsinline: true,
|
|
185
|
-
background: true
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
if (version === 1) {
|
|
189
|
-
return outputData
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
if (!data) {
|
|
193
|
-
return outputData;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
if (Object.keys(data).length === 0) {
|
|
197
|
-
return outputData;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
Object.keys(data).forEach(item => {
|
|
201
|
-
if (outputData[item] !== undefined) {
|
|
202
|
-
outputData[item] = data[item];
|
|
203
|
-
} else {
|
|
204
|
-
outputData[item] = data[item];
|
|
205
|
-
}
|
|
206
|
-
})
|
|
207
|
-
|
|
208
|
-
return outputData;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
static processShareData(data: defaultType, version: number) {
|
|
212
|
-
if (!data) {
|
|
213
|
-
return null
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
type shareDataConfig = {
|
|
217
|
-
canonicalUrl: string,
|
|
218
|
-
embedUrl: string,
|
|
219
|
-
title: string
|
|
220
|
-
} | null
|
|
221
|
-
|
|
222
|
-
let outputData: shareDataConfig = {
|
|
223
|
-
canonicalUrl: undefined,
|
|
224
|
-
embedUrl: undefined,
|
|
225
|
-
title: undefined
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
if (version === 1) {
|
|
229
|
-
data = {
|
|
230
|
-
canonicalUrl: data.canonical_url ?? null,
|
|
231
|
-
embedUrl: `${window.location.origin}/embed/${data.id}`,
|
|
232
|
-
title: data.title ?? null,
|
|
233
|
-
};
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
if (Object.keys(data).length === 0) {
|
|
238
|
-
return;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
if (data.canonicalUrl !== undefined) {
|
|
242
|
-
outputData.canonicalUrl = data.canonicalUrl;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
if (data.embedUrl !== undefined) {
|
|
246
|
-
outputData.embedUrl = data.embedUrl;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
if (data.title !== undefined) {
|
|
250
|
-
outputData.title = data.title;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
return outputData;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
static processPlayerContainer(data: Element | defaultType, version: number) {
|
|
257
|
-
if (!data) {
|
|
258
|
-
return null
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
if (version === 1) {
|
|
262
|
-
return (data as defaultType).playerContainer;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
return data;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
static processVideoUrl(data: string | defaultType, version: number) {
|
|
269
|
-
|
|
270
|
-
if (!data) {
|
|
271
|
-
return null
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
if (version === 1) {
|
|
276
|
-
if (typeof data === 'object') {
|
|
277
|
-
data = data.sources.video_id;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
type configData = { videoUrl: string, videoType: string, embedId: string, embedHash: string, origin: string };
|
|
282
|
-
|
|
283
|
-
let outputData: configData = {
|
|
284
|
-
videoUrl: undefined,
|
|
285
|
-
videoType: undefined,
|
|
286
|
-
embedHash: undefined,
|
|
287
|
-
embedId: undefined,
|
|
288
|
-
origin: undefined
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
if (!Helper.isValidHttpUrl(data)) {
|
|
292
|
-
console.error(`Please insert valid url video url videoURL : ${data}`);
|
|
293
|
-
return outputData
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
const urlVideoData: urlDataType = Helper.processConfigData(data);
|
|
297
|
-
|
|
298
|
-
const mapVideoData = (data: string | defaultType, urlVideoData: urlDataType, outputData: configData) => {
|
|
299
|
-
|
|
300
|
-
if (typeof data === "string") {
|
|
301
|
-
outputData.videoUrl = data;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
if (urlVideoData.origin) {
|
|
305
|
-
outputData.origin = urlVideoData.origin;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
if (urlVideoData.type) {
|
|
309
|
-
outputData.videoType = urlVideoData.type.toLowerCase()
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
if (urlVideoData.type === 'embedded') {
|
|
313
|
-
const embedID = Helper.getEmbeddedID(data);
|
|
314
|
-
|
|
315
|
-
if (embedID) {
|
|
316
|
-
outputData.embedId = embedID;
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
const embedHash = Helper.getEmbeddedHash(data);
|
|
320
|
-
|
|
321
|
-
if (embedHash) {
|
|
322
|
-
outputData.embedHash = embedHash;
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
return outputData;
|
|
327
|
-
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
outputData = mapVideoData(data, urlVideoData, outputData);
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
return outputData;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
static processVideoParagraph(data: string | defaultType, version: number) {
|
|
338
|
-
|
|
339
|
-
if (!data) {
|
|
340
|
-
return null
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
let outputData = undefined;
|
|
344
|
-
|
|
345
|
-
if (version === 1) {
|
|
346
|
-
if (typeof data === 'object') {
|
|
347
|
-
data = data.author;
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
if (typeof data === 'string' && /[a-zA-Z]/.test(data)) {
|
|
352
|
-
outputData = data;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
return outputData;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
static processPosterImage(data: string | defaultType, version: number) {
|
|
359
|
-
|
|
360
|
-
if (!data) {
|
|
361
|
-
return null
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
if (version === 1) {
|
|
365
|
-
if (typeof data === 'object') {
|
|
366
|
-
return data.poster;
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
let check = Helper.isValidHttpUrl(data);
|
|
371
|
-
|
|
372
|
-
if (check) {
|
|
373
|
-
return data;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
console.error(`Set valid url for poster image config item => posterImage : ${data} `);
|
|
377
|
-
return undefined;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
static processVideoTitle(data: string | defaultType, version: number) {
|
|
381
|
-
|
|
382
|
-
if (!data) {
|
|
383
|
-
return null
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
let outputData = undefined;
|
|
387
|
-
|
|
388
|
-
if (version === 1) {
|
|
389
|
-
if (typeof data === 'object') {
|
|
390
|
-
data = data.title;
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
if (data) {
|
|
395
|
-
if (typeof data === 'string' && /[a-zA-Z]/.test(data)) {
|
|
396
|
-
outputData = data;
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
return outputData;
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
static processAutoPlay(data: boolean | string | object, version: number) {
|
|
404
|
-
|
|
405
|
-
if (!data) {
|
|
406
|
-
return null
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
let outputData: boolean = false;
|
|
410
|
-
|
|
411
|
-
if (version === 1) {
|
|
412
|
-
return outputData;
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
if (typeof data === 'string') {
|
|
417
|
-
if (data === 'true') {
|
|
418
|
-
outputData = true;
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
if (typeof data === 'boolean') {
|
|
423
|
-
if (data) {
|
|
424
|
-
outputData = true;
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
return outputData;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
static processPreload(data: object | null, version: number) {
|
|
432
|
-
|
|
433
|
-
if (!data) {
|
|
434
|
-
return null
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
if (version === 1) {
|
|
438
|
-
return
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
type outputType = { start: number, stop: number, autoType: boolean, isActive: boolean };
|
|
442
|
-
const setTimeRange = (config: defaultType, itemOutput: outputType) => {
|
|
443
|
-
|
|
444
|
-
if (config.start) {
|
|
445
|
-
|
|
446
|
-
let start = config.start;
|
|
447
|
-
|
|
448
|
-
if (typeof start === 'string') {
|
|
449
|
-
start = parseFloat(start);
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
itemOutput.start = start;
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
if (!start) {
|
|
456
|
-
itemOutput.start = 0;
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
if (config.stop) {
|
|
461
|
-
|
|
462
|
-
let stop = config.stop;
|
|
463
|
-
|
|
464
|
-
if (typeof stop === 'string') {
|
|
465
|
-
stop = parseFloat(stop);
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
itemOutput.stop = stop;
|
|
469
|
-
|
|
470
|
-
if (!stop) {
|
|
471
|
-
itemOutput.stop = 10;
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
return itemOutput;
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
const setPreloadType = (type: defaultType, itemOutput: outputType) => {
|
|
480
|
-
|
|
481
|
-
itemOutput.autoType = true;
|
|
482
|
-
|
|
483
|
-
if (type.onload !== undefined) {
|
|
484
|
-
if (typeof type.onload === 'string' && type.onload === 'false') {
|
|
485
|
-
itemOutput.autoType = false;
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
if (typeof type.onload === 'boolean') {
|
|
489
|
-
if (!type.onload) {
|
|
490
|
-
itemOutput.autoType = false;
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
return itemOutput;
|
|
496
|
-
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
const setActive = (itemOutput: outputType) => {
|
|
500
|
-
itemOutput.isActive = true;
|
|
501
|
-
return itemOutput
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
let itemOutput: outputType = {
|
|
506
|
-
start: 0,
|
|
507
|
-
stop: 10,
|
|
508
|
-
isActive: false,
|
|
509
|
-
autoType: false,
|
|
510
|
-
|
|
511
|
-
};
|
|
512
|
-
|
|
513
|
-
if (typeof data === 'object') {
|
|
514
|
-
if (Object.keys(data).length !== 0) {
|
|
515
|
-
itemOutput = setTimeRange(data, itemOutput);
|
|
516
|
-
itemOutput = setPreloadType(data, itemOutput);
|
|
517
|
-
itemOutput = setActive(itemOutput);
|
|
518
|
-
|
|
519
|
-
return itemOutput;
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
if (Object.keys(data).length === 0) {
|
|
523
|
-
itemOutput = setPreloadType(data, itemOutput);
|
|
524
|
-
itemOutput = setActive(itemOutput);
|
|
525
|
-
|
|
526
|
-
return itemOutput
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
return false
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
if (typeof data === 'string' && data !== 'false') {
|
|
533
|
-
|
|
534
|
-
if (data === 'true') {
|
|
535
|
-
itemOutput = setPreloadType(data, itemOutput);
|
|
536
|
-
itemOutput = setActive(itemOutput);
|
|
537
|
-
return itemOutput;
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
return false;
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
if (typeof data === 'boolean') {
|
|
544
|
-
if (data) {
|
|
545
|
-
itemOutput = setPreloadType(data, itemOutput);
|
|
546
|
-
itemOutput = setActive(itemOutput);
|
|
547
|
-
return itemOutput;
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
return false;
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
return false;
|
|
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
|
-
}
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
|