@openplayerjs/hls 3.3.0 → 3.4.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 +11 -11
- package/dist/.tsbuildinfo +1 -1
- package/dist/index.js +62 -1
- package/dist/index.js.map +1 -1
- package/dist/openplayer-hls.js +1 -1
- package/dist/openplayer-hls.js.map +1 -1
- package/dist/types/hls.d.ts +14 -0
- package/dist/types/hls.d.ts.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @openplayerjs/hls
|
|
2
2
|
|
|
3
3
|
> HLS streaming engine for [OpenPlayerJS](https://openplayerjs.com), powered by [hls.js](https://github.com/video-dev/hls.js).
|
|
4
4
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
## Installation
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
npm install @
|
|
14
|
+
npm install @openplayerjs/hls @openplayerjs/core hls.js
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
---
|
|
@@ -30,8 +30,8 @@ npm install @openplayer/hls @openplayer/core hls.js
|
|
|
30
30
|
## ESM usage
|
|
31
31
|
|
|
32
32
|
```ts
|
|
33
|
-
import { Core } from '@
|
|
34
|
-
import { HlsMediaEngine } from '@
|
|
33
|
+
import { Core } from '@openplayerjs/core';
|
|
34
|
+
import { HlsMediaEngine } from '@openplayerjs/hls';
|
|
35
35
|
|
|
36
36
|
const player = new Core(video, {
|
|
37
37
|
plugins: [
|
|
@@ -99,7 +99,7 @@ This means `HlsMediaEngine` is compatible with the surface pipeline and can coex
|
|
|
99
99
|
Returns the underlying hls.js instance when hls.js is active. Use this to access hls.js-specific APIs (quality levels, stats, P2P plugins, etc.):
|
|
100
100
|
|
|
101
101
|
```ts
|
|
102
|
-
import { HlsMediaEngine } from '@
|
|
102
|
+
import { HlsMediaEngine } from '@openplayerjs/hls';
|
|
103
103
|
|
|
104
104
|
const engine = player.getPlugin<HlsMediaEngine>('hls');
|
|
105
105
|
const hls = engine?.getAdapter();
|
|
@@ -138,7 +138,7 @@ player.on(Hls.Events.LEVEL_SWITCHED, (data) => {
|
|
|
138
138
|
The core `levels` / `level` API was removed in v3. To build your own quality picker, access the `hls.js` instance directly:
|
|
139
139
|
|
|
140
140
|
```ts
|
|
141
|
-
import { HlsMediaEngine } from '@
|
|
141
|
+
import { HlsMediaEngine } from '@openplayerjs/hls';
|
|
142
142
|
|
|
143
143
|
const engine = player.getPlugin<HlsMediaEngine>('hls');
|
|
144
144
|
const hls = engine?.getAdapter();
|
|
@@ -152,16 +152,16 @@ if (hls) {
|
|
|
152
152
|
}
|
|
153
153
|
```
|
|
154
154
|
|
|
155
|
-
You can then use `extendControls` + `addControl` from `@
|
|
155
|
+
You can then use `extendControls` + `addControl` from `@openplayerjs/player` to build a custom quality selector button.
|
|
156
156
|
|
|
157
157
|
---
|
|
158
158
|
|
|
159
159
|
## Peer dependencies
|
|
160
160
|
|
|
161
|
-
| Package
|
|
162
|
-
|
|
|
163
|
-
| `@
|
|
164
|
-
| `hls.js`
|
|
161
|
+
| Package | Required version |
|
|
162
|
+
| -------------------- | ---------------- |
|
|
163
|
+
| `@openplayerjs/core` | `>=3.0.0` |
|
|
164
|
+
| `hls.js` | `>=1.0.0` |
|
|
165
165
|
|
|
166
166
|
---
|
|
167
167
|
|