@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 CHANGED
@@ -1,7 +1,7 @@
1
1
  # LT Player
2
2
 
3
3
  `@latest-thinking/lt-player` is the Latest Thinking video player package. Version 3 is currently
4
- available as a beta and provides the stock Video.js React player foundation for browser
4
+ available as a beta and provides the internal Video.js 10 media-engine foundation for browser
5
5
  applications.
6
6
 
7
7
  The package is ESM-only and bundles its runtime dependencies. Consumers need Node.js 20 or newer
@@ -19,35 +19,76 @@ Beta interfaces may change before the stable v3 release.
19
19
 
20
20
  ## Use the player
21
21
 
22
- Import both the package entry and its required stylesheet from your application:
22
+ Import the factory and the required stylesheet, then create a player in an existing host:
23
23
 
24
- ```js
24
+ ```ts
25
+ import { createPlayer, type PlayerConfig } from '@latest-thinking/lt-player';
25
26
  import '@latest-thinking/lt-player/styles.css';
26
- import '@latest-thinking/lt-player';
27
- ```
28
-
29
- Add an `lt-player` host element to the document. The optional `data-src` attribute supplies a
30
- browser-supported media URL:
31
27
 
32
- ```html
33
- <lt-player data-src="https://example.com/video.mp4"></lt-player>
28
+ const config: PlayerConfig = {
29
+ version: 3,
30
+ layout: 'landscape',
31
+ content: {
32
+ sources: [{ src: 'https://example.com/video.mp4', type: 'video/mp4' }],
33
+ chapters: [{ name: 'Opening', start: 0 }],
34
+ },
35
+ capabilities: {
36
+ speed: { options: [1, 1.5, 2] },
37
+ },
38
+ strings: {
39
+ coverButton: 'Watch now',
40
+ },
41
+ };
42
+
43
+ const host = document.querySelector<HTMLElement>('#player');
44
+ if (host) {
45
+ const player = createPlayer(host, config);
46
+ player.on('play', ({ currentTime }) => console.log('Playing at', currentTime));
47
+ }
34
48
  ```
35
49
 
36
- The package scans for `lt-player` elements when it loads and mounts one player in each host. Load
37
- the package after creating dynamically inserted hosts, because this foundation release does not
38
- observe later DOM changes. A host without `data-src` receives an empty player.
50
+ Only `layout` and `content.sources` are required by the type contract. Optional values remain
51
+ optional until configuration defaults are resolved by the player. String override keys are open
52
+ so capabilities added by future releases can contribute their own catalog entries. At runtime,
53
+ the current module catalog accepts declared keys such as `coverButton`; undeclared keys are omitted
54
+ and included in the configuration application's single consolidated warning.
55
+
56
+ `createPlayer` returns a stable handle for updates, state snapshots, playback and preference
57
+ commands, share and context-panel actions, event subscriptions, and destruction. The package does
58
+ not scan the consumer document when imported. The stylesheet gives the host, media-engine
59
+ container, video element, and LT-owned headless controls their complete baseline presentation.
60
+ Width remains an application layout decision; the selected landscape or portrait shell owns its
61
+ aspect ratio. Core controls can be removed individually through configuration, including a
62
+ supported fully chromeless surface that remains operable through the page API.
63
+
64
+ ## Use the feed
65
+
66
+ The optional feed entry coordinates an ordered list of complete portrait configurations while
67
+ reusing one player and media element:
68
+
69
+ ```ts
70
+ import { createFeed } from '@latest-thinking/lt-player/feed';
71
+ import type { PlayerConfig } from '@latest-thinking/lt-player';
72
+
73
+ const configurations: PlayerConfig[] = [firstPortraitVideo, secondPortraitVideo];
74
+ const host = document.querySelector<HTMLElement>('#shorts');
75
+ if (host) {
76
+ const feed = createFeed(host, configurations);
77
+ feed.on('indexChange', ({ index }) => console.log('Current item', index));
78
+ }
79
+ ```
39
80
 
40
- The stylesheet contains the stock player skin and gives the host block layout. Width and aspect
41
- ratio remain application layout decisions. The stock skin uses the `videojs-default` CSS cascade
42
- layer, so unlayered application reset rules can take precedence over it.
81
+ The host owns the feed's available height. Each snap item fills that height, so applications can
82
+ use the module inside a full viewport or another explicitly sized container.
43
83
 
44
84
  ## Package exports
45
85
 
46
- | Export | Purpose |
47
- | ----------------------------------------- | --------------------------- |
48
- | `@latest-thinking/lt-player` | Effectful ESM package entry |
49
- | `@latest-thinking/lt-player/styles.css` | Bundled player stylesheet |
50
- | `@latest-thinking/lt-player/package.json` | Published package metadata |
86
+ | Export | Purpose |
87
+ | ----------------------------------------- | --------------------------------------------- |
88
+ | `@latest-thinking/lt-player` | `createPlayer` and public v3 TypeScript types |
89
+ | `@latest-thinking/lt-player/feed` | `createFeed` and public feed TypeScript types |
90
+ | `@latest-thinking/lt-player/styles.css` | Bundled player stylesheet |
91
+ | `@latest-thinking/lt-player/package.json` | Published package metadata |
51
92
 
52
93
  The baseline player supports formats the browser can play natively. Streaming media engines are
53
94
  not included in this foundation release.
@@ -2,25 +2,26 @@
2
2
 
3
3
  # Third-Party Notices
4
4
 
5
- `@latest-thinking/lt-player` bundles the following third-party packages. Their license
6
- terms apply to those packages independently of the proprietary LT Player license.
5
+ `@latest-thinking/lt-player` bundles the following third-party packages and font assets.
6
+ Their license terms apply independently of the proprietary LT Player license.
7
7
 
8
8
  ## Bundled package inventory
9
9
 
10
10
  | Package | Version | SPDX license |
11
11
  | --- | --- | --- |
12
- | `@videojs/core` | `10.0.0-beta.31` | `Apache-2.0` |
13
- | `@videojs/media` | `10.0.0-beta.31` | `Apache-2.0` |
14
- | `@videojs/react` | `10.0.0-beta.31` | `Apache-2.0` |
15
- | `@videojs/store` | `10.0.0-beta.31` | `Apache-2.0` |
16
- | `@videojs/utils` | `10.0.0-beta.31` | `Apache-2.0` |
12
+ | `@videojs/core` | `10.0.0-beta.32` | `Apache-2.0` |
13
+ | `@videojs/media` | `10.0.0-beta.32` | `Apache-2.0` |
14
+ | `@videojs/react` | `10.0.0-beta.32` | `Apache-2.0` |
15
+ | `@videojs/store` | `10.0.0-beta.32` | `Apache-2.0` |
16
+ | `@videojs/utils` | `10.0.0-beta.32` | `Apache-2.0` |
17
+ | `Nunito Sans` | `v19` | `OFL-1.1` |
17
18
  | `react-dom` | `19.2.8` | `MIT` |
18
19
  | `react` | `19.2.8` | `MIT` |
19
20
  | `scheduler` | `0.27.0` | `MIT` |
20
21
 
21
22
  ## Package license notices
22
23
 
23
- ### @videojs/core 10.0.0-beta.31
24
+ ### @videojs/core 10.0.0-beta.32
24
25
 
25
26
  SPDX-License-Identifier: Apache-2.0
26
27
 
@@ -47,7 +48,7 @@ The project is maintained independently by the open-source community,
47
48
  governed by the Video.js Technical Steering Committee.
48
49
  ```
