@latest-thinking/lt-player 2.0.0-q → 3.0.0-beta.10

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/LICENSE.md ADDED
@@ -0,0 +1,121 @@
1
+ # LT Player License Agreement
2
+
3
+ Copyright (c) Latest Thinking GmbH. All rights reserved.
4
+
5
+ This LT Player License Agreement (the "Agreement") governs the use of version 3 and later of
6
+ the `@latest-thinking/lt-player` software package and its compiled files (the "Software"). The
7
+ licensor is Latest Thinking GmbH, Am Feenteich 4, 22085 Hamburg, Germany (the "Licensor").
8
+
9
+ This Agreement is a proprietary software license. It is not an open-source license. Installing,
10
+ copying, or using the Software constitutes acceptance of this Agreement. If you do not accept
11
+ these terms, do not install or use the Software.
12
+
13
+ ## 1. License grant
14
+
15
+ Subject to this Agreement, the Licensor grants you a non-exclusive, worldwide, royalty-free,
16
+ revocable, and non-transferable license to:
17
+
18
+ 1. install and use the Software in its compiled form;
19
+ 2. bundle the Software into applications and websites, including internal, commercial, and
20
+ client projects; and
21
+ 3. distribute the Software only as an embedded part of such an application or website bundle,
22
+ provided that the Software is not offered as a standalone package or reusable component.
23
+
24
+ You may perform minification, tree-shaking, transpilation, module concatenation, and comparable
25
+ automated transformations only when they are incidental to bundling the Software into an
26
+ application or website. These transformations do not permit functional changes to the Software.
27
+
28
+ ## 2. Restrictions
29
+
30
+ Except where applicable law expressly provides otherwise and does not permit contractual
31
+ restriction, you must not:
32
+
33
+ 1. modify the Software, change its functionality, or create derivative works from it;
34
+ 2. reverse engineer, decompile, disassemble, or otherwise attempt to discover its source code or
35
+ internal design;
36
+ 3. redistribute, publish, sublicense, sell, rent, lease, or otherwise make the Software available
37
+ as a standalone package, library, component, download, or service;
38
+ 4. use the Software to create or distribute a competing standalone video-player package;
39
+ 5. remove, obscure, or alter any copyright, trademark, attribution, license, or proprietary notice;
40
+ or
41
+ 6. remove, obscure, or alter Latest Thinking branding included in the Software, except where the
42
+ Licensor has expressly authorized that removal in writing.
43
+
44
+ You may not transfer this Agreement or the rights it grants without the Licensor's prior written
45
+ consent. Contractors working on your behalf may use the Software only for your licensed project,
46
+ under confidentiality and use restrictions at least as protective as this Agreement. You remain
47
+ responsible for their compliance.
48
+
49
+ ## 3. Ownership and trademarks
50
+
51
+ The Software is licensed, not sold. The Licensor and its suppliers retain all rights, title, and
52
+ interest in and to the Software, including all intellectual property rights. No rights are granted
53
+ except those expressly stated in this Agreement.
54
+
55
+ This Agreement does not grant permission to use the Licensor's names, logos, trademarks, or
56
+ service marks except as they appear in an authorized, unmodified use of the Software. Third-party
57
+ names and trademarks remain the property of their respective owners.
58
+
59
+ ## 4. Third-party software
60
+
61
+ The Software contains third-party components governed by their own license terms. Those terms
62
+ apply only to the corresponding third-party components and are reproduced in
63
+ `THIRD-PARTY-NOTICES.md`. Nothing in this Agreement limits rights granted by a third-party license
64
+ or imposes this Agreement on third-party software.
65
+
66
+ ## 5. Updates and support
67
+
68
+ The Licensor may provide updates at its discretion. Unless separate written terms state otherwise,
69
+ updates are governed by the version of this Agreement supplied with them. This Agreement does not
70
+ obligate the Licensor to provide maintenance, support, updates, or continued availability.
71
+
72
+ ## 6. Disclaimer of warranties
73
+
74
+ To the maximum extent permitted by applicable law, the Software is provided "as is" and "as
75
+ available," without warranties or conditions of any kind, whether express, implied, or statutory.
76
+ The Licensor disclaims all implied warranties and conditions, including merchantability, fitness
77
+ for a particular purpose, title, non-infringement, accuracy, and uninterrupted or error-free
78
+ operation. You are responsible for evaluating whether the Software is suitable for your use.
79
+
80
+ Nothing in this Agreement excludes a warranty or remedy that applicable law does not permit the
81
+ parties to exclude.
82
+
83
+ ## 7. Limitation of liability
84
+
85
+ To the maximum extent permitted by applicable law, the Licensor is not liable for indirect,
86
+ incidental, special, exemplary, punitive, or consequential damages, or for loss of profits,
87
+ revenue, data, goodwill, business opportunities, or business interruption, arising from or related
88
+ to the Software or this Agreement, even if advised that such damages are possible.
89
+
90
+ The limitations in this section do not apply to liability that cannot lawfully be limited or
91
+ excluded, including liability for intent, gross negligence, death, personal injury, or mandatory
92
+ product liability where applicable.
93
+
94
+ ## 8. Termination
95
+
96
+ This Agreement terminates automatically if you materially breach it. Upon termination, you must
97
+ stop using and distributing the Software and remove standalone copies under your control. Existing
98
+ application or website bundles supplied to end users before termination may remain in use only to
99
+ the extent required by mandatory law or expressly authorized by the Licensor in writing.
100
+
101
+ Sections concerning restrictions, ownership, third-party software, warranties, liability,
102
+ termination, and general terms survive termination to the extent necessary to give them effect.
103
+
104
+ ## 9. General terms
105
+
106
+ This Agreement is the entire agreement concerning the Software unless you and the Licensor have
107
+ signed a separate agreement that expressly supersedes it. If any provision is unenforceable, it
108
+ will be limited to the minimum extent necessary, and the remaining provisions will remain in
109
+ effect. A failure to enforce a provision is not a waiver.
110
+
111
+ This Agreement is governed by the laws of the Federal Republic of Germany, excluding its conflict
112
+ of laws rules and the United Nations Convention on Contracts for the International Sale of Goods.
113
+ Where legally permitted, the exclusive place of jurisdiction is Hamburg, Germany. Mandatory
114
+ consumer-protection and jurisdiction rules remain unaffected.
115
+
116
+ Questions about this Agreement may be sent to `info@lt.org`.
117
+
118
+ ## Legal review status
119
+
120
+ This license has been prepared for team review. External legal review is required before the
121
+ stable v3.0.0 release is published.
package/README.md CHANGED
@@ -1,164 +1,107 @@
1
1
  # LT Player
