@scarlett-player/hls 0.4.0 → 0.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/dist/{chunk-CBBDW7UR.js → chunk-I4BGO7UY.js} +4 -0
- package/dist/index.cjs +17 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +16 -1
- package/dist/light.cjs +17 -0
- package/dist/light.d.cts +2 -2
- package/dist/light.d.ts +2 -2
- package/dist/light.js +16 -1
- package/dist/{types-Co8zOXVb.d.cts → types-Df2TUpPu.d.cts} +1 -1
- package/dist/{types-Co8zOXVb.d.ts → types-Df2TUpPu.d.ts} +1 -1
- package/package.json +3 -3
|
@@ -149,6 +149,9 @@ function setupVideoEventHandlers(video, api) {
|
|
|
149
149
|
video.addEventListener(event, handler);
|
|
150
150
|
handlers.push({ event, handler });
|
|
151
151
|
};
|
|
152
|
+
addHandler("play", () => {
|
|
153
|
+
api.setState("paused", false);
|
|
154
|
+
});
|
|
152
155
|
addHandler("playing", () => {
|
|
153
156
|
api.setState("playing", true);
|
|
154
157
|
api.setState("paused", false);
|
|
@@ -257,6 +260,7 @@ function setupVideoEventHandlers(video, api) {
|
|
|
257
260
|
}
|
|
258
261
|
|
|
259
262
|
export {
|
|
263
|
+
formatLevel,
|
|
260
264
|
mapLevels,
|
|
261
265
|
setupHlsEventHandlers,
|
|
262
266
|
setupVideoEventHandlers
|
package/dist/index.cjs
CHANGED
|
@@ -238,6 +238,9 @@ function setupVideoEventHandlers(video, api) {
|
|
|
238
238
|
video.addEventListener(event, handler);
|
|
239
239
|
handlers.push({ event, handler });
|
|
240
240
|
};
|
|
241
|
+
addHandler("play", () => {
|
|
242
|
+
api.setState("paused", false);
|
|
243
|
+
});
|
|
241
244
|
addHandler("playing", () => {
|
|
242
245
|
api.setState("playing", true);
|
|
243
246
|
api.setState("paused", false);
|
|
@@ -654,6 +657,20 @@ function createHLSPlugin(config) {
|
|
|
654
657
|
if (!isNaN(levelIndex) && levelIndex >= 0 && levelIndex < hls.levels.length) {
|
|
655
658
|
hls.nextLevel = levelIndex;
|
|
656
659
|
api?.logger.debug(`Quality: queued switch to level ${levelIndex}`);
|
|
660
|
+
const targetLevel = hls.levels[levelIndex];
|
|
661
|
+
if (targetLevel) {
|
|
662
|
+
const label = formatLevel(targetLevel);
|
|
663
|
+
api?.setState("currentQuality", {
|
|
664
|
+
id: `level-${levelIndex}`,
|
|
665
|
+
label: `${label}...`,
|
|
666
|
+
// Ellipsis indicates switching in progress
|
|
667
|
+
width: targetLevel.width,
|
|
668
|
+
height: targetLevel.height,
|
|
669
|
+
bitrate: targetLevel.bitrate,
|
|
670
|
+
active: false
|
|
671
|
+
// Not yet active
|
|
672
|
+
});
|
|
673
|
+
}
|
|
657
674
|
}
|
|
658
675
|
}
|
|
659
676
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as HLSPluginConfig, I as IHLSPlugin } from './types-
|
|
2
|
-
export {
|
|
1
|
+
import { H as HLSPluginConfig, I as IHLSPlugin } from './types-Df2TUpPu.cjs';
|
|
2
|
+
export { a as HLSError, b as HLSLiveInfo, c as HLSQualityLevel } from './types-Df2TUpPu.cjs';
|
|
3
3
|
import '@scarlett-player/core';
|
|
4
4
|
|
|
5
5
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as HLSPluginConfig, I as IHLSPlugin } from './types-
|
|
2
|
-
export {
|
|
1
|
+
import { H as HLSPluginConfig, I as IHLSPlugin } from './types-Df2TUpPu.js';
|
|
2
|
+
export { a as HLSError, b as HLSLiveInfo, c as HLSQualityLevel } from './types-Df2TUpPu.js';
|
|
3
3
|
import '@scarlett-player/core';
|
|
4
4
|
|
|
5
5
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
+
formatLevel,
|
|
2
3
|
mapLevels,
|
|
3
4
|
setupHlsEventHandlers,
|
|
4
5
|
setupVideoEventHandlers
|
|
5
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-I4BGO7UY.js";
|
|
6
7
|
|
|
7
8
|
// src/hls-loader.ts
|
|
8
9
|
var hlsConstructor = null;
|
|
@@ -365,6 +366,20 @@ function createHLSPlugin(config) {
|
|
|
365
366
|
if (!isNaN(levelIndex) && levelIndex >= 0 && levelIndex < hls.levels.length) {
|
|
366
367
|
hls.nextLevel = levelIndex;
|
|
367
368
|
api?.logger.debug(`Quality: queued switch to level ${levelIndex}`);
|
|
369
|
+
const targetLevel = hls.levels[levelIndex];
|
|
370
|
+
if (targetLevel) {
|
|
371
|
+
const label = formatLevel(targetLevel);
|
|
372
|
+
api?.setState("currentQuality", {
|
|
373
|
+
id: `level-${levelIndex}`,
|
|
374
|
+
label: `${label}...`,
|
|
375
|
+
// Ellipsis indicates switching in progress
|
|
376
|
+
width: targetLevel.width,
|
|
377
|
+
height: targetLevel.height,
|
|
378
|
+
bitrate: targetLevel.bitrate,
|
|
379
|
+
active: false
|
|
380
|
+
// Not yet active
|
|
381
|
+
});
|
|
382
|
+
}
|
|
368
383
|
}
|
|
369
384
|
}
|
|
370
385
|
});
|
package/dist/light.cjs
CHANGED
|
@@ -238,6 +238,9 @@ function setupVideoEventHandlers(video, api) {
|
|
|
238
238
|
video.addEventListener(event, handler);
|
|
239
239
|
handlers.push({ event, handler });
|
|
240
240
|
};
|
|
241
|
+
addHandler("play", () => {
|
|
242
|
+
api.setState("paused", false);
|
|
243
|
+
});
|
|
241
244
|
addHandler("playing", () => {
|
|
242
245
|
api.setState("playing", true);
|
|
243
246
|
api.setState("paused", false);
|
|
@@ -647,6 +650,20 @@ function createHLSPlugin(config) {
|
|
|
647
650
|
if (!isNaN(levelIndex) && levelIndex >= 0 && levelIndex < hls.levels.length) {
|
|
648
651
|
hls.nextLevel = levelIndex;
|
|
649
652
|
api?.logger.debug(`Quality: queued switch to level ${levelIndex}`);
|
|
653
|
+
const targetLevel = hls.levels[levelIndex];
|
|
654
|
+
if (targetLevel) {
|
|
655
|
+
const label = formatLevel(targetLevel);
|
|
656
|
+
api?.setState("currentQuality", {
|
|
657
|
+
id: `level-${levelIndex}`,
|
|
658
|
+
label: `${label}...`,
|
|
659
|
+
// Ellipsis indicates switching in progress
|
|
660
|
+
width: targetLevel.width,
|
|
661
|
+
height: targetLevel.height,
|
|
662
|
+
bitrate: targetLevel.bitrate,
|
|
663
|
+
active: false
|
|
664
|
+
// Not yet active
|
|
665
|
+
});
|
|
666
|
+
}
|
|
650
667
|
}
|
|
651
668
|
}
|
|
652
669
|
});
|
package/dist/light.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as HLSPluginConfig, I as IHLSPlugin } from './types-
|
|
2
|
-
export {
|
|
1
|
+
import { H as HLSPluginConfig, I as IHLSPlugin } from './types-Df2TUpPu.cjs';
|
|
2
|
+
export { a as HLSError, b as HLSLiveInfo, c as HLSQualityLevel } from './types-Df2TUpPu.cjs';
|
|
3
3
|
import '@scarlett-player/core';
|
|
4
4
|
|
|
5
5
|
/**
|
package/dist/light.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as HLSPluginConfig, I as IHLSPlugin } from './types-
|
|
2
|
-
export {
|
|
1
|
+
import { H as HLSPluginConfig, I as IHLSPlugin } from './types-Df2TUpPu.js';
|
|
2
|
+
export { a as HLSError, b as HLSLiveInfo, c as HLSQualityLevel } from './types-Df2TUpPu.js';
|
|
3
3
|
import '@scarlett-player/core';
|
|
4
4
|
|
|
5
5
|
/**
|
package/dist/light.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
+
formatLevel,
|
|
2
3
|
mapLevels,
|
|
3
4
|
setupHlsEventHandlers,
|
|
4
5
|
setupVideoEventHandlers
|
|
5
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-I4BGO7UY.js";
|
|
6
7
|
|
|
7
8
|
// src/hls-loader-light.ts
|
|
8
9
|
var hlsConstructor = null;
|
|
@@ -358,6 +359,20 @@ function createHLSPlugin(config) {
|
|
|
358
359
|
if (!isNaN(levelIndex) && levelIndex >= 0 && levelIndex < hls.levels.length) {
|
|
359
360
|
hls.nextLevel = levelIndex;
|
|
360
361
|
api?.logger.debug(`Quality: queued switch to level ${levelIndex}`);
|
|
362
|
+
const targetLevel = hls.levels[levelIndex];
|
|
363
|
+
if (targetLevel) {
|
|
364
|
+
const label = formatLevel(targetLevel);
|
|
365
|
+
api?.setState("currentQuality", {
|
|
366
|
+
id: `level-${levelIndex}`,
|
|
367
|
+
label: `${label}...`,
|
|
368
|
+
// Ellipsis indicates switching in progress
|
|
369
|
+
width: targetLevel.width,
|
|
370
|
+
height: targetLevel.height,
|
|
371
|
+
bitrate: targetLevel.bitrate,
|
|
372
|
+
active: false
|
|
373
|
+
// Not yet active
|
|
374
|
+
});
|
|
375
|
+
}
|
|
361
376
|
}
|
|
362
377
|
}
|
|
363
378
|
});
|
|
@@ -98,4 +98,4 @@ interface IHLSPlugin extends Plugin<HLSPluginConfig> {
|
|
|
98
98
|
switchToHlsJs(): Promise<void>;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
export type { HLSPluginConfig as H, IHLSPlugin as I,
|
|
101
|
+
export type { HLSPluginConfig as H, IHLSPlugin as I, HLSError as a, HLSLiveInfo as b, HLSQualityLevel as c };
|
|
@@ -98,4 +98,4 @@ interface IHLSPlugin extends Plugin<HLSPluginConfig> {
|
|
|
98
98
|
switchToHlsJs(): Promise<void>;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
export type { HLSPluginConfig as H, IHLSPlugin as I,
|
|
101
|
+
export type { HLSPluginConfig as H, IHLSPlugin as I, HLSError as a, HLSLiveInfo as b, HLSQualityLevel as c };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scarlett-player/hls",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "HLS Provider Plugin for Scarlett Player",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@scarlett-player/core": "^0.
|
|
25
|
+
"@scarlett-player/core": "^0.2.0",
|
|
26
26
|
"hls.js": "^1.4.0"
|
|
27
27
|
},
|
|
28
28
|
"peerDependenciesMeta": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"vitest": "^1.6.0",
|
|
38
38
|
"@vitest/coverage-v8": "^1.6.0",
|
|
39
39
|
"jsdom": "^24.0.0",
|
|
40
|
-
"@scarlett-player/core": "0.4.
|
|
40
|
+
"@scarlett-player/core": "0.4.1"
|
|
41
41
|
},
|
|
42
42
|
"keywords": [
|
|
43
43
|
"video",
|