49
50
 
50
- ### @videojs/media 10.0.0-beta.31
51
+ ### @videojs/media 10.0.0-beta.32
51
52
 
52
53
  SPDX-License-Identifier: Apache-2.0
53
54
 
@@ -74,7 +75,7 @@ The project is maintained independently by the open-source community,
74
75
  governed by the Video.js Technical Steering Committee.
75
76
  ```
76
77
 
77
- ### @videojs/react 10.0.0-beta.31
78
+ ### @videojs/react 10.0.0-beta.32
78
79
 
79
80
  SPDX-License-Identifier: Apache-2.0
80
81
 
@@ -101,7 +102,7 @@ The project is maintained independently by the open-source community,
101
102
  governed by the Video.js Technical Steering Committee.
102
103
  ```
103
104
 
104
- ### @videojs/store 10.0.0-beta.31
105
+ ### @videojs/store 10.0.0-beta.32
105
106
 
106
107
  SPDX-License-Identifier: Apache-2.0
107
108
 
@@ -128,7 +129,7 @@ The project is maintained independently by the open-source community,
128
129
  governed by the Video.js Technical Steering Committee.
129
130
  ```
130
131
 
131
- ### @videojs/utils 10.0.0-beta.31
132
+ ### @videojs/utils 10.0.0-beta.32
132
133
 
133
134
  SPDX-License-Identifier: Apache-2.0
134
135
 
@@ -155,6 +156,104 @@ The project is maintained independently by the open-source community,
155
156
  governed by the Video.js Technical Steering Committee.
156
157
  ```