2
2
 
3
- The LT Player is a custom video player tailored for the Latest Thinking GmbH digital ecosystem, designed to enhance user
4
- engagement and provide a seamless video viewing experience. Built on the robust Vidstack framework, it supports diverse
5
- video formats and offers advanced features such as rich metadata embedding and infinite scrolling for mobile users.
3
+ `@latest-thinking/lt-player` is the Latest Thinking video player package. Version 3 is currently
4
+ available as a beta and provides the internal Video.js 10 media-engine foundation for browser
5
+ applications.
6
6
 
7
- ## Getting Started
7
+ The package is ESM-only and bundles its runtime dependencies. Consumers need Node.js 20 or newer
8
+ for package tooling and a modern browser for playback.
8
9
 
9
- These instructions will get you a copy of the project up and running on your local machine for development and testing
10
- purposes.
10
+ ## Install the beta
11
11
 
12
- ### Prerequisites
13
-
14
- - Node.js (LTS version recommended)
15
- - npm
16
-
17
- ### Installation
18
-
19
- 1. Clone the repository:
20
-
21
- ```bash
22
- git clone ssh://git@git.welink.ro:2424/project/external/lt/player.git
23
- ```
24
-
25
- 2. Navigate to the project directory:
12
+ Install the version published on the npm `next` channel:
26
13
 
27
14
  ```bash
28
- cd player
15
+ npm install @latest-thinking/lt-player@next
29
16
  ```
30
17
 
