@latest-thinking/lt-player 3.0.0-beta.2 → 3.0.0-beta.3
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 +62 -21
- package/THIRD-PARTY-NOTICES.md +111 -12
- package/dist/feed.d.ts +256 -0
- package/dist/feed.js +346 -0
- package/dist/fonts/OFL-1.1.txt +91 -0
- package/dist/fonts/nunito-sans-latin-300-normal.woff2 +0 -0
- package/dist/fonts/nunito-sans-latin-400-normal.woff2 +0 -0
- package/dist/fonts/nunito-sans-latin-500-normal.woff2 +0 -0
- package/dist/fonts/nunito-sans-latin-600-normal.woff2 +0 -0
- package/dist/fonts/nunito-sans-latin-700-normal.woff2 +0 -0
- package/dist/fonts/nunito-sans-latin-ext-300-normal.woff2 +0 -0
- package/dist/fonts/nunito-sans-latin-ext-400-normal.woff2 +0 -0
- package/dist/fonts/nunito-sans-latin-ext-500-normal.woff2 +0 -0
- package/dist/fonts/nunito-sans-latin-ext-600-normal.woff2 +0 -0
- package/dist/fonts/nunito-sans-latin-ext-700-normal.woff2 +0 -0
- package/dist/index.d.ts +273 -0
- package/dist/index.js +2 -17690
- package/dist/player.js +21808 -0
- package/dist/styles.css +1 -1
- package/package.json +27 -8
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,274 @@
|
|
|
1
|
+
declare const CONTEXT_PANEL_VIEWS: readonly ["knowledge", "underlyingPublication", "relatedVideos"];
|
|
2
|
+
|
|
3
|
+
declare type ContextPanelView = (typeof CONTEXT_PANEL_VIEWS)[number];
|
|
4
|
+
|
|
5
|
+
export declare function createPlayer(host: HTMLElement, config: PlayerConfig): PlayerHandle;
|
|
6
|
+
|
|
7
|
+
declare const LT_PLAYBACK_STATES: readonly ["idle", "buffering", "playing", "paused", "ended", "error"];
|
|
8
|
+
|
|
9
|
+
declare type LtPlaybackState = (typeof LT_PLAYBACK_STATES)[number];
|
|
10
|
+
|
|
11
|
+
export declare interface PlayerCapabilities {
|
|
12
|
+
chapters?: boolean;
|
|
13
|
+
captions?: boolean;
|
|
14
|
+
speed?: boolean | PlayerSpeedOptions;
|
|
15
|
+
share?: boolean | PlayerShareOptions;
|
|
16
|
+
contextPanel?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export declare interface PlayerCaptionsState {
|
|
20
|
+
enabled: boolean;
|
|
21
|
+
language?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export declare interface PlayerChapter {
|
|
25
|
+
name: string;
|
|
26
|
+
start: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export declare interface PlayerConfig {
|
|
30
|
+
version?: 3;
|
|
31
|
+
layout: PlayerLayout;
|
|
32
|
+
language?: PlayerLanguage;
|
|
33
|
+
content: PlayerContent;
|
|
34
|
+
controls?: PlayerControls;
|
|
35
|
+
capabilities?: PlayerCapabilities;
|
|
36
|
+
strings?: PlayerStrings;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export declare interface PlayerContent {
|
|
40
|
+
title?: string;
|
|
41
|
+
author?: string;
|
|
42
|
+
description?: string;
|
|
43
|
+
poster?: string;
|
|
44
|
+
duration?: number;
|
|
45
|
+
sources: PlayerSource[];
|
|
46
|
+
tracks?: PlayerTrack[];
|
|
47
|
+
chapters?: PlayerChapter[];
|
|
48
|
+
metadata?: PlayerMetadata;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export declare interface PlayerControls {
|
|
52
|
+
cover?: boolean | PlayerCoverOptions;
|
|
53
|
+
playPause?: PlayerControlSwitch;
|
|
54
|
+
timeline?: boolean | PlayerTimelineOptions;
|
|
55
|
+
time?: PlayerControlSwitch;
|
|
56
|
+
volume?: PlayerControlSwitch;
|
|
57
|
+
fullscreen?: PlayerControlSwitch;
|
|
58
|
+
pip?: PlayerControlSwitch;
|
|
59
|
+
buffering?: PlayerControlSwitch;
|
|
60
|
+
inputFeedback?: PlayerControlSwitch;
|
|
61
|
+
logo?: PlayerControlSwitch;
|
|
62
|
+
gestures?: PlayerControlSwitch;
|
|
63
|
+
hotkeys?: PlayerControlSwitch;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export declare type PlayerControlSwitch = boolean | PlayerEmptyOptions;
|
|
67
|
+
|
|
68
|
+
export declare interface PlayerCoverButtonOptions {
|
|
69
|
+
label?: string;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export declare interface PlayerCoverOptions {
|
|
73
|
+
image?: boolean;
|
|
74
|
+
title?: boolean;
|
|
75
|
+
author?: boolean;
|
|
76
|
+
button?: boolean | PlayerCoverButtonOptions;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export declare type PlayerEmptyOptions = Record<string, never>;
|
|
80
|
+
|
|
81
|
+
declare interface PlayerEventBase {
|
|
82
|
+
currentTime: number;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export declare type PlayerEventHandler<Event extends PlayerEventName> = (payload: PlayerEventMap[Event]) => void;
|
|
86
|
+
|
|
87
|
+
export declare interface PlayerEventMap {
|
|
88
|
+
ready: PlayerEventBase & {
|
|
89
|
+
duration: number;
|
|
90
|
+
};
|
|
91
|
+
play: PlayerEventBase;
|
|
92
|
+
pause: PlayerEventBase;
|
|
93
|
+
ended: PlayerEventBase;
|
|
94
|
+
seeked: PlayerEventBase;
|
|
95
|
+
buffering: PlayerEventBase & {
|
|
96
|
+
buffering: boolean;
|
|
97
|
+
};
|
|
98
|
+
error: PlayerEventBase & {
|
|
99
|
+
kind: 'configuration' | 'startup' | 'mid-playback';
|
|
100
|
+
};
|
|
101
|
+
timeUpdate: PlayerEventBase;
|
|
102
|
+
chapterChange: PlayerEventBase & {
|
|
103
|
+
chapter: PlayerChapter | null;
|
|
104
|
+
};
|
|
105
|
+
volumeChange: PlayerEventBase & {
|
|
106
|
+
volume: number;
|
|
107
|
+
muted: boolean;
|
|
108
|
+
};
|
|
109
|
+
rateChange: PlayerEventBase & {
|
|
110
|
+
rate: number;
|
|
111
|
+
};
|
|
112
|
+
captionsChange: PlayerEventBase & {
|
|
113
|
+
captions: PlayerCaptionsState;
|
|
114
|
+
};
|
|
115
|
+
pipChange: PlayerEventBase & {
|
|
116
|
+
pip: boolean;
|
|
117
|
+
};
|
|
118
|
+
shareOpen: PlayerEventBase & {
|
|
119
|
+
source: 'player' | 'page';
|
|
120
|
+
};
|
|
121
|
+
panelOpen: PlayerEventBase & {
|
|
122
|
+
view: PlayerPanelView;
|
|
123
|
+
};
|
|
124
|
+
panelClose: PlayerEventBase;
|
|
125
|
+
videoChange: PlayerEventBase;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export declare type PlayerEventName = keyof PlayerEventMap;
|
|
129
|
+
|
|
130
|
+
export declare type PlayerEventUnsubscribe = () => void;
|
|
131
|
+
|
|
132
|
+
export declare interface PlayerHandle {
|
|
133
|
+
update(config: PlayerConfig): void;
|
|
134
|
+
destroy(): void;
|
|
135
|
+
getState(): PlayerStateSnapshot;
|
|
136
|
+
play(): void;
|
|
137
|
+
pause(): void;
|
|
138
|
+
seek(seconds: number): void;
|
|
139
|
+
setVolume(volume: number): void;
|
|
140
|
+
setMuted(muted: boolean): void;
|
|
141
|
+
setRate(rate: number): void;
|
|
142
|
+
setCaptions(captions: PlayerCaptionsState): void;
|
|
143
|
+
openShare(): void;
|
|
144
|
+
openPanel(view: PlayerPanelView): void;
|
|
145
|
+
closePanel(): void;
|
|
146
|
+
on<Event extends PlayerEventName>(event: Event, handler: PlayerEventHandler<Event>): PlayerEventUnsubscribe;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export declare interface PlayerInANutshellMetadata {
|
|
150
|
+
generatedByAi?: boolean;
|
|
151
|
+
keyTakeaway?: string;
|
|
152
|
+
summary?: string;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export declare interface PlayerKeyConcept {
|
|
156
|
+
label: string;
|
|
157
|
+
description: string;
|
|
158
|
+
start?: number;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export declare interface PlayerKeyConceptsMetadata {
|
|
162
|
+
generatedByAi?: boolean;
|
|
163
|
+
items?: PlayerKeyConcept[];
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export declare type PlayerLanguage = string | string[];
|
|
167
|
+
|
|
168
|
+
export declare type PlayerLayout = 'landscape' | 'portrait';
|
|
169
|
+
|
|
170
|
+
export declare interface PlayerMetadata {
|
|
171
|
+
inANutshell?: PlayerInANutshellMetadata;
|
|
172
|
+
keyConcepts?: PlayerKeyConceptsMetadata;
|
|
173
|
+
researchField?: PlayerResearchFieldMetadata;
|
|
174
|
+
transcript?: PlayerTranscriptMetadata;
|
|
175
|
+
underlyingPublication?: PlayerUnderlyingPublicationMetadata;
|
|
176
|
+
relatedVideos?: PlayerRelatedVideosMetadata;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export declare type PlayerPanelView = ContextPanelView;
|
|
180
|
+
|
|
181
|
+
export declare interface PlayerPublication {
|
|
182
|
+
title: string;
|
|
183
|
+
authors: string[];
|
|
184
|
+
journal: string;
|
|
185
|
+
abstract: string;
|
|
186
|
+
url: string;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export declare interface PlayerRelatedVideo {
|
|
190
|
+
title: string;
|
|
191
|
+
poster: string;
|
|
192
|
+
url: string;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export declare interface PlayerRelatedVideosMetadata {
|
|
196
|
+
generatedByAi?: boolean;
|
|
197
|
+
related?: PlayerRelatedVideo[];
|
|
198
|
+
forYou?: PlayerRelatedVideo[];
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export declare interface PlayerResearchFieldMetadata {
|
|
202
|
+
generatedByAi?: boolean;
|
|
203
|
+
sections?: PlayerResearchFieldSection[];
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export declare interface PlayerResearchFieldSection {
|
|
207
|
+
title: string;
|
|
208
|
+
description: string;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export declare interface PlayerShareOptions {
|
|
212
|
+
canonicalUrl?: string;
|
|
213
|
+
embedUrl?: string;
|
|
214
|
+
targets?: PlayerShareTarget[];
|
|
215
|
+
templates?: PlayerShareTemplates;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export declare type PlayerShareTarget = 'link' | 'embed' | 'facebook' | 'x' | 'linkedin' | 'whatsapp' | 'more';
|
|
219
|
+
|
|
220
|
+
export declare interface PlayerShareTemplates {
|
|
221
|
+
message?: string;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export declare interface PlayerSource {
|
|
225
|
+
src: string;
|
|
226
|
+
type?: string;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export declare interface PlayerSpeedOptions {
|
|
230
|
+
options?: number[];
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export declare interface PlayerStateSnapshot {
|
|
234
|
+
playback: LtPlaybackState;
|
|
235
|
+
currentTime: number;
|
|
236
|
+
duration: number;
|
|
237
|
+
volume: number;
|
|
238
|
+
muted: boolean;
|
|
239
|
+
rate: number;
|
|
240
|
+
captions: PlayerCaptionsState;
|
|
241
|
+
pip: boolean;
|
|
242
|
+
layout: PlayerLayout;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export declare type PlayerStrings = Record<string, string>;
|
|
246
|
+
|
|
247
|
+
export declare interface PlayerTimelineOptions {
|
|
248
|
+
seekStep?: number;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export declare interface PlayerTrack {
|
|
252
|
+
src: string;
|
|
253
|
+
kind?: string;
|
|
254
|
+
label?: string;
|
|
255
|
+
srclang?: string;
|
|
256
|
+
default?: boolean;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export declare interface PlayerTranscriptEntry {
|
|
260
|
+
start: number;
|
|
261
|
+
text: string;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export declare interface PlayerTranscriptMetadata {
|
|
265
|
+
generatedByAi?: boolean;
|
|
266
|
+
entries?: PlayerTranscriptEntry[];
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export declare interface PlayerUnderlyingPublicationMetadata {
|
|
270
|
+
generatedByAi?: boolean;
|
|
271
|
+
items?: PlayerPublication[];
|
|
272
|
+
}
|
|
273
|
+
|
|
1
274
|
export { }
|