157
158
 
159
+ ### Nunito Sans v19
160
+
161
+ SPDX-License-Identifier: OFL-1.1
162
+
163
+ ```text
164
+ Copyright 2016 The Nunito Sans Project Authors (https://github.com/Fonthausen/NunitoSans) NunitoSans-Italic[YTLC,opsz,wdth,wght].ttf: Copyright 2016 The Nunito Sans Project Authors (https://github.com/Fonthausen/NunitoSans)
165
+
166
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
167
+ This license is copied below, and is also available with a FAQ at:
168
+ http://scripts.sil.org/OFL
169
+
170
+
171
+ -----------------------------------------------------------
172
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
173
+ -----------------------------------------------------------
174
+
175
+ PREAMBLE
176
+ The goals of the Open Font License (OFL) are to stimulate worldwide
177
+ development of collaborative font projects, to support the font creation
178
+ efforts of academic and linguistic communities, and to provide a free and
179
+ open framework in which fonts may be shared and improved in partnership
180
+ with others.
181
+
182
+ The OFL allows the licensed fonts to be used, studied, modified and
183
+ redistributed freely as long as they are not sold by themselves. The
184
+ fonts, including any derivative works, can be bundled, embedded,
185
+ redistributed and/or sold with any software provided that any reserved
186
+ names are not used by derivative works. The fonts and derivatives,
187
+ however, cannot be released under any other type of license. The
188
+ requirement for fonts to remain under this license does not apply
189
+ to any document created using the fonts or their derivatives.
190
+
191
+ DEFINITIONS
192
+ "Font Software" refers to the set of files released by the Copyright
193
+ Holder(s) under this license and clearly marked as such. This may
194
+ include source files, build scripts and documentation.
195
+
196
+ "Reserved Font Name" refers to any names specified as such after the
197
+ copyright statement(s).
198
+
199
+ "Original Version" refers to the collection of Font Software components as
200
+ distributed by the Copyright Holder(s).
201
+
202
+ "Modified Version" refers to any derivative made by adding to, deleting,
203
+ or substituting -- in part or in whole -- any of the components of the
204
+ Original Version, by changing formats or by porting the Font Software to a
205
+ new environment.
206
+
207
+ "Author" refers to any designer, engineer, programmer, technical
208
+ writer or other person who contributed to the Font Software.
209
+
210
+ PERMISSION & CONDITIONS
211
+ Permission is hereby granted, free of charge, to any person obtaining
212
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
213
+ redistribute, and sell modified and unmodified copies of the Font
214
+ Software, subject to the following conditions:
215
+
216
+ 1) Neither the Font Software nor any of its individual components,
217
+ in Original or Modified Versions, may be sold by itself.
218
+
219
+ 2) Original or Modified Versions of the Font Software may be bundled,
220
+ redistributed and/or sold with any software, provided that each copy
221
+ contains the above copyright notice and this license. These can be
222
+ included either as stand-alone text files, human-readable headers or
223
+ in the appropriate machine-readable metadata fields within text or
224
+ binary files as long as those fields can be easily viewed by the user.
225
+
226
+ 3) No Modified Version of the Font Software may use the Reserved Font
227
+ Name(s) unless explicit written permission is granted by the corresponding
228
+ Copyright Holder. This restriction only applies to the primary font name as
229
+ presented to the users.
230
+
231
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
232
+ Software shall not be used to promote, endorse or advertise any Modified
233
+ Version, except to acknowledge the contribution(s) of the Copyright
234
+ Holder(s) and the Author(s) or with their explicit written permission.
235
+
236
+ 5) The Font Software, modified or unmodified, in part or in whole,
237
+ must be distributed entirely under this license, and must not be
238
+ distributed under any other license. The requirement for fonts to
239
+ remain under this license does not apply to any document created using
240
+ the Font Software.
241
+
242
+ TERMINATION
243
+ This license becomes null and void if any of the above conditions are not met.
244
+
245
+ DISCLAIMER
246
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
247
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
248
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
249
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
250
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
251
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
252
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
253
+ OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS
254
+ IN THE FONT SOFTWARE.
255
+ ```
256
+
158
257
  ### react-dom 19.2.8
159
258
 