31
- 3. Install dependencies:
32
-
33
- ```bash
34
- npm install
35
- ```
36
-
37
- ### Development
38
-
39
- To start the development server:
40
-
41
- ```bash
42
- npm run dev
18
+ Beta interfaces may change before the stable v3 release.
19
+
20
+ ## Use the player
21
+
22
+ Import the factory and the required stylesheet, then create a player in an existing host:
23
+
24
+ ```ts
25
+ import { createPlayer, type PlayerConfig } from '@latest-thinking/lt-player';
26
+ import '@latest-thinking/lt-player/styles.css';
27
+
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
+ }
43
48
  ```
44
49
 
45
- This command will start a local development server and open up a browser window. Most changes are reflected live without
46
- having to restart the server.
47
-
48
- ### Building
49
-
50
- To build the project for production:
51
-
52
- ```bash
53
- npm run build
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
+ }
54
79
  ```
55
80
 
56
- ### Previewing
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.
57
83
 
58
- To preview the production build:
84
+ ## Package exports
59
85
 
60
- ```bash
61
- npm run preview
62
- ```
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 |
63
92
 
64
- ## Running the Tests
93
+ HLS playback uses the package's `dist/hls.js` chunk. The player imports it dynamically only when an
94
+ HLS source requires the hls.js adapter, and it is never fetched from a CDN. Consumer bundlers that
95
+ support code splitting keep the adapter lazy; bundlers without code splitting include it in their
96
+ own application bundle.
65
97
 
66
- To run the configured tests:
98
+ ## License
67
99
 
68
- ```bash
69
- npm test
70
- ```
100
+ LT Player v3 is proprietary software, not open-source software. The license permits installing,
101
+ using, and bundling the compiled package into applications and websites, including client
102
+ projects. It prohibits functional modification, reverse engineering, standalone redistribution,
103
+ and removal of legal notices or Latest Thinking branding, subject to applicable law.
71
104
 
72
- ## Versioning
73
-
74
- We use [SemVer](http://semver.org/) for versioning. For the versions available, see
75
- the [tags on this repository](https://git.welink.ro/project/external/lt/player/-/tags).
76
-
77
- ## Authors
78
-
79
- **Welink**
80
-
81
-
82
- ## Acknowledgments
83
-
84
- - Vidstack for the core video player framework.
85
-
86
- ## Player config
87
-
88
- The JSON below is an example configuration that should be provided by any client who wants to initialize a LT Player:
89
-
90
- ```json
91
- {
92
- "version": 3,
93
- "body": {
94
- "title": "Video Title",
95
- "author": "Author Name",
96
- "sources": [
97
- {
98
- "src": "http://www.example.com/path/to/video.m3u8",
99
- "type": "application/x-mpegURL"
100
- },
101
- {
102
- "src": "http://www.example.com/path/to/video.mp4",
103
- "type": "video/mp4"
104
- }
105
- ],
106
- "duration": 320.37,
107
- "poster": "http://www.example.com/path/to/poster.jpg",
108
- "chapters": [
109
- {
110
- "timestamp": 7.205,
111
- "name": "Question"
112
- },
113
- {
114
- "timestamp": 77.205,
115
- "name": "Method"
116
- }
117
- ],
118
- "tracks": [
119
- {
120
- "kind": "subtitles",
121
- "label": "English",
122
- "srclang": "en",
123
- "src": "http://www.example.com/path/to/subtitles.vtt",
124
- "default": true
125
- },
126
- {
127
- "kind": "subtitles",
128
- "label": "Romanian",
129
- "srclang": "ro",
130
- "src": "http://www.example.com/path/to/romanian-subtitles.vtt"
131
- },
132
- {
133
- "kind": "subtitles",
134
- "label": "German",
135
- "srclang": "de",
136
- "src": "http://www.example.com/path/to/german-subtitles.vtt"
137
- }
138
- ],
139
- "share": {
140
- "canonicalUrl": "http://www.example.com/path/to/video",
141
- "embedUrl": "http://www.example.com/embed/path/to/video"
142
- },
143
- "metadata": {
144
- "bio": {
145
- "title": "Author Name",
146
- "description": "Author description"
147
- },
148
- "abstract": {
149
- "title": "Modal Title",
150
- "description": "Video description"
151
- },
152
- "institution": {
153
- "title": "Institution Name",
154
- "description": "Institution description"
155
- }
156
- },
157
- "type": "full|main|beyond|expert|short",
158
- "showLogo": true,
159
- "isEmbedded": true,
160
- "theme": "light|dark",
161
- "background": true
162
- }
163
- }
164
- ```
105
+ Read the complete [LT Player License Agreement](LICENSE.md) before using the package. Licenses and
106
+ attributions for bundled open-source components are listed in
107
+ [Third-Party Notices](THIRD-PARTY-NOTICES.md).