@scarlett-player/playlist 1.0.0 → 1.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/dist/index.cjs +4 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -49,7 +49,10 @@ function createPlaylistPlugin(config) {
|
|
|
49
49
|
const mergedConfig = { ...DEFAULT_CONFIG, ...config };
|
|
50
50
|
let api = null;
|
|
51
51
|
let tracks = mergedConfig.tracks || [];
|
|
52
|
-
let currentIndex = -1;
|
|
52
|
+
let currentIndex = mergedConfig.initialIndex ?? -1;
|
|
53
|
+
if (currentIndex < -1 || currentIndex >= tracks.length) {
|
|
54
|
+
currentIndex = -1;
|
|
55
|
+
}
|
|
53
56
|
let shuffle = mergedConfig.shuffle || false;
|
|
54
57
|
let repeat = mergedConfig.repeat || "none";
|
|
55
58
|
let shuffleOrder = [];
|
package/dist/index.d.cts
CHANGED
|
@@ -78,6 +78,8 @@ interface PlaylistPluginConfig {
|
|
|
78
78
|
autoLoad?: boolean;
|
|
79
79
|
/** Milliseconds to wait before auto-advancing to next track (default: 0) */
|
|
80
80
|
advanceDelay?: number;
|
|
81
|
+
/** Initial track index when tracks are provided and the player loads the first source via constructor (default: -1, meaning no track is active yet) */
|
|
82
|
+
initialIndex?: number;
|
|
81
83
|
/** Index signature for PluginConfig compatibility */
|
|
82
84
|
[key: string]: unknown;
|
|
83
85
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -78,6 +78,8 @@ interface PlaylistPluginConfig {
|
|
|
78
78
|
autoLoad?: boolean;
|
|
79
79
|
/** Milliseconds to wait before auto-advancing to next track (default: 0) */
|
|
80
80
|
advanceDelay?: number;
|
|
81
|
+
/** Initial track index when tracks are provided and the player loads the first source via constructor (default: -1, meaning no track is active yet) */
|
|
82
|
+
initialIndex?: number;
|
|
81
83
|
/** Index signature for PluginConfig compatibility */
|
|
82
84
|
[key: string]: unknown;
|
|
83
85
|
}
|
package/dist/index.js
CHANGED
|
@@ -24,7 +24,10 @@ function createPlaylistPlugin(config) {
|
|
|
24
24
|
const mergedConfig = { ...DEFAULT_CONFIG, ...config };
|
|
25
25
|
let api = null;
|
|
26
26
|
let tracks = mergedConfig.tracks || [];
|
|
27
|
-
let currentIndex = -1;
|
|
27
|
+
let currentIndex = mergedConfig.initialIndex ?? -1;
|
|
28
|
+
if (currentIndex < -1 || currentIndex >= tracks.length) {
|
|
29
|
+
currentIndex = -1;
|
|
30
|
+
}
|
|
28
31
|
let shuffle = mergedConfig.shuffle || false;
|
|
29
32
|
let repeat = mergedConfig.repeat || "none";
|
|
30
33
|
let shuffleOrder = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scarlett-player/playlist",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Playlist Plugin for Scarlett Player - Queue management, shuffle, repeat, and gapless playback",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@scarlett-player/core": "^1.0.
|
|
25
|
+
"@scarlett-player/core": "^1.0.1"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"tsup": "^8.0.0",
|
|
29
29
|
"typescript": "^5.3.0",
|
|
30
30
|
"vitest": "^1.6.0",
|
|
31
31
|
"jsdom": "^24.0.0",
|
|
32
|
-
"@scarlett-player/core": "1.0.
|
|
32
|
+
"@scarlett-player/core": "1.0.1"
|
|
33
33
|
},
|
|
34
34
|
"keywords": [
|
|
35
35
|
"video",
|