160
259
  SPDX-License-Identifier: MIT
package/dist/feed.d.ts ADDED
@@ -0,0 +1,256 @@
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 createFeed(host: HTMLElement, configurations: readonly PlayerConfig[]): FeedHandle;
6
+
7
+ export declare type FeedEventHandler<Event extends FeedEventName> = (payload: FeedEventMap[Event]) => void;
8
+
9
+ export declare interface FeedEventMap extends PlayerEventMap {
10
+ indexChange: {
11
+ index: number;
12
+ };
13
+ }
14
+
15
+ export declare type FeedEventName = keyof FeedEventMap;
16
+
17
+ export declare type FeedEventUnsubscribe = () => void;
18
+
19
+ export declare interface FeedHandle {
20
+ previous(): void;
21
+ next(): void;
22
+ goTo(index: number): void;
23
+ getIndex(): number;
24
+ destroy(): void;
25
+ on<Event extends FeedEventName>(event: Event, handler: FeedEventHandler<Event>): FeedEventUnsubscribe;
26
+ }
27
+
28
+ declare interface PlayerCapabilities {
29
+ chapters?: boolean;
30
+ captions?: boolean;
31
+ speed?: boolean | PlayerSpeedOptions;
32
+ share?: boolean | PlayerShareOptions;
33
+ contextPanel?: boolean;
34
+ }
35
+
36
+ declare interface PlayerCaptionsState {
37
+ enabled: boolean;
38
+ language?: string;
39
+ }
40
+
41
+ declare interface PlayerChapter {
42
+ name: string;
43
+ start: number;
44
+ }
45
+
46
+ declare interface PlayerConfig {
47
+ version?: 3;
48
+ layout: PlayerLayout;
49
+ language?: PlayerLanguage;
50
+ content: PlayerContent;
51
+ controls?: PlayerControls;
52
+ capabilities?: PlayerCapabilities;
53
+ strings?: PlayerStrings;
54
+ }
55
+
56
+ declare interface PlayerContent {
57
+ title?: string;
58
+ author?: string;
59
+ description?: string;
60
+ poster?: string;
61
+ duration?: number;
62
+ sources: PlayerSource[];
63
+ tracks?: PlayerTrack[];
64
+ chapters?: PlayerChapter[];
65
+ metadata?: PlayerMetadata;
66
+ }
67
+
68
+ declare interface PlayerControls {
69
+ cover?: boolean | PlayerCoverOptions;
70
+ playPause?: PlayerControlSwitch;
71
+ timeline?: boolean | PlayerTimelineOptions;
72
+ time?: PlayerControlSwitch;
73
+ volume?: PlayerControlSwitch;
74
+ fullscreen?: PlayerControlSwitch;
75
+ pip?: PlayerControlSwitch;
76
+ buffering?: PlayerControlSwitch;
77
+ inputFeedback?: PlayerControlSwitch;
78
+ logo?: PlayerControlSwitch;
79
+ gestures?: PlayerControlSwitch;
80
+ hotkeys?: PlayerControlSwitch;
81
+ }
82
+
83
+ declare type PlayerControlSwitch = boolean | PlayerEmptyOptions;
84
+
85
+ declare interface PlayerCoverButtonOptions {
86
+ label?: string;
87
+ }
88
+
89
+ declare interface PlayerCoverOptions {
90
+ image?: boolean;
91
+ title?: boolean;
92
+ author?: boolean;
93
+ button?: boolean | PlayerCoverButtonOptions;
94
+ }
95
+
96
+ declare type PlayerEmptyOptions = Record<string, never>;
97
+
98
+ declare interface PlayerEventBase {
99
+ currentTime: number;
100
+ }
101
+
102
+ declare interface PlayerEventMap {
103
+ ready: PlayerEventBase & {
104
+ duration: number;
105
+ };
106
+ play: PlayerEventBase;
107
+ pause: PlayerEventBase;
108
+ ended: PlayerEventBase;
109
+ seeked: PlayerEventBase;
110
+ buffering: PlayerEventBase & {
111
+ buffering: boolean;
112
+ };
113
+ error: PlayerEventBase & {
114
+ kind: 'configuration' | 'startup' | 'mid-playback';
115
+ };
116
+ timeUpdate: PlayerEventBase;
117
+ chapterChange: PlayerEventBase & {
118
+ chapter: PlayerChapter | null;
119
+ };
120
+ volumeChange: PlayerEventBase & {
121
+ volume: number;
122
+ muted: boolean;
123
+ };
124
+ rateChange: PlayerEventBase & {
125
+ rate: number;
126
+ };
127
+ captionsChange: PlayerEventBase & {
128
+ captions: PlayerCaptionsState;
129
+ };
130
+ pipChange: PlayerEventBase & {
131
+ pip: boolean;
132
+ };
133
+ shareOpen: PlayerEventBase & {
134
+ source: 'player' | 'page';
135
+ };
136
+ panelOpen: PlayerEventBase & {
137
+ view: PlayerPanelView;
138
+ };
139
+ panelClose: PlayerEventBase;
140
+ videoChange: PlayerEventBase;
141
+ }
142
+
143
+ declare interface PlayerInANutshellMetadata {
144
+ generatedByAi?: boolean;
145
+ keyTakeaway?: string;
146
+ summary?: string;
147
+ }
148
+
149
+ declare interface PlayerKeyConcept {
150
+ label: string;
151
+ description: string;
152
+ start?: number;
153
+ }
154
+
155
+ declare interface PlayerKeyConceptsMetadata {
156
+ generatedByAi?: boolean;
157
+ items?: PlayerKeyConcept[];
158
+ }
159
+
160
+ declare type PlayerLanguage = string | string[];
161
+
162
+ declare type PlayerLayout = 'landscape' | 'portrait';
163
+
164
+ declare interface PlayerMetadata {
165
+ inANutshell?: PlayerInANutshellMetadata;
166
+ keyConcepts?: PlayerKeyConceptsMetadata;
167
+ researchField?: PlayerResearchFieldMetadata;
168
+ transcript?: PlayerTranscriptMetadata;
169
+ underlyingPublication?: PlayerUnderlyingPublicationMetadata;
170
+ relatedVideos?: PlayerRelatedVideosMetadata;
171
+ }
172
+
173
+ declare type PlayerPanelView = ContextPanelView;
174
+
175
+ declare interface PlayerPublication {
176
+ title: string;
177
+ authors: string[];
178
+ journal: string;
179
+ abstract: string;
180
+ url: string;
181
+ }
182
+
183
+ declare interface PlayerRelatedVideo {
184
+ title: string;
185
+ poster: string;
186
+ url: string;
187
+ }
188
+
189
+ declare interface PlayerRelatedVideosMetadata {
190
+ generatedByAi?: boolean;
191
+ related?: PlayerRelatedVideo[];
192
+ forYou?: PlayerRelatedVideo[];
193
+ }
194
+
195
+ declare interface PlayerResearchFieldMetadata {
196
+ generatedByAi?: boolean;
197
+ sections?: PlayerResearchFieldSection[];
198
+ }
199
+
200
+ declare interface PlayerResearchFieldSection {
201
+ title: string;
202
+ description: string;
203
+ }
204
+
205
+ declare interface PlayerShareOptions {
206
+ canonicalUrl?: string;
207
+ embedUrl?: string;
208
+ targets?: PlayerShareTarget[];
209
+ templates?: PlayerShareTemplates;
210
+ }
211
+
212
+ declare type PlayerShareTarget = 'link' | 'embed' | 'facebook' | 'x' | 'linkedin' | 'whatsapp' | 'more';
213
+
214
+ declare interface PlayerShareTemplates {
215
+ message?: string;
216
+ }
217
+
218
+ declare interface PlayerSource {
219
+ src: string;
220
+ type?: string;
221
+ }
222
+
223
+ declare interface PlayerSpeedOptions {
224
+ options?: number[];
225
+ }
226
+
227
+ declare type PlayerStrings = Record<string, string>;
228
+
229
+ declare interface PlayerTimelineOptions {
230
+ seekStep?: number;
231
+ }
232
+
233
+ declare interface PlayerTrack {
234
+ src: string;
235
+ kind?: string;
236
+ label?: string;
237
+ srclang?: string;
238
+ default?: boolean;
239
+ }
240
+
241
+ declare interface PlayerTranscriptEntry {
242
+ start: number;
243
+ text: string;
244
+ }
245
+
246
+ declare interface PlayerTranscriptMetadata {
247
+ generatedByAi?: boolean;
248
+ entries?: PlayerTranscriptEntry[];
249
+ }
250
+
251
+ declare interface PlayerUnderlyingPublicationMetadata {
252
+ generatedByAi?: boolean;
253
+ items?: PlayerPublication[];
254
+ }
255
+
256
+ export { }