@scarlett-player/embed 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/embed.js CHANGED
@@ -4954,7 +4954,10 @@ function createPlaylistPlugin(config) {
4954
4954
  const mergedConfig = { ...DEFAULT_CONFIG$1, ...config };
4955
4955
  let api = null;
4956
4956
  let tracks = mergedConfig.tracks || [];
4957
- let currentIndex = -1;
4957
+ let currentIndex = mergedConfig.initialIndex ?? -1;
4958
+ if (currentIndex < -1 || currentIndex >= tracks.length) {
4959
+ currentIndex = -1;
4960
+ }
4958
4961
  let shuffle = mergedConfig.shuffle || false;
4959
4962
  let repeat = mergedConfig.repeat || "none";
4960
4963
  let shuffleOrder = [];