@clappr/hlsjs-playback 2.0.1 → 3.0.0

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
@@ -11,27 +11,36 @@ A [Clappr](https://github.com/clappr/clappr) playback to play HTTP Live Streamin
11
11
  <a href="https://www.jsdelivr.com/package/npm/@clappr/hlsjs-playback"><img alt="jsDelivr hits (npm)" src="https://img.shields.io/jsdelivr/npm/hm/@clappr/hlsjs-playback?color=orange"></a>
12
12
  </p>
13
13
 
14
+ > **Breaking change in 3.0.0 —** `hls.js` is no longer bundled. Every artifact now expects
15
+ > you to provide it. See the migration note below.
14
16
 
15
17
  ## Usage
16
18
 
17
19
  You can use it from JSDelivr:
18
20
 
19
- `https://cdn.jsdelivr.net/npm/@clappr/hlsjs-playback@latest/dist/hlsjs-playback.min.js`
21
+ ```html
22
+ <script src="https://cdn.jsdelivr.net/npm/@clappr/core@latest/dist/clappr-core.min.js"></script>
23
+ <script src="https://cdn.jsdelivr.net/npm/hls.js@1/dist/hls.min.js"></script>
24
+ <script src="https://cdn.jsdelivr.net/npm/@clappr/hlsjs-playback@3/dist/hlsjs-playback.min.js"></script>
25
+ ```
20
26
 
21
27
  or as an npm package:
22
28
 
23
- `yarn add @clappr/hlsjs-playback`
29
+ `yarn add @clappr/hlsjs-playback hls.js@^1`
24
30
 
25
31
  ### Which artifact to load
26
32
 
27
33
  | Scenario | Artifact |
28
34
  |---|---|
29
- | `<script>` / CDN alongside `@clappr/core` (or `@clappr/player`) | `dist/hlsjs-playback.min.js` |
30
- | Bundler that should resolve `hls.js` itself | `dist/hlsjs-playback.external.js` (or `.external.min.js`) |
31
- | Bundler / ESM entry (embeds `hls.js`, leaves `@clappr/core` external) | `dist/hlsjs-playback.esm.js` (package `module` field) |
32
- | Default CommonJS / UMD entry (embeds `hls.js`) | `dist/hlsjs-playback.js` (package `main` field) |
35
+ | `<script>` / CDN, after `@clappr/core` and `hls.js` | `dist/hlsjs-playback.min.js` |
36
+ | Bundler, CommonJS / UMD entry | `dist/hlsjs-playback.js` (package `main`) |
37
+ | Bundler, ESM entry | `dist/hlsjs-playback.esm.js` (package `module`) |
38
+
39
+ **Migration note (3.0+):** Every artifact now expects `hls.js` from the page or bundler. If you loaded `hlsjs-playback.min.js` with a single script tag, add `hls.js` before it. If you aliased the deep path to avoid the bundled copy, remove that entry from your bundler's `resolve.alias` (webpack) or equivalent (Vite `resolve.alias`, Rollup `alias`) — the default entry is external now:
33
40
 
34
- **Migration note (2.0+):** `hlsjs-playback.min.js` no longer embeds `@clappr/core`. Load core (or player) first so a global `Clappr` exists. Use `.external` builds when you supply your own `hls.js`.
41
+ ```diff
42
+ - '@clappr/hlsjs-playback': '@clappr/hlsjs-playback/dist/hlsjs-playback.external.js',
43
+ ```
35
44
 
36
45
  Then just add `HlsjsPlayback` into the list of plugins of your player instance:
37
46