@clappr/hlsjs-playback 2.0.1 → 3.0.1

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
@@ -2,36 +2,42 @@
2
2
 
3
3
  A [Clappr](https://github.com/clappr/clappr) playback to play HTTP Live Streaming (HLS) based on the [hls.js](https://github.com/video-dev/hls.js).
4
4
 
5
- <p>
6
- <a href="https://www.npmjs.com/package/@clappr/hlsjs-playback"><img src="https://badge.fury.io/js/%40clappr%2Fhlsjs-playback.svg"></a>
7
- <a href="https://bundlephobia.com/result?p=@clappr/hlsjs-playback@latest"><img src="https://img.shields.io/bundlephobia/min/@clappr/hlsjs-playback"></a>
8
- <a href="https://travis-ci.org/clappr/hlsjs-playback"><img src="https://travis-ci.org/clappr/hlsjs-playback.svg?branch=master"></a>
9
- <a href="https://coveralls.io/github/clappr/hlsjs-playback?branch=master"><img src="https://coveralls.io/repos/github/clappr/hlsjs-playback/badge.svg?branch=master"></a>
10
- <a href="https://github.com/clappr/hlsjs-playback/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-BSD--3--Clause-blue.svg"></a>
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
- </p>
5
+ [![CI](https://github.com/clappr/clappr/actions/workflows/ci.yml/badge.svg)](https://github.com/clappr/clappr/actions/workflows/ci.yml)
6
+ [![npm version](https://img.shields.io/npm/v/@clappr/hlsjs-playback.svg?color=cb3837)](https://www.npmjs.com/package/@clappr/hlsjs-playback)
7
+ [![License](https://img.shields.io/github/license/clappr/clappr)](https://github.com/clappr/clappr/blob/main/LICENSE)
8
+ [![minified size](https://img.shields.io/bundlephobia/min/@clappr/hlsjs-playback)](https://bundlephobia.com/package/@clappr/hlsjs-playback)
9
+ [![jsDelivr monthly downloads](https://img.shields.io/jsdelivr/npm/hm/@clappr/hlsjs-playback?color=orange)](https://www.jsdelivr.com/package/npm/@clappr/hlsjs-playback)
13
10
 
11
+ > **Breaking change in 3.0.0 —** `hls.js` is no longer bundled. Every artifact now expects
12
+ > you to provide it. See the migration note below.
14
13
 
15
14
  ## Usage
16
15
 
17
16
  You can use it from JSDelivr:
18
17
 
19
- `https://cdn.jsdelivr.net/npm/@clappr/hlsjs-playback@latest/dist/hlsjs-playback.min.js`
18
+ ```html
19
+ <script src="https://cdn.jsdelivr.net/npm/@clappr/core@latest/dist/clappr-core.min.js"></script>
20
+ <script src="https://cdn.jsdelivr.net/npm/hls.js@1/dist/hls.min.js"></script>
21
+ <script src="https://cdn.jsdelivr.net/npm/@clappr/hlsjs-playback@3/dist/hlsjs-playback.min.js"></script>
22
+ ```
20
23
 
21
24
  or as an npm package:
22
25
 
23
- `yarn add @clappr/hlsjs-playback`
26
+ `yarn add @clappr/hlsjs-playback hls.js@^1`
24
27
 
25
28
  ### Which artifact to load
26
29
 
27
30
  | Scenario | Artifact |
28
31
  |---|---|
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) |
32
+ | `<script>` / CDN, after `@clappr/core` and `hls.js` | `dist/hlsjs-playback.min.js` |
33
+ | Bundler, CommonJS / UMD entry | `dist/hlsjs-playback.js` (package `main`) |
34
+ | Bundler, ESM entry | `dist/hlsjs-playback.esm.js` (package `module`) |
35
+
36
+ **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
37
 
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`.
38
+ ```diff
39
+ - '@clappr/hlsjs-playback': '@clappr/hlsjs-playback/dist/hlsjs-playback.external.js',
40
+ ```
35
41
 
36
42
  Then just add `HlsjsPlayback` into the list of plugins of your player instance:
